Upgrade 5.0.24 to 6.0.8 fail Requirement check

Moderator: crythias

Post Reply
amka
Znuny newbie
Posts: 7
Joined: 15 Dec 2016, 13:54
Znuny Version: 5.0.14
Real Name: Knud Andersen
Company: Scott/Tiger

Upgrade 5.0.24 to 6.0.8 fail Requirement check

Post by amka »

Hi,
Had version 5.0.24 running fine.
Installed 6.0.8 through RPM (as per instructions in admin manual).
Running (as otrs) scripts/DBUpdate-to-6.pl stop during requirement check:

Migration started ...

Checking requirements ...

Requirement check for: Check framework version ...
Requirement check for: Check required Perl version ...
Requirement check for: Check required database version ...
Requirement check for: Check database charset ...
Requirement check for: Check required Perl modules ...
Requirement check for: Check if database has been backed up ...

Did you backup the database? [Y]es/[N]o: Y

Requirement check for: Upgrade database structure ...
Requirement check for: Migrating time zone configuration ...
Can't locate object method "ListTables" via package "Kernel::System::DB" at /opt/otrs/scripts/DBUpdateTo6/Base.pm line 403, <> line 1.

How can this be fixed ? And why is it happening ?
fcasal
Znuny wizard
Posts: 336
Joined: 21 Apr 2014, 16:14
Znuny Version: 6.0.18

Re: Upgrade 5.0.24 to 6.0.8 fail Requirement check

Post by fcasal »

I should try to download the installer file again. Then, if problem persists, check all the perl modules are installed and working. I also would check is my linux version is supported by the 6.0.8 version of otrs and if you have third party addons, consider to delete them before upgrade.

Regards.
amka
Znuny newbie
Posts: 7
Joined: 15 Dec 2016, 13:54
Znuny Version: 5.0.14
Real Name: Knud Andersen
Company: Scott/Tiger

Re: Upgrade 5.0.24 to 6.0.8 fail Requirement check

Post by amka »

Hi,
Thank you for the suggestion.
I think I have identified the problem:
I had to uninstall all non-OTRS supplied packages. After that, installation went through without issues.
Of course, I am now faced with other issues - like:
Cannot open existing tickets. Give internal server error.
currently investigating.

Rgrds
fcasal
Znuny wizard
Posts: 336
Joined: 21 Apr 2014, 16:14
Znuny Version: 6.0.18

Re: Upgrade 5.0.24 to 6.0.8 fail Requirement check

Post by fcasal »

Which message shows the log? It could help to find out the solution.

Regards.
LXsysadmin
Znuny newbie
Posts: 21
Joined: 28 Jun 2018, 12:23
Znuny Version: 5.0.22
Real Name: Martins

Re: Upgrade 5.0.24 to 6.0.8 fail Requirement check

Post by LXsysadmin »

Step 28 of 41: Create entries in new article table ...
Step 29 of 41: Post changes on article related tables ...
[Wed Jun 27 13:36:49 2018] DBUpdate-to-6.pl: DBD::Pg::db do failed: ERROR: insert or update on table "ticket_history" violates foreign key constraint "fk_ticket_history_article_id_id"
[Wed Jun 27 13:36:49 2018] DBUpdate-to-6.pl: DETAIL: Key (article_id)=(10958) is not present in table "article".
[Wed Jun 27 13:36:49 2018] DBUpdate-to-6.pl: CONTEXT: SQL statement "ALTER TABLE ticket_history ADD CONSTRAINT FK_ticket_history_article_id_id FOREIGN KEY (article_id) REFERENCES article (id)"
[Wed Jun 27 13:36:49 2018] DBUpdate-to-6.pl: PL/pgSQL function inline_code_block line 8 at SQL statement at /opt/otrs/Kernel/System/DB.pm line 470.
ERROR: OTRS-otrs.Console.pl-Maint::Database::Check-10 Perl: 5.16.3 OS: linux Time: Wed Jun 27 13:36:50 2018

Message: ERROR: insert or update on table "ticket_history" violates foreign key constraint "fk_ticket_history_article_id_id"
DETAIL: Key (article_id)=(10958) is not present in table "article".
CONTEXT: SQL statement "ALTER TABLE ticket_history ADD CONSTRAINT FK_ticket_history_article_id_id FOREIGN KEY (article_id) REFERENCES article (id)"
PL/pgSQL function inline_code_block line 8 at SQL statement, SQL: 'DO $$
BEGIN
IF NOT EXISTS (
SELECT 1
FROM pg_constraint
WHERE LOWER(conname) = LOWER('FK_ticket_history_article_id_id')
) THEN
ALTER TABLE ticket_history ADD CONSTRAINT FK_ticket_history_article_id_id FOREIGN KEY (article_id) REFERENCES article (id);
END IF;
END$$;
'

Traceback (1632):
Module: scripts::DBUpdateTo6::Base::ExecuteXMLDBString Line: 363
Module: scripts::DBUpdateTo6::Base::ExecuteXMLDBArray Line: 311
Module: scripts::DBUpdateTo6::PostArticleTableStructureChanges::_RecreateForeignKeysPointingToArticleTable Line: 404
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: 89


ERROR: OTRS-otrs.Console.pl-Maint::Database::Check-10 Perl: 5.16.3 OS: linux Time: Wed Jun 27 13:36:50 2018

Message: Error during execution of 'DO $$
BEGIN
IF NOT EXISTS (
SELECT 1
FROM pg_constraint
WHERE LOWER(conname) = LOWER('FK_ticket_history_article_id_id')
) THEN
ALTER TABLE ticket_history ADD CONSTRAINT FK_ticket_history_article_id_id FOREIGN KEY (article_id) REFERENCES article (id);
END IF;
END$$;
'!

Traceback (1632):
Module: scripts::DBUpdateTo6::Base::ExecuteXMLDBString Line: 366
Module: scripts::DBUpdateTo6::Base::ExecuteXMLDBArray Line: 311
Module: scripts::DBUpdateTo6::PostArticleTableStructureChanges::_RecreateForeignKeysPointingToArticleTable Line: 404
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: 89

Not possible to complete migration, check previous messages for more information.



Now, i have such error. Is there some solution? Looks really bad :(
KimmoJ
Znuny newbie
Posts: 47
Joined: 15 Sep 2011, 09:32
Znuny Version: 6.0.22
Real Name: Kimmo Jaskari
Company: Transmar Ab

Re: Upgrade 5.0.24 to 6.0.8 fail Requirement check

Post by KimmoJ »

Perhaps you should check the integrity of your database, and make sure you don't have any damaged tables.

I did a version 5 to 6.0.8 upgrade this weekend in fact - including dumping the database from an old MySQL 5 and importing it into the latest MariaDB first - and the upgrade script gave no errors. It ran for hours on end... but worked.
Post Reply