I'm seeing three SQL constraint errors when I start up the Nuxeo/JBoss
server talking to a MySQL/InnoDB database. By default it appears MySQL
is rather loose with foreign key constraint checking, which is why we
are requiring InnoDB tables.
This one is the last of three errors, noted because I can provide some
MySQL debug info below:
03:22:15,537 WARN [JDBCExceptionReporter] SQL Error: 1452, SQLState: 23000
03:22:15,538 ERROR [JDBCExceptionReporter] Cannot add or update a
child row: a foreign key constraint fails (`nuxeo/JBPM_NODE`,
CONSTRAINT `FK_NODE_PROCDEF` FOREIGN KEY (`PROCESSDEFINITION_`)
REFERENCES `jbpm_processdefinition` (`ID_`))
03:22:15,538 ERROR [ComponentManager] Failed to create component:
service:org.nuxeo.ecm.platform.forum.DefaultWorkflowDefinitionContributions
org.hibernate.exception.ConstraintViolationException: could not
insert: [org.jbpm.graph.node.StartState]
If I check the MySQL InnoDB status on my db server, I see some useful
info on the foreign key error. At the time of this attempted insert,
it appears that there is no JBPM_PROCESSDEFINITION record with an 'id'
of 197. That would explain why the SQL INSERT into JBPM_NODE is
failing on the constraint. The highest JBPM_PROCESSDEFINITION id in
the JBPM_NODE table in this database is 185, so this was working until
recently. I do see that new rows were added to the
JBPM_PROCESSDEFINITION table, so an ID_ of 197 now exists, but the
next time I start the server it will be looking to insert an
incremented foreign key value of 198 or higher into JBPM_NODE, so the
constraint check will fail every time going forward.
mysql> show engine innodb status;
------------------------
LATEST FOREIGN KEY ERROR
------------------------
080717 3:22:15 Transaction:
TRANSACTION 0 1624, ACTIVE 0 sec, process no 7265, OS thread id
1175591232 inserting, thread declared inside InnoDB 500
mysql tables in use 1, locked 1
2 lock struct(s), heap size 368, undo log entries 1
MySQL thread id 172, query id 5370 216.87.95.92 el_user update
insert into JBPM_NODE (NAME_, PROCESSDEFINITION_, ISASYNC_, ACTION_,
SUPERSTATE_, CLASS_) values ('start', 197, 0, null, null, 'R')
Foreign key constraint fails for table `nuxeo/JBPM_NODE`:
,
CONSTRAINT `FK_NODE_PROCDEF` FOREIGN KEY (`PROCESSDEFINITION_`)
REFERENCES `jbpm_processdefinition` (`ID_`)
Trying to add to index `FK_NODE_PROCDEF` tuple:
DATA TUPLE: 2 fields;
0: len 8; hex 80000000000000c5; asc ;; 1: len 8; hex
800000000000022c; asc ,;;
But the parent table `nuxeo/jbpm_processdefinition` or its .ibd file
does not currently exist!
A few things changed recently for me. First, I upgraded this Nuxeo
instance from 5.1.4 to 5.1.5. Second, I've moved the MySQL database to
a remote host. One concern would be if the order in which the
JBPM_NODE and JBPM_PROCESSDEFINITION records are being added changed
in the new release. Maybe JBPM_PROCESSDEFINITION record was correctly
being added first, but is now being added after the attempt to add a
JBPM_NODE record with the invalid foreign key value?
The first error is the following and the second error looks identical
to the third error showcased above.
03:36:38,387 WARN [JDBCExceptionReporter] SQL Error: 1452, SQLState: 23000
03:36:38,388 ERROR [JDBCExceptionReporter] Cannot add or update a
child row: a foreign key constraint fails (`nuxeo/JBPM_ACTION`,
CONSTRAINT `FK_ACTION_EVENT` FOREIGN KEY (`EVENT_`) REFERENCES
`jbpm_event` (`ID_`))
03:36:38,390 ERROR [ComponentManager] Failed to create component:
service:org.nuxeo.ecm.platform.workflow.DefaultWorkflowDefinitionContributions
org.hibernate.exception.ConstraintViolationException: could not
insert: [org.jbpm.graph.action.Script]
The server does start up and I can login from a browser and click
around, but I'm concerned about some corrupt state on the server given
those three failed SQL INSERTs. What are we risking by proceeding with
missing JBPM_ACTION and JBPM_NODE records (data)?
- Alex
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm