Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » RADICORE Installation Issues » Fatal Error: %1$s (# %2$s).
Fatal Error: %1$s (# %2$s). [message #826] Wed, 16 May 2007 12:23 Go to next message
danpoleary is currently offline  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 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2367
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?


Re: Fatal Error: %1$s (# %2$s). [message #828 is a reply to message #827] Wed, 16 May 2007 13:42 Go to previous messageGo to next message
danpoleary is currently offline  danpoleary
Messages: 49
Registered: February 2007
Member
Thanks Tony,

I uncommented the line indicated, and here is what is logged:

<h2>2007-05-16 13:38:46</h2><p>Fatal Error: %1$s (# %2$s).</p><p>Error in line 278 of file '/data/www/html/search/includes/dml.mysqli.class.inc'.</p><p >Script: /search/search/configuration(add1).php</p><p>User Id: MGR</p><p>Remote Address: 142.101.244.26</p><p>Request URI: /search/search/configuration(add1).php</p>
<p>Page Stack:</p>
<pre>
[0] main_menu
[1] sanitize
[2] san_configuration(list1)
[3] san_configuration(add1)

</pre>
<pre>
0: array =
function: string = errorHandler
args: array =
0: integer = 256
1: string = SQL
2: string = /data/www/html/search/includes/dml.mysqli.class.inc
3: integer = 278
4: array =
dbname: string = sanitizer
tablename: string = configuration
where: string = SELECT count(*) FROM configuration WHERE *NO PRIMARY KEY HAS BEEN DEFINED*
result: boolean =
1: array =
file: string = /data/www/html/search/includes/dml.mysqli.class.inc
line: integer = 278
function: string = trigger_error
args: array =
0: string = SQL
1: integer = 256
2: array =
file: string = /data/www/html/search/includes/dml.mysqli.class.inc
line: integer = 691
function: string = getCount
class: string = mysql
object: object = Object id #2
type: string = ->
args: array =
0: string = sanitizer
1: string = configuration
2: string = SELECT count(*) FROM configuration WHERE *NO PRIMARY KEY HAS BEEN DEFINED*
3: array =
file: string = /data/www/html/search/includes/std.table.class.inc
line: integer = 4127
function: string = insertRecord
class: string = mysql
object: object = Object id #2
type: string = ->
args: array =
0: string = sanitizer
1: string = configuration
2: array =
parameter: string = testit
value: string = /testit
4: array =
file: string = /data/www/html/search/includes/std.table.class.inc
line: integer = 2058
function: string = _dml_insertRecord
class: string = Default_Table
object: object = Object id #6
type: string = ->
args: array =
0: array =
parameter: string = testit
value: string = /testit
5: array =
file: string = /data/www/html/search/includes/std.add1.inc
line: integer = 90
function: string = insertRecord
class: string = Default_Table
object: object = Object id #6
type: string = ->
args: array =
0: array =
parameter: string = testit
value: string = /testit
6: array =
file: string = /data/www/html/search/search/configuration(add1).php
line: integer = 9
args: array =
0: string = /data/www/html/search/includes/std.add1.inc
function: string = require

</pre>


Let me know if you need anything else

Dan
Re: Fatal Error: %1$s (# %2$s). [message #829 is a reply to message #828] Wed, 16 May 2007 13:57 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2367
Registered: April 2006
Location: Surrey, UK
Senior Member
Does the text "SELECT count(*) FROM configuration WHERE *NO PRIMARY KEY HAS BEEN DEFINED*" mean anything?

Re: Fatal Error: %1$s (# %2$s). [message #830 is a reply to message #826] Wed, 16 May 2007 14:19 Go to previous messageGo to next message
danpoleary is currently offline  danpoleary
Messages: 49
Registered: February 2007
Member
Hi Tony,

I looked at that before I posted, The database has the primary key defined, and the entry for that column in the dictionary also has it defined.

I was wondering why it would have that message, and chalked it up to something else. Any ideas why it would not recognize the key field?


Thanks

Dan
Re: Fatal Error: %1$s (# %2$s). [message #831 is a reply to message #826] Wed, 16 May 2007 14:43 Go to previous messageGo to next message
danpoleary is currently offline  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 Go to previous message
AJM is currently offline  AJM
Messages: 2367
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.


Previous Topic: Error while connecting to PostgreSQL from WindowsXP
Next Topic: Path information
Goto Forum:
  


Current Time: Fri Nov 22 10:54:25 EST 2024

Total time taken to generate the page: 0.01262 seconds