DB transaction error when creating new objects

Author Message

James Robertson

Tuesday 06 June 2006 9:19:14 pm

We have recently upgraded one of our eZ publish sites from 3.4.1 to 3.6.4. Now when we try to create a new object through the admin interface, we get a DB transaction error:
"
Fatal error: A database transaction in eZ publish failed.

The current execution was stopped to prevent further problems.
You should contact the System Administrator of this site with the information on this page.
The current transaction ID is TRANSID-c73d72f9d399fdd934599f68c9e41446 and has been logged.
Please include the transaction ID and the current URL when contacting the system administrator.
"

Debug output shows:
"
Error: eZMySQLDB Jun 07 2006 16:16:50

Query error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 6. Query: SELECT
parent_node_id
FROM
ezcontentobject_tree
WHERE
node_id =
"

Obviously the empty node_id is the problem. However we can't work out why this is occuring or even (frustratingly) which files is making this SQL query so that we can start debugging. Any ideas?

Kristof Coomans

Tuesday 06 June 2006 11:24:04 pm

Hi James

You can put

var_dump( debug_backtrace() );

inside eZMySQLDB (right before the query gets executed).

I recommend you to upgrade to the latest version of the 3.6 branch. It maybe could be a bug that has been fixed.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

James Robertson

Thursday 08 June 2006 10:11:31 pm

Thanks for the tip Kristof. :-)

[No need to use debug_backtrace() however as I have Zend Studio with breakpoints and a call stack view - lucky me ;-]

Have finally tracked down the error in our override template for design/admin/templates/content/edit.tpl. Seems that '{$object.main_parent_node_id}' was causing the fatal DB Transaction error, which is a bit poor.

[I'm guessing main_node_id is not set for new (unpublished) objects and therefore the lookup of main_parent_node_id was causing eZ publish to crash.]

Kristof Coomans

Thursday 08 June 2006 11:19:15 pm

That's a bug I've reported a while ago: http://ez.no/community/bugs/fatal_error_with_attribute_object_main_parent_node_id

It has been fixed in 3.6.5.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

James Robertson

Monday 12 June 2006 3:06:43 pm

Nice work Kristof. I guess you were right about upgrading to the latest version of eZ publish :-)

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:36:05
Script start
Timing: Jan 18 2025 19:36:05
Module start 'layout'
Timing: Jan 18 2025 19:36:05
Module start 'content'
Timing: Jan 18 2025 19:36:05
Module end 'content'
Timing: Jan 18 2025 19:36:05
Script end

Main resources:

Total runtime0.8461 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 588.1641152.6563
Module start 'layout' 0.00520.0032 740.820339.5078
Module start 'content' 0.00840.8362 780.3281569.5703
Module end 'content' 0.84460.0015 1,349.898416.1094
Script end 0.8461  1,366.0078 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3943160.0002
Check MTime0.00150.1723160.0001
Mysql Total
Database connection0.00090.110610.0009
Mysqli_queries0.788093.1380630.0125
Looping result0.00060.0737610.0000
Template Total0.812196.020.4060
Template load0.00230.268420.0011
Template processing0.809895.707920.4049
Template load and register function0.00010.010110.0001
states
state_id_array0.00070.086910.0007
state_identifier_array0.00150.175620.0007
Override
Cache load0.00200.2344430.0000
Sytem overhead
Fetch class attribute can translate value0.00060.065320.0003
Fetch class attribute name0.00100.116770.0001
XML
Image XML parsing0.00090.107320.0005
class_abstraction
Instantiating content class attribute0.00000.0025100.0000
General
dbfile0.00090.1088220.0000
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 26
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs