OTRS Update Datenbank Fehler

Allgemein Fragen, deutsche News, Ankündigungen & Events zu Znuny
Locked
Hunter1993
Znuny newbie
Posts: 8
Joined: 10 Mar 2016, 12:16
Znuny Version: 4.0.13

OTRS Update Datenbank Fehler

Post by Hunter1993 »

Hallo zusammen,

da bin ich wieder :D .
Ich habe ein Problem mit meiner Datenbank beim Update von OTRS 4.0.12 auf 4.0.13.
Ich versuche auf Centos 7 mit der MariaDB Datenbank ein Upgrade durchzuführen.
Während des Updates klappen zunächst alle Schritte aus der OTRS Anleitung: https://otrs.github.io/doc/manual/admin ... ading.html bis ich zum Abschnitt 6 ( "Database schema update") ankomme.

Beim Datenbank check mittels /opt/otrs/bin/otrs.CheckDB.pl steht auch "Connection successful"
Wenn ich dann allerdings mit cat scripts/DBUpdate-to-4.mysql.sql | mysql -p -f -u root otrs
die Logdatei ansehe werden mir folgende Fehlermeldungen zurückgegeben

Code: Select all

 cat scripts/DBUpdate-to-4.mysql.sql  | mysql -p -f -u root otrs
Enter password: 
ERROR 1060 (42S21) at line 9: Duplicate column name 'disposition'
ERROR 1060 (42S21) at line 13: Duplicate column name 'disposition'
INFO: Foreign key constraint FK_ticket_valid_id_id does not exist, skipping.
INFO: Foreign key constraint FK_ticket_valid_id_id does not exist, skipping.
ERROR 1091 (42000) at line 23: Can't DROP 'valid_id'; check that column/key exists
INFO: Foreign key constraint FK_ticket_history_valid_id_id does not exist, skipping.
INFO: Foreign key constraint FK_ticket_history_valid_id_id does not exist, skipping.
ERROR 1091 (42000) at line 33: Can't DROP 'valid_id'; check that column/key exists
ERROR 1050 (42S01) at line 38: Table 'personal_services' already exists
ERROR 1091 (42000) at line 47: Can't DROP 'content_size'; check that column/key exists
ERROR 1050 (42S01) at line 51: Table 'system_maintenance' already exists
ERROR 1005 (HY000) at line 66: Can't create table 'otrs.#sql-83c_10' (errno: 121)
ERROR 1005 (HY000) at line 67: Can't create table 'otrs.#sql-83c_10' (errno: 121)
ERROR 1005 (HY000) at line 68: Can't create table 'otrs.#sql-83c_10' (errno: 121)
ERROR 1005 (HY000) at line 69: Can't create table 'otrs.#sql-83c_10' (errno: 121)
ERROR 1005 (HY000) at line 70: Can't create table 'otrs.#sql-83c_10' (errno: 121)

In der Anleitung steht man müsse als Storage Enginge INNODB verwenden, ansonsten würden Fehler auftreten. Die default Engine von MariaDB ist aber laut dem SQL Befehl "SHOW ENGINES;" INNODB
MariaDB [(none)]> SHOW ENGINES;
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
| InnoDB | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| CSV | YES | CSV storage engine | NO | NO | NO |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
| MyISAM | YES | MyISAM storage engine | NO | NO | NO |
| FEDERATED | YES | FederatedX pluggable storage engine | YES | NO | YES |
| Aria | YES | Crash-safe tables with MyISAM heritage | NO | NO | NO |
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
Hat jemand eine Idee wo das Problem liegen könnte?
Habe es jetzt schon mehrmals hinternander probiert (jedesmal vorher Snapshot wieder eingespielt).
PS: Das Update habe ich mit der für CentOS 7 passenden rpm Datei durchgeführt und nicht mit dem Tarball Upgrade.
wurzel
Znuny guru
Posts: 3273
Joined: 08 Jul 2010, 22:25
Znuny Version: x.x.x
Real Name: Florian

Re: OTRS Update Datenbank Fehler

Post by wurzel »

Hi,


lies mal die upgrading Informationen nochmal genau durch...
OTRS 4.0.12 auf 4.0.13.
da kannst Du einiges an Upgrade Schritten rauslassen.

Flo
OTRS 2025 SILVER (Prod)
OTRS 2025 auf Debian 12 (Test)
Znuny 7.x latest version testing auf Debian 12

-- Ich beantworte keine Forums-Fragen PN - No PN please

I won't answer to unfriendly users any more. A greeting and regards are just polite.
Hunter1993
Znuny newbie
Posts: 8
Joined: 10 Mar 2016, 12:16
Znuny Version: 4.0.13

Re: OTRS Update Datenbank Fehler

Post by Hunter1993 »

Ja da hast du Recht, ich kann 6,11,13 und 14 auslassen das hatte ich überlesen.
Ich hatte davor aber auch versucht auf die neuste Version ( 5 PATCH Level 7) upzugraden und hatte da ebenfalls die Fehler mit der Datenbank.
Deshalb habe ich nun erstmal das Update auf die nächst höhere Version probiert um eben zu testen, ob eventuell ein Update fehlt.
Beim Upgrade auf OTRS 5 Patch level 7 habe ich nämlich beinahe die selben Datenbankfehler gehabt (Es waren nur andere Tabellen die nicht vorhanden waren bzw. nicht angelegt werden konnten).

Ich poste hier später nochmal die Ausgabe beim Upgrade auf die neuste 5er Version.
KlausNehrer
Znuny ninja
Posts: 1312
Joined: 25 May 2012, 08:51
Znuny Version: OTRS 4
Real Name: Klaus Nehrer

Re: OTRS Update Datenbank Fehler

Post by KlausNehrer »

Wieso? Du musst auf den letzten Patchlevel der 4er, um auf 5 gehen zu können.
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: OTRS Update Datenbank Fehler

Post by reneeb »

@KlausNehrer: Wenn man schon auf 4.0.x ist, kann man direkt auf 5.0.x gehen...
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
wurzel
Znuny guru
Posts: 3273
Joined: 08 Jul 2010, 22:25
Znuny Version: x.x.x
Real Name: Florian

Re: OTRS Update Datenbank Fehler

Post by wurzel »

Hi,
reneeb wrote:@KlausNehrer: Wenn man schon auf 4.0.x ist, kann man direkt auf 5.0.x gehen...
100% korrekt.

Aber man sollte auf die aktuellste Patch Level Version aktualisieren. :D

Viele Grüße
Flo
OTRS 2025 SILVER (Prod)
OTRS 2025 auf Debian 12 (Test)
Znuny 7.x latest version testing auf Debian 12

-- Ich beantworte keine Forums-Fragen PN - No PN please

I won't answer to unfriendly users any more. A greeting and regards are just polite.
Hunter1993
Znuny newbie
Posts: 8
Joined: 10 Mar 2016, 12:16
Znuny Version: 4.0.13

Re: OTRS Update Datenbank Fehler

Post by Hunter1993 »

Hallo zusammen,

kurz vorab: Ich habe das Update von der 4.0.12 auf die Version 5 (Patch Level 7) zu Testzwecken mit einer frischen CentOS 7+OTRS Installation ohne jegliche Fehlermeldungen durchführen können. Das einzige Problem was ich bei der frischen Installation nach dem Update hatte war, dass unter /etc/init.d/ nun seltsamerweise kein otrs Cronjob mehr vorhanden war. Wenn ich den otrs Dienst mittels "systemctl start otrs" starten wollte wurde mir ausgegeben, dass der Dienst angeblich nicht vorhanden sei. In der OTRS Weboberfläche (index.pl) bekomme ich allerdings keine Fehlermeldung, dass der OTRS Dienst nicht gestartet sei :shock:. Nach dem Update bekomme ich auch unter Produkt Neuigkeiten die Fehlermeldung : "Cant connect to product news Server" . Ich vermute das hat mit dem fehlenden otrs Dienst zu tun.
In /opt/otrs/var/cron sind auch nurnoch die Dateien aaa_base und otrs_deamon vorhanden. Die anderen Dateien fehlen alle :( .
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Wie dem auch sei hier ist nochmal die Ausgabe der Fehlermeldungen des alten OTRS Systems bei der Datenbank Migration von Version 4 auf 5 :

Code: Select all

scripts/DBUpdate-to-5.pl

Migration started...

Step 1 of 17: Refresh configuration cache...
If you see warnings about 'Subroutine Load redefined', that's fine, no need to worry!
done.

Step 2 of 17: Check framework version...done.

Step 3 of 17: Migrate Database Column Types...done.

Step 4 of 17: Migrate charset to UTF-8 on auto_response table...done.

Step 5 of 17: Migrate charset to UTF-8 on notification_event table...done.

Step 6 of 17: Migrate event based notifications to support multiple languages...[Tue Mar 15 11:22:23 2016] DBUpdate-to-5.pl: DBD::mysql::db do failed: Table 'otrs.notification_event_message' doesn't exist at /opt/otrs/Kernel/System/DB.pm line 449.
ERROR: OTRS-DBUpdate-to-5.pl-56 Perl: 5.16.3 OS: linux Time: Tue Mar 15 11:22:23 2016

 Message: Table 'otrs.notification_event_message' doesn't exist, SQL: 'DELETE FROM notification_event_message WHERE notification_id = ?'

 Traceback (17440): 
   Module: Kernel::System::NotificationEvent::NotificationUpdate Line: 503
   Module: main::_MigrateEventNotificationsToMultiLanguage Line: 777
   Module: scripts/DBUpdate-to-5.pl Line: 162

[Tue Mar 15 11:22:23 2016] DBUpdate-to-5.pl: DBD::mysql::db do failed: Table 'otrs.notification_event_message' doesn't exist at /opt/otrs/Kernel/System/DB.pm line 449.
ERROR: OTRS-DBUpdate-to-5.pl-56 Perl: 5.16.3 OS: linux Time: Tue Mar 15 11:22:23 2016

 Message: Table 'otrs.notification_event_message' doesn't exist, SQL: '
                INSERT INTO notification_event_message
                    (notification_id, subject, text, content_type, language)
                VALUES (?, ?, ?, ?, ?)'

 Traceback (17440): 
   Module: Kernel::System::NotificationEvent::NotificationUpdate Line: 512
   Module: main::_MigrateEventNotificationsToMultiLanguage Line: 777
   Module: scripts/DBUpdate-to-5.pl Line: 162

done.

Step 7 of 17: Migrate notifications to event based notifications...[Tue Mar 15 11:22:23 2016] DBUpdate-to-5.pl: DBD::mysql::db do failed: Table 'otrs.notification_event_message' doesn't exist at /opt/otrs/Kernel/System/DB.pm line 449.
ERROR: OTRS-DBUpdate-to-5.pl-56 Perl: 5.16.3 OS: linux Time: Tue Mar 15 11:22:23 2016

 Message: Table 'otrs.notification_event_message' doesn't exist, SQL: '
                INSERT INTO notification_event_message
                    (notification_id, subject, text, content_type, language)
                VALUES (?, ?, ?, ?, ?)'

 Traceback (17440): 
   Module: Kernel::System::NotificationEvent::NotificationAdd Line: 365
   Module: main::_MigrateNotifications Line: 1109
   Module: scripts/DBUpdate-to-5.pl Line: 162

error.

[Tue Mar 15 11:22:23 2016] DBUpdate-to-5.pl: Died at scripts/DBUpdate-to-5.pl line 167.
Beim Ausführen von cat scripts/DBUpdate-to-5.mysql.sql | mysql -p -f -u root
werden mir ausserdem folgende Fehler ausgegeben :

Code: Select all

Enter password: 
ERROR 1046 (3D000) at line 4: No database selected
ERROR 1046 (3D000) at line 5: No database selected
ERROR 1046 (3D000) at line 9: No database selected
ERROR 1046 (3D000) at line 28: No database selected
ERROR 1046 (3D000) at line 47: No database selected
ERROR 1046 (3D000) at line 64: No database selected
ERROR 1046 (3D000) at line 68: No database selected
ERROR 1046 (3D000) at line 72: No database selected
ERROR 1046 (3D000) at line 87: No database selected
ERROR 1046 (3D000) at line 101: No database selected
ERROR 1046 (3D000) at line 102: No database selected
ERROR 1046 (3D000) at line 103: No database selected
ERROR 1046 (3D000) at line 104: No database selected

Die einzigste Änderung die ich selbst mal an der Datenbank durchgeführt habe war es einige zusätzliche Felder anzulegen, um mehr Informationen bei der Selbstregistration eines Kunden anzupassen (siehe http://otrs.biz/3.0/de/html/customer-se ... ation.html ).
Kann das eventuell damit zusammenhängen?
Last edited by Hunter1993 on 15 Mar 2016, 12:38, edited 1 time in total.
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: OTRS Update Datenbank Fehler

Post by reneeb »

Du musst bei dem "mysql"-Befehl noch die Datenbank angeben (i.d.R. muss ein "otrs" nach dem "root" stehen)
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Hunter1993
Znuny newbie
Posts: 8
Joined: 10 Mar 2016, 12:16
Znuny Version: 4.0.13

Re: OTRS Update Datenbank Fehler

Post by Hunter1993 »

Hallo reneeb,

danke für den Tipp :D .
Wenn ich otrs hinter den Befehl stelle geht die Mysql Anweisung ohne Fehler durch.
Das Migration script hat mir danach bei Step 7 zuerst nochmal eine Fehlermeldung bezüglich eines Hash Werts angezeigt, beim zweiten Versuch lief das Script aber sauber durch.

Allerdings habe ich auch jetzt beim alten OTRS System das Problem, dass mir wie beim testsystem beim Ausführen des Kommandos "systemctl start otrs" zuerst die Meldung zurückgegeben:"Unit file changed on disk, systemctl daemon-reload recommendet".

Nachdem ich "systemctl daemon-reload" aber ausgeführt habe gibt mir "systemctl start otrs" die Ausgabe "Failed to issue method call : Unit otrs.service failed to load: No such file or directory" zurück .
Das alte System verhält sich nach dem Update exakt wie das testsystem(OTRS Dienst lässt sich nicht starten, otrs Cronjob nichtmehr im Verzeichnis /etc/init.d vorhanden) ....
In der Anleitung steht zwar ich soll alles aus dem var/ Verzeichnis sichern, aber es wird nichts darüber geschrieben, ob man die alten Dateien später auch wieder einfügen soll.
Irgendwas muss ich wohl doch noch zusätzlich falsch gemacht haben, aber ich gehe eigentlich exakt nach der offiziellen Anleitung zum Upgrade vor :( .
Das Problem tritt direkt nach dem Update mittels rpm Paket auf (Nachdem das RPM File installiert wurde fehlt der otrs Cronjob unter /etc/init.d)
Jojo117
Znuny newbie
Posts: 57
Joined: 06 Dec 2013, 10:37
Znuny Version: 5.0.11

Re: OTRS Update Datenbank Fehler

Post by Jojo117 »

Hunter1993 wrote:Hallo zusammen,

da bin ich wieder :D .
Ich habe ein Problem mit meiner Datenbank beim Update von OTRS 4.0.12 auf 4.0.13.
Ich versuche auf Centos 7 mit der MariaDB Datenbank ein Upgrade durchzuführen.
Während des Updates klappen zunächst alle Schritte aus der OTRS Anleitung: https://otrs.github.io/doc/manual/admin ... ading.html bis ich zum Abschnitt 6 ( "Database schema update") ankomme.

Beim Datenbank check mittels /opt/otrs/bin/otrs.CheckDB.pl steht auch "Connection successful"
Wenn ich dann allerdings mit cat scripts/DBUpdate-to-4.mysql.sql | mysql -p -f -u root otrs
die Logdatei ansehe werden mir folgende Fehlermeldungen zurückgegeben

Code: Select all

 cat scripts/DBUpdate-to-4.mysql.sql  | mysql -p -f -u root otrs
Enter password: 
ERROR 1060 (42S21) at line 9: Duplicate column name 'disposition'
ERROR 1060 (42S21) at line 13: Duplicate column name 'disposition'
INFO: Foreign key constraint FK_ticket_valid_id_id does not exist, skipping.
INFO: Foreign key constraint FK_ticket_valid_id_id does not exist, skipping.
ERROR 1091 (42000) at line 23: Can't DROP 'valid_id'; check that column/key exists
INFO: Foreign key constraint FK_ticket_history_valid_id_id does not exist, skipping.
INFO: Foreign key constraint FK_ticket_history_valid_id_id does not exist, skipping.
ERROR 1091 (42000) at line 33: Can't DROP 'valid_id'; check that column/key exists
ERROR 1050 (42S01) at line 38: Table 'personal_services' already exists
ERROR 1091 (42000) at line 47: Can't DROP 'content_size'; check that column/key exists
ERROR 1050 (42S01) at line 51: Table 'system_maintenance' already exists
ERROR 1005 (HY000) at line 66: Can't create table 'otrs.#sql-83c_10' (errno: 121)
ERROR 1005 (HY000) at line 67: Can't create table 'otrs.#sql-83c_10' (errno: 121)
ERROR 1005 (HY000) at line 68: Can't create table 'otrs.#sql-83c_10' (errno: 121)
ERROR 1005 (HY000) at line 69: Can't create table 'otrs.#sql-83c_10' (errno: 121)
ERROR 1005 (HY000) at line 70: Can't create table 'otrs.#sql-83c_10' (errno: 121)

In der Anleitung steht man müsse als Storage Enginge INNODB verwenden, ansonsten würden Fehler auftreten. Die default Engine von MariaDB ist aber laut dem SQL Befehl "SHOW ENGINES;" INNODB
MariaDB [(none)]> SHOW ENGINES;
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
| InnoDB | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| CSV | YES | CSV storage engine | NO | NO | NO |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
| MyISAM | YES | MyISAM storage engine | NO | NO | NO |
| FEDERATED | YES | FederatedX pluggable storage engine | YES | NO | YES |
| Aria | YES | Crash-safe tables with MyISAM heritage | NO | NO | NO |
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
Hat jemand eine Idee wo das Problem liegen könnte?
Habe es jetzt schon mehrmals hinternander probiert (jedesmal vorher Snapshot wieder eingespielt).
PS: Das Update habe ich mit der für CentOS 7 passenden rpm Datei durchgeführt und nicht mit dem Tarball Upgrade.
Versuch mal bevor du das DBUpdate laufen lässt das otrs.MySQLInnoDBSwitch.pl durchlaufen zu lassen. Er wird dir vermutlich anzeigen, dass er nichts konvertieren musste, allerdings funktioniert danach auch das Update.
Locked