[otrs] Troubleshooting DBUpdate-to-6.pl errors - FK issue

123 views
Skip to first unread message

Nick Bright

unread,
Sep 19, 2019, 2:59:05 PM9/19/19
to ot...@lists.otrs.org
Greetings,

I'm working on upgrading to v6, and in the process I'm getting an error
on Step 31/44 in DBUpdate-to-6.pl, clearly caused by some error in the
database. I'm trying to find that error to correct it, but the error
message isn't giving me enough information to do so.

Does anybody have any suggestions on how to find the offending data?
Once I find it, then I can figure out what to do to correct it.

Step 31 of 44: Post changes on article related tables ...

        - Reseting auto-incremental if needed for article table.
        - Performing needed actions on article_data_mime table.
        - Performing needed actions on article_data_mime_plain table.
        - Performing needed actions on article_data_mime_attachment table.
        - Re-create foreign keys pointing to the old article table.
[Thu Sep 19 13:31:20 2019] DBUpdate-to-6.pl: DBD::mysql::db do failed:
Cannot add or update a child row: a foreign key constraint fails
(`otrs`.`#sql-5e0_29`, CONSTRAINT `FK_ticket_history_article_id_id`
FOREIGN KEY (`article_id`) REFERENCES `article` (`id`)) at
/opt/otrs/Kernel/System/DB.pm line 470.
ERROR: OTRS-otrs.Console.pl-Dev::Code::CPANAudit-10 Perl: 5.16.3 OS:
linux Time: Thu Sep 19 13:31:20 2019

 Message: Cannot add or update a child row: a foreign key constraint
fails (`otrs`.`#sql-5e0_29`, CONSTRAINT
`FK_ticket_history_article_id_id` FOREIGN KEY (`article_id`) REFERENCES
`article` (`id`)), SQL: 'EXECUTE FKStatement'

 Traceback (5899):
   Module: scripts::DBUpdateTo6::Base::ExecuteXMLDBString Line: 394
   Module: scripts::DBUpdateTo6::Base::ExecuteXMLDBArray Line: 342
   Module:
scripts::DBUpdateTo6::PostArticleTableStructureChanges::_RecreateForeignKeysPointingToArticleTable
Line: 419
   Module: scripts::DBUpdateTo6::PostArticleTableStructureChanges::Run
Line: 67
   Module: scripts::DBUpdateTo6::_ExecuteComponent Line: 157
   Module: scripts::DBUpdateTo6::Run Line: 69
   Module: scripts/DBUpdate-to-6.pl Line: 87


ERROR: OTRS-otrs.Console.pl-Dev::Code::CPANAudit-10 Perl: 5.16.3 OS:
linux Time: Thu Sep 19 13:31:20 2019

 Message: Error during execution of 'EXECUTE FKStatement'!

 Traceback (5899):
   Module: scripts::DBUpdateTo6::Base::ExecuteXMLDBString Line: 397
   Module: scripts::DBUpdateTo6::Base::ExecuteXMLDBArray Line: 342
   Module:
scripts::DBUpdateTo6::PostArticleTableStructureChanges::_RecreateForeignKeysPointingToArticleTable
Line: 419
   Module: scripts::DBUpdateTo6::PostArticleTableStructureChanges::Run
Line: 67
   Module: scripts::DBUpdateTo6::_ExecuteComponent Line: 157
   Module: scripts::DBUpdateTo6::Run Line: 69
   Module: scripts/DBUpdate-to-6.pl Line: 87

--
-----------------------------------------------
- Nick Bright -
- Vice President of Technology -
- Valnet -=- We Connect You -=- -
- Tel 888-332-1616 x 315 / Fax 620-331-0789 -
- Web http://www.valnet.net/ -
-----------------------------------------------
- Are your files safe? -
- Valnet Vault - Secure Cloud Backup -
- More information & 30 day free trial at -
- http://www.valnet.net/services/valnet-vault -
-----------------------------------------------

---------------------------------------------------------------------
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/mailman/listinfo/otrs

Florian Edlhuber

unread,
Sep 20, 2019, 2:28:36 AM9/20/19
to User questions and discussions about OTRS.
Hi Nick,


19.09.2019 20:59 - Nick Bright schrieb:
> I'm working on upgrading to v6, and in the process I'm getting an error
> on Step 31/44 in DBUpdate-to-6.pl, clearly caused by some error in the
> database.
>(...)

> [Thu Sep 19 13:31:20 2019] DBUpdate-to-6.pl: DBD::mysql::db do failed:
> Cannot add or update a child row: a foreign key constraint fails

You are missing (or have wrong) key constraints. One quick and dirty possibility
would be to turn off the key constraint check during update.

Better ask your database administrator, how to solve this issue.


--
Florian
Reply all
Reply to author
Forward
0 new messages