Forums / Install & configuration / DB transaction error when creating new objects

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 :-)

eZ debug

Timing: Jan 20 2025 09:04:54
Script start
Timing: Jan 20 2025 09:04:54
Module start 'content'
Timing: Jan 20 2025 09:04:54
Module end 'content'
Timing: Jan 20 2025 09:04:54
Script end

Main resources:

Total runtime0.1819 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 589.2031180.8047
Module start 'content' 0.00680.0046 770.007898.1016
Module end 'content' 0.01150.1703 868.1094528.3750
Script end 0.1818  1,396.4844 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00372.0142200.0002
Check MTime0.00150.8161200.0001
Mysql Total
Database connection0.00090.504710.0009
Mysqli_queries0.132672.88471410.0009
Looping result0.00140.75711390.0000
Template Total0.170093.410.1700
Template load0.00080.458010.0008
Template processing0.169192.977110.1691
Override
Cache load0.00060.320510.0006
Sytem overhead
Fetch class attribute can translate value0.00070.379310.0007
XML
Image XML parsing0.00020.127010.0002
General
dbfile0.00633.4417200.0003
String conversion0.00000.004330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs