I have a brand-new, barely configured installation of 3.9.1 on a SuSe linux server. I am attempting to create a new resource, but when I click on the add resource button, I get the following error message:
Uncaught Exception
Message: Attempt to load Resource with unknown ID (-1).
Location: lib/ScoutLib/Item.php[48]
Trace:
Message: Attempt to load Resource with unknown ID (-1).
Location: lib/ScoutLib/Item.php[48]
Trace:
#0 objects/Resource.php(27): Item->__construct(-1)
#1 objects/Resource.php(73): Resource->__construct(-1)
#2 pages/EditResource.php(51): Resource::Create(0)
#3 lib/ScoutLib/ApplicationFramework.php(585): include('/srv/www/htdocs...')
#4 index.php(65): ApplicationFramework->LoadPage('EditResource')
#5 {main}
I am on PHP5 with Apache 2. I have another cwis 3.9.1 server running in another folder, and it works great.
Any ideas?
Matt
What version of mysql are you running? And which exact version of PHP (e.g., 5.4.45, 5.5.38, etc)?
When you ran the installation, there were no errors or warnings and you have the sample resources? The installer uses the same
Resource::Create()
call thatpages/EditResource
does; I would have expected the installer to error out if that call were failing.If you run the following SQL against your database (e.g., with the
mysql
command-line tool), does it succeed or give an error?(This is the SQL that should have been run on line 63 of
Resource::Create()
, just prior to thenew Resource()
call on line 73 that is failing for you.)Thanks for the quick response! I should have inlcuded that information, my apologies.
I have Mysql version 5.0.94, PHP version 5.6.27.
Installation was normal, and I had the sample entries, but I did get an error message when I wanted to delete the sample entries using the administration option. The error is: Parse error: syntax error, unexpected '{', expecting '(' in /srv/www/htdocs/cwis2/pages/PurgeSampleDataExecute.php on line 94
When I run that command against the database, I get the following error:
ERROR 1364 (HY000): Field 'DateOfRecordCreation' doesn't have a default value
Regarding
PurgeSampleDataExecute.php
, if you change line 93 fromcatch
tocatch (Exception $e)
, that should resolve the problem. Thank you for reporting this, we'll have it fixed in the next CWIS release.The SQL error is... perplexing. The
Resources
table is created byinstall/CreateTables.sql
, and line 308 in that file gives gives aDEFAULT NULL
forDateOfRecordCreation
. If you runSHOW CREATE TABLE Resources
, does it list aDEFAULT
forDateOfRecordCreation
?Is it possible that the database you are using was created by an earlier version of CWIS? The '
DEFAULT NULL
' wasn't always there forDoRC
, we added it in May 2015 to appease versions of MySQL in whichsql_mode
defaults toSTRICT_TRANS_TABLES
(previously it had beenTRADITIONAL
, which wasn't so fussy about requiring defaults for everything).I checked the Resources table, and the default for DateOfRecordCreation is not set to null.
I think I did install the current version of CWIS and then upgraded it to the 3.9.1 version. I did the same thing when I installed the other copy I have running because it had some feature that I wanted or needed.
I tried to update the table to add DEFAULT null to the Resources table, and that made things worse. Apparently my Mysql skills are lacking. I will try to restore the table. If not, I will reinstall the application. I had no records in yet anyway!
Matt
I was not able to restore the table, so I just re-installed the application. Now I am getting an error message during the install. It gets to "initializing application framework" and then throws this error:
Message: Attempt to load metadata schema with invalid ID (0) at MetricsRecorder.php:46.
Location: objects/MetadataSchema.php[89]
Trace:
Any ideas on that one?
Thanks!
Matt
Looks like you've still got a '
VERSION
' file in your site directory from your earlier install. This file makes CWIS think you're doing an upgrade or possibly a reinstall, such that there will be existing data in your database. When no such data exists, it casues the above exception.It should work to just delete the
VERSION
file and try again, but I'd suggest completely wiping out the earlier installation (i.e.,rm -rf
your site folder and drop the database) to be sure you're really starting from scratch, without any leftover bits of the previous install for the new one to trip on.Actually, I did. I dropped the mysql tables and deleted the directories. This error message is from a brand-new freshly downloaded installation.
Can you attach a copy of your
local/logs/install.log
?Attached.
There doesn't appear to be an attachment.