Обновление OTRS 5.0.27 на 6.0.15
Модератор: ykolesnikov
Обновление OTRS 5.0.27 на 6.0.15
Добрый день. ОС Debian 8.11; mysql 5.5.62; apache 2.4.10. У меня возникла проблема с обновлением OTRS c 5.0.27 на 6.0.15. Когда запускаю /opt/otrs/scripts/DBUpdate-to-6.pl под пользователем "otrs" на 29 шаге возникает проблема
*********************************************
Step 29 of 42: Post changes on article related tables ...
DBUpdate-to-6.pl: DBD::mysql::db do failed: Cannot add or update a child row: a foreign key constraint fails (`otrs`.`#sql-41e5_26`, CONSTRAINT `FK_article_data_mime_article_id_id` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`)) at /opt/otrs/Kernel/System/DB.pm line 470.
ERROR: OTRS-otrs.Console.pl-Maint::Database::Check-10 Perl: 5.20.2 OS: linux Time:
Message: Cannot add or update a child row: a foreign key constraint fails (`otrs`.`#sql-41e5_26`, CONSTRAINT `FK_С_article_id_id` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`)), SQL: 'EXECUTE FKStatement'
Traceback (16958):
Module: scripts::DBUpdateTo6::Base::ExecuteXMLDBString Line: 394
Module: scripts::DBUpdateTo6::Base::ExecuteXMLDBArray Line: 342
Module: scripts::DBUpdateTo6::PostArticleTableStructureChanges::_UpdateArticleDataMimeTable Line: 286
Module: scripts::DBUpdateTo6::PostArticleTableStructureChanges::Run Line: 52
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-Maint::Database::Check-10 Perl: 5.20.2 OS: linux Time:
Message: Error during execution of 'EXECUTE FKStatement'!
Traceback (16958):
Module: scripts::DBUpdateTo6::Base::ExecuteXMLDBString Line: 397
Module: scripts::DBUpdateTo6::Base::ExecuteXMLDBArray Line: 342
Module: scripts::DBUpdateTo6::PostArticleTableStructureChanges::_UpdateArticleDataMimeTable Line: 286
Module: scripts::DBUpdateTo6::PostArticleTableStructureChanges::Run Line: 52
Module: scripts::DBUpdateTo6::_ExecuteComponent Line: 157
Module: scripts::DBUpdateTo6::Run Line: 69
Module: scripts/DBUpdate-to-6.pl Line: 87
send sql to database
Not possible to complete migration, check previous messages for more information.
*********************************************
Прошу Вашей помощи.
*********************************************
Step 29 of 42: Post changes on article related tables ...
DBUpdate-to-6.pl: DBD::mysql::db do failed: Cannot add or update a child row: a foreign key constraint fails (`otrs`.`#sql-41e5_26`, CONSTRAINT `FK_article_data_mime_article_id_id` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`)) at /opt/otrs/Kernel/System/DB.pm line 470.
ERROR: OTRS-otrs.Console.pl-Maint::Database::Check-10 Perl: 5.20.2 OS: linux Time:
Message: Cannot add or update a child row: a foreign key constraint fails (`otrs`.`#sql-41e5_26`, CONSTRAINT `FK_С_article_id_id` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`)), SQL: 'EXECUTE FKStatement'
Traceback (16958):
Module: scripts::DBUpdateTo6::Base::ExecuteXMLDBString Line: 394
Module: scripts::DBUpdateTo6::Base::ExecuteXMLDBArray Line: 342
Module: scripts::DBUpdateTo6::PostArticleTableStructureChanges::_UpdateArticleDataMimeTable Line: 286
Module: scripts::DBUpdateTo6::PostArticleTableStructureChanges::Run Line: 52
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-Maint::Database::Check-10 Perl: 5.20.2 OS: linux Time:
Message: Error during execution of 'EXECUTE FKStatement'!
Traceback (16958):
Module: scripts::DBUpdateTo6::Base::ExecuteXMLDBString Line: 397
Module: scripts::DBUpdateTo6::Base::ExecuteXMLDBArray Line: 342
Module: scripts::DBUpdateTo6::PostArticleTableStructureChanges::_UpdateArticleDataMimeTable Line: 286
Module: scripts::DBUpdateTo6::PostArticleTableStructureChanges::Run Line: 52
Module: scripts::DBUpdateTo6::_ExecuteComponent Line: 157
Module: scripts::DBUpdateTo6::Run Line: 69
Module: scripts/DBUpdate-to-6.pl Line: 87
send sql to database
Not possible to complete migration, check previous messages for more information.
*********************************************
Прошу Вашей помощи.
-
- OTRS Гуру
- Сообщения: 5192
- Зарегистрирован: 20 сен 2010, 18:17
- Откуда: Москва
- Благодарил (а): 92 раза
- Поблагодарили: 82 раза
Re: Обновление OTRS 5.0.27 на 6.0.15
Добрый день!
Сильно похоже на кривизну базы. Мы сколько обновлений делали, с такой ошибкой не сталкивались. Возможно заметки руками чистили из базы не по феншую. Надо проверять таблицу article и foreign key для неё на корректность.
Можно конечно, отключить проверку foreign key, но сам факт ошибки - уже плохо.
Ну и гуглить Cannot add or update a child row: a foreign key constraint fails
ИМХО, тут сам по себе OTRS или скрипт обновления не при чём. Скорее всего - кривость базы. А много заметок и тикетов в базе всего?
Сильно похоже на кривизну базы. Мы сколько обновлений делали, с такой ошибкой не сталкивались. Возможно заметки руками чистили из базы не по феншую. Надо проверять таблицу article и foreign key для неё на корректность.
Можно конечно, отключить проверку foreign key, но сам факт ошибки - уже плохо.
Ну и гуглить Cannot add or update a child row: a foreign key constraint fails
ИМХО, тут сам по себе OTRS или скрипт обновления не при чём. Скорее всего - кривость базы. А много заметок и тикетов в базе всего?
С уважением,
Алексей Юсов
Prod: OTRS CE ITSM 6.0.28 on CentOS 7 Apache 2.4 MariaDB 10.4.13 + Radiant Customer Portal
Radiant System OTRS Intergrator RU
Группа OTRS Community в Teleram
Хотите внедрить OTRS? Спросите меня как!
Алексей Юсов
Prod: OTRS CE ITSM 6.0.28 on CentOS 7 Apache 2.4 MariaDB 10.4.13 + Radiant Customer Portal
Radiant System OTRS Intergrator RU
Группа OTRS Community в Teleram
Хотите внедрить OTRS? Спросите меня как!
Re: Обновление OTRS 5.0.27 на 6.0.15
Отключить проверку foreign key проверку. Ошибка не изменилась. База с 2012 года. (инцидентов каждый день около 30, сообщений 40-60) всего записей в article более 280000
Вот более подробна работа скрипта
Migration started ...
Checking requirements ...
Step 18 of 42: Create ticket number counter tables ...
- Table 'ticket_number_counter' already exists, skipping...
Step 19 of 42: Update calendar appointment future tasks ...
[Mon Jan 28 22:52:22 2019] DBUpdate-to-6.pl: DBD::mysql::st execute failed: Table 'otrs.calendar_appointment' doesn't exist at /opt/otrs/Kernel/System/DB.pm line 694.
ERROR: OTRS-otrs.Console.pl-Maint::Database::Check-10 Perl: 5.20.2 OS: linux Time: Mon Jan 28 22:52:22 2019
Message: Table 'otrs.calendar_appointment' doesn't exist, SQL: 'SELECT id, parent_id, calendar_id, unique_id FROM calendar_appointment WHERE notify_time >= ? ORDER BY notify_time ASC'
Traceback (4677):
Module: Kernel::System::Calendar::Appointment::AppointmentUpcomingGet Line: 1689
Module: Kernel::System::Calendar::Appointment::AppointmentFutureTasksUpdate Line: 1790
Module: scripts::DBUpdateTo6::UpdateAppointmentCalendarFutureTasks::Run Line: 32
Module: scripts::DBUpdateTo6::_ExecuteComponent Line: 157
Module: scripts::DBUpdateTo6::Run Line: 69
Module: /opt/otrs/scripts/DBUpdate-to-6.pl Line: 87
Step 20 of 42: Add basic appointment notification for reminders ...
Step 21 of 42: Create Form Draft tables ...
Step 22 of 42: Clean and drop group_user permission_value column ...
Step 23 of 42: Migrate GenericAgent jobs configuration ...
Step 24 of 42: Migrate TicketAppointment rules configuration ...
[Mon Jan 28 22:52:22 2019] DBUpdate-to-6.pl: DBD::mysql::st execute failed: Table 'otrs.calendar' doesn't exist at /opt/otrs/Kernel/System/DB.pm line 694.
ERROR: OTRS-otrs.Console.pl-Maint::Database::Check-10 Perl: 5.20.2 OS: linux Time: Mon Jan 28 22:52:22 2019
Message: Table 'otrs.calendar' doesn't exist, SQL: '
SELECT id, group_id, name, color, create_time, create_by, change_time, change_by,
valid_id
FROM calendar
WHERE 1=1
ORDER BY id ASC'
Traceback (4677):
Module: Kernel::System::Calendar::CalendarList Line: 457
Module: scripts::DBUpdateTo6::MigrateTicketAppointments::Run Line: 32
Module: scripts::DBUpdateTo6::_ExecuteComponent Line: 157
Module: scripts::DBUpdateTo6::Run Line: 69
Module: /opt/otrs/scripts/DBUpdate-to-6.pl Line: 87
Step 25 of 42: Migrate Merged Ticket history name values ...
Step 26 of 42: Migrate ticket statistics ...
Step 27 of 42: Migrate ticket notifications ...
Step 28 of 42: Create entries in new article table ...
- -427 articles will be migrated
Step 29 of 42: 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.
[Mon Jan 28 22:54:15 2019] DBUpdate-to-6.pl: DBD::mysql::db do failed: Cannot add or update a child row: a foreign key constraint fails (`otrs`.`#sql-440_56`, CONSTRAINT `FK_article_flag_article_id_id` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`)) at /opt/otrs/Kernel/System/DB.pm line 470.
ERROR: OTRS-otrs.Console.pl-Maint::Database::Check-10 Perl: 5.20.2 OS: linux Time: Mon Jan 28 22:54:15 2019
Message: Cannot add or update a child row: a foreign key constraint fails (`otrs`.`#sql-440_56`, CONSTRAINT `FK_article_flag_article_id_id` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`)), SQL: 'EXECUTE FKStatement'
Traceback (4677):
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: /opt/otrs/scripts/DBUpdate-to-6.pl Line: 87
ERROR: OTRS-otrs.Console.pl-Maint::Database::Check-10 Perl: 5.20.2 OS: linux Time: Mon Jan 28 22:54:15 2019
Message: Error during execution of 'EXECUTE FKStatement'!
Traceback (4677):
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: /opt/otrs/scripts/DBUpdate-to-6.pl Line: 87
Not possible to complete migration, check previous messages for more information.
Вот более подробна работа скрипта
Migration started ...
Checking requirements ...
Step 18 of 42: Create ticket number counter tables ...
- Table 'ticket_number_counter' already exists, skipping...
Step 19 of 42: Update calendar appointment future tasks ...
[Mon Jan 28 22:52:22 2019] DBUpdate-to-6.pl: DBD::mysql::st execute failed: Table 'otrs.calendar_appointment' doesn't exist at /opt/otrs/Kernel/System/DB.pm line 694.
ERROR: OTRS-otrs.Console.pl-Maint::Database::Check-10 Perl: 5.20.2 OS: linux Time: Mon Jan 28 22:52:22 2019
Message: Table 'otrs.calendar_appointment' doesn't exist, SQL: 'SELECT id, parent_id, calendar_id, unique_id FROM calendar_appointment WHERE notify_time >= ? ORDER BY notify_time ASC'
Traceback (4677):
Module: Kernel::System::Calendar::Appointment::AppointmentUpcomingGet Line: 1689
Module: Kernel::System::Calendar::Appointment::AppointmentFutureTasksUpdate Line: 1790
Module: scripts::DBUpdateTo6::UpdateAppointmentCalendarFutureTasks::Run Line: 32
Module: scripts::DBUpdateTo6::_ExecuteComponent Line: 157
Module: scripts::DBUpdateTo6::Run Line: 69
Module: /opt/otrs/scripts/DBUpdate-to-6.pl Line: 87
Step 20 of 42: Add basic appointment notification for reminders ...
Step 21 of 42: Create Form Draft tables ...
Step 22 of 42: Clean and drop group_user permission_value column ...
Step 23 of 42: Migrate GenericAgent jobs configuration ...
Step 24 of 42: Migrate TicketAppointment rules configuration ...
[Mon Jan 28 22:52:22 2019] DBUpdate-to-6.pl: DBD::mysql::st execute failed: Table 'otrs.calendar' doesn't exist at /opt/otrs/Kernel/System/DB.pm line 694.
ERROR: OTRS-otrs.Console.pl-Maint::Database::Check-10 Perl: 5.20.2 OS: linux Time: Mon Jan 28 22:52:22 2019
Message: Table 'otrs.calendar' doesn't exist, SQL: '
SELECT id, group_id, name, color, create_time, create_by, change_time, change_by,
valid_id
FROM calendar
WHERE 1=1
ORDER BY id ASC'
Traceback (4677):
Module: Kernel::System::Calendar::CalendarList Line: 457
Module: scripts::DBUpdateTo6::MigrateTicketAppointments::Run Line: 32
Module: scripts::DBUpdateTo6::_ExecuteComponent Line: 157
Module: scripts::DBUpdateTo6::Run Line: 69
Module: /opt/otrs/scripts/DBUpdate-to-6.pl Line: 87
Step 25 of 42: Migrate Merged Ticket history name values ...
Step 26 of 42: Migrate ticket statistics ...
Step 27 of 42: Migrate ticket notifications ...
Step 28 of 42: Create entries in new article table ...
- -427 articles will be migrated
Step 29 of 42: 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.
[Mon Jan 28 22:54:15 2019] DBUpdate-to-6.pl: DBD::mysql::db do failed: Cannot add or update a child row: a foreign key constraint fails (`otrs`.`#sql-440_56`, CONSTRAINT `FK_article_flag_article_id_id` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`)) at /opt/otrs/Kernel/System/DB.pm line 470.
ERROR: OTRS-otrs.Console.pl-Maint::Database::Check-10 Perl: 5.20.2 OS: linux Time: Mon Jan 28 22:54:15 2019
Message: Cannot add or update a child row: a foreign key constraint fails (`otrs`.`#sql-440_56`, CONSTRAINT `FK_article_flag_article_id_id` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`)), SQL: 'EXECUTE FKStatement'
Traceback (4677):
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: /opt/otrs/scripts/DBUpdate-to-6.pl Line: 87
ERROR: OTRS-otrs.Console.pl-Maint::Database::Check-10 Perl: 5.20.2 OS: linux Time: Mon Jan 28 22:54:15 2019
Message: Error during execution of 'EXECUTE FKStatement'!
Traceback (4677):
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: /opt/otrs/scripts/DBUpdate-to-6.pl Line: 87
Not possible to complete migration, check previous messages for more information.
-
- OTRS Гуру
- Сообщения: 5192
- Зарегистрирован: 20 сен 2010, 18:17
- Откуда: Москва
- Благодарил (а): 92 раза
- Поблагодарили: 82 раза
Re: Обновление OTRS 5.0.27 на 6.0.15
Версия 5 появилась в 2015 году. Значит система изначально была 3.2 или даже 3.1. Кто и насколько правильно делал предыдущие обновления? Как давно вы админите систему?
С уважением,
Алексей Юсов
Prod: OTRS CE ITSM 6.0.28 on CentOS 7 Apache 2.4 MariaDB 10.4.13 + Radiant Customer Portal
Radiant System OTRS Intergrator RU
Группа OTRS Community в Teleram
Хотите внедрить OTRS? Спросите меня как!
Алексей Юсов
Prod: OTRS CE ITSM 6.0.28 on CentOS 7 Apache 2.4 MariaDB 10.4.13 + Radiant Customer Portal
Radiant System OTRS Intergrator RU
Группа OTRS Community в Teleram
Хотите внедрить OTRS? Спросите меня как!
-
- OTRS Гуру
- Сообщения: 5192
- Зарегистрирован: 20 сен 2010, 18:17
- Откуда: Москва
- Благодарил (а): 92 раза
- Поблагодарили: 82 раза
Re: Обновление OTRS 5.0.27 на 6.0.15
На предыдущих обновлениях не было никаких ошибок или незавершённых процессов?
С уважением,
Алексей Юсов
Prod: OTRS CE ITSM 6.0.28 on CentOS 7 Apache 2.4 MariaDB 10.4.13 + Radiant Customer Portal
Radiant System OTRS Intergrator RU
Группа OTRS Community в Teleram
Хотите внедрить OTRS? Спросите меня как!
Алексей Юсов
Prod: OTRS CE ITSM 6.0.28 on CentOS 7 Apache 2.4 MariaDB 10.4.13 + Radiant Customer Portal
Radiant System OTRS Intergrator RU
Группа OTRS Community в Teleram
Хотите внедрить OTRS? Спросите меня как!
-
- OTRS Гуру
- Сообщения: 5192
- Зарегистрирован: 20 сен 2010, 18:17
- Откуда: Москва
- Благодарил (а): 92 раза
- Поблагодарили: 82 раза
Re: Обновление OTRS 5.0.27 на 6.0.15
мы тоже на обновлениях подобные вещи не встречали. Тогда ещё есть вариант с кривыми удалениями тикетов и/или заметок, дин. полей и т.п. надо проверять детально, на какие конкретно ключи и значения идёт ругань, и смотреть откуда они.
С уважением,
Алексей Юсов
Prod: OTRS CE ITSM 6.0.28 on CentOS 7 Apache 2.4 MariaDB 10.4.13 + Radiant Customer Portal
Radiant System OTRS Intergrator RU
Группа OTRS Community в Teleram
Хотите внедрить OTRS? Спросите меня как!
Алексей Юсов
Prod: OTRS CE ITSM 6.0.28 on CentOS 7 Apache 2.4 MariaDB 10.4.13 + Radiant Customer Portal
Radiant System OTRS Intergrator RU
Группа OTRS Community в Teleram
Хотите внедрить OTRS? Спросите меня как!
Re: Обновление OTRS 5.0.27 на 6.0.15
Павел, добрый день!
Столкнулся с точно такой же проблемой при обновлении с 5.0.14 на 6.0.10. Однако, в базу вручную никогда не ходили и ничего не правили.
Решил проблему путем удаления кастомных модулей (а именно модуль QuickClose).
Проверьте, какие модули стоят у Вас, возможно это поможет и Вам.
Столкнулся с точно такой же проблемой при обновлении с 5.0.14 на 6.0.10. Однако, в базу вручную никогда не ходили и ничего не правили.
Решил проблему путем удаления кастомных модулей (а именно модуль QuickClose).
Проверьте, какие модули стоят у Вас, возможно это поможет и Вам.
С уважением,
Дамир Асадуллин
Prod: OTRS ITSM 5.0.14 on Debian 8.6 x64 Linux with MySQL 5.5
Дамир Асадуллин
Prod: OTRS ITSM 5.0.14 on Debian 8.6 x64 Linux with MySQL 5.5