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.