Fatal Error: %1$s (# %2$s). [message #826] |
Wed, 16 May 2007 12:23 |
danpoleary
Messages: 49 Registered: February 2007
|
Member |
|
|
Hello,
I packaged up an existing installation, and deployed on a new system. I moved both the databases and the Radicore tree.
Now, when I try to add records to specific tables, I get:
-------------------------------------------------------
This application has encountered an unrecoverable error
The following has been reported to the administrator:
2007-05-16 12:19:26
Fatal Error: %1$s (# %2$s).
Error in line 278 of file '/data/www/html/search/includes/dml.mysqli.class.inc'.
Script: /search/search/configuration(add1).php
User Id: MGR
Remote Address: 142.101.244.26
Request URI: /search/search/configuration(add1).php
--------------------------------------------------
Other tables work fine, any ideas, I have turned on all the debugging features, but cannot see anything in those.
Thanks,
Dan
|
|
|
Re: Fatal Error: %1$s (# %2$s). [message #827 is a reply to message #826] |
Wed, 16 May 2007 13:07 |
AJM
Messages: 2368 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
If you look in file errorlog.html do you see any more information?
I have tried forcing an error at that line of code by (a) corrupting the database name, and (b) corrupting the sql query, but I always get a proper error message, so I cannot immediately see what is wrong.
Can you uncomment the line beginning with '//logstuff' at the start of the error handler (in file error.inc) so that additional information is written to errorlog.html, then run your code agai to see what happens?
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
|
|
Re: Fatal Error: %1$s (# %2$s). [message #831 is a reply to message #826] |
Wed, 16 May 2007 14:43 |
danpoleary
Messages: 49 Registered: February 2007
|
Member |
|
|
Hi Tony,
I looked into that again, and found something strange. Even though the database had defined the primary key, and the dictionary column definition said it was primary, the classes file for that table did not have the column as primary. I re-exported, and cleaned that one up. I am not sure why it changed from one system to the other, but I will try to repeat it on another test system, and let you know if the problem re-occurs.
As an aside, I had a similar problem with another table, but that table has everything defined correctly. I will try to dig into that, and if still stuck, pass it along.
Thanks for the help,
Dan
|
|
|
Re: Fatal Error: %1$s (# %2$s). [message #834 is a reply to message #831] |
Wed, 16 May 2007 19:02 |
AJM
Messages: 2368 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
Before a new record is actually inserted a check is made to ensure that the primary key does not already exist, and the identity of the primary key is obtained from $this->primary_key in the <table>.dict.inc file. If this is empty then the 'SELECT count(*) FROM $tablename WHERE $where' query will fail.
When you are transferring an application from one server to another it is not necessary to re-export all the files from the data dictionary - you can simply copy across all the <table>.class.inc and <table>.dict.inc files from the first server.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|