Update 6.3.4 zu 6.4.x

Hilfe zu OTRS Problemen aller Art
Post Reply
daveman2909
Znuny newbie
Posts: 5
Joined: 25 Jul 2019, 15:57
Znuny Version: 6.0.30
Real Name: David T
Company: Stadtwerke

Update 6.3.4 zu 6.4.x

Post by daveman2909 »

Hallo zusammen,

ich habe mich heute getraut unser OTRS 6.0.30 bis 6.3.4 upzudaten. Das hat ohne Probleme Funktioniert 8) Leider gab es aber ein Problem von Version 6.3.4 auf 6.4 upzudaten. Das ausführen von scripts/MigrateToZnuny6_4.pl gibt Folgendes aus:

Code: Select all

scripts/MigrateToZnuny6_4.pl

 Migration started ... 

 Checking requirements ... 

    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 ...

 Executing tasks ... 

    Step 1 of 16: Check required Perl version ...
    Step 2 of 16: Check required database version ...
    Step 3 of 16: Check database charset ...
    Step 4 of 16: Check required Perl modules ...
    Step 5 of 16: Check installed CPAN modules for known vulnerabilities ...
Collecting all installed modules. This can take a while...
Archive-Tar (requires 1.92) has 1 advisories
  * CPANSA-Archive-Tar-2018-01
    In Perl through 5.26.2, the Archive::Tar module allows remote attackers to bypass a directory-traversal protection mechanism, and overwrite arbitrary files, via an archive file containing a symlink and a regular file with the same name.

    Affected range: <2.28

    CVEs: CVE-2018-12015

    References:
    https://security-tracker.debian.org/tracker/CVE-2018-12015
    https://github.com/jib/archive-tar-new/commit/ae65651eab053fc6dc4590dbb863a268215c1fc5

Archive-Zip (requires 1.30) has 1 advisories
  * CPANSA-Archive-Zip-2018-01
    perl-archive-zip is vulnerable to a directory traversal in Archive::Zip. It was found that the Archive::Zip module did not properly sanitize paths while extracting zip files. An attacker able to provide a specially crafted archive for processing could use this flaw to write or overwrite arbitrary files in the context of the perl interpreter.

    Affected range: <1.61

    CVEs: CVE-2018-10860

    References:
    https://security-tracker.debian.org/tracker/CVE-2018-10860
    https://github.com/redhotpenguin/perl-Archive-Zip/pull/33

Compress-Raw-Zlib (requires 2.061) has 1 advisories
  * CPANSA-Compress-Raw-Zlib-2017-01
    Zlib vulnerabilities.

    Affected range: <2.075
    Fixed range: >=2.075

    CVEs: CVE-2016-9843, CVE-2016-9841, CVE-2016-9840, CVE-2016-9842

    References:
    https://metacpan.org/changes/distribution/Compress-Raw-Zlib

DBD-mysql (requires 4.023) has 7 advisories
  * CPANSA-DBD-mysql-2017-02
    The DBD::mysql module through 4.043 for Perl allows remote attackers to cause a denial of service (use-after-free and application crash) or possibly have unspecified other impact by triggering (1) certain error responses from a MySQL server or (2) a loss of a network connection to a MySQL server. The use-after-free defect was introduced by relying on incorrect Oracle mysql_stmt_close documentation and code examples.

    Affected range: <4.044
    Fixed range: >=4.044

    CVEs: CVE-2017-10788

    References:
    https://github.com/perl5-dbi/DBD-mysql/issues/120

  * CPANSA-DBD-mysql-2017-01
    The DBD::mysql module through 4.043 for Perl uses the mysql_ssl=1 setting to mean that SSL is optional (even though this setting's documentation has a "your communication with the server will be encrypted" statement), which allows man-in-the-middle attackers to spoof servers via a cleartext-downgrade attack, a related issue to CVE-2015-3152.

    Affected range: <4.044
    Fixed range: >=4.044

    CVEs: CVE-2017-10789

    References:
    https://github.com/perl5-dbi/DBD-mysql/pull/114

  * CPANSA-DBD-mysql-2016-03
    Out-of-bounds read.

    Affected range: >=2.9003, <4.039
    Fixed range: <2.9003, >=4.039

    CVEs: CVE-2016-1249

    References:
    https://github.com/perl5-dbi/DBD-mysql/commit/793b72b1a0baa5070adacaac0e12fd995a6fbabe

  * CPANSA-DBD-mysql-2016-02
    Buffer overflow in the DBD::mysql module before 4.037 for Perl allows context-dependent attackers to cause a denial of service (crash) via vectors related to an error message.

    Affected range: <4.037
    Fixed range: >=4.037

    CVEs: CVE-2016-1246

    References:
    https://github.com/perl5-dbi/DBD-mysql/commit/7c164a0c86cec6ee95df1d141e67b0e85dfdefd2
    http://blogs.perl.org/users/mike_b/2016/10/security-release---buffer-overflow-in-dbdmysql-perl-library.html

  * CPANSA-DBD-mysql-2016-01
    Use-after-free vulnerability in the my_login function in DBD::mysql before 4.033_01 allows attackers to have unspecified impact by leveraging a call to mysql_errno after a failure of my_login.

    Affected range: <4.034
    Fixed range: >=4.034

    CVEs: CVE-2015-8949

    References:
    https://github.com/perl5-dbi/DBD-mysql/commit/cf0aa7751f6ef8445e9310a64b14dc81460ca156

  * CPANSA-DBD-mysql-2015-01
    There is a vulnerability of type use-after-free affecting DBD::mysql (aka DBD-mysql or the Database Interface (DBI) MySQL driver for Perl) 3.x and 4.x before 4.041 when used with mysql_server_prepare=1.

    Affected range: <4.041
    Fixed range: >=4.041

    CVEs: CVE-2016-1251

    References:
    https://github.com/perl5-dbi/DBD-mysql/commit/3619c170461a3107a258d1fd2d00ed4832adb1b1

  * CPANSA-DBD-mysql-2014-01
    Use-after-free vulnerability in DBD::mysql before 4.029 allows attackers to cause a denial of service (program crash) or possibly execute arbitrary code via vectors related to a lost server connection.

    Affected range: <4.028
    Fixed range: >=4.028

    CVEs: CVE-2014-9906

    References:
    https://github.com/perl5-dbi/DBD-mysql/commit/a56ae87a4c1c1fead7d09c3653905841ccccf1cc
    https://rt.cpan.org/Public/Bug/Display.html?id=97625

DBI (requires 1.627) has 1 advisories
  * CPANSA-DBI-2014-01
    DBD::File drivers open files from folders other than specifically passed using the f_dir attribute.

    Affected range: <1.632
    Fixed range: >=1.632

    References:
    https://metacpan.org/changes/distribution/DBI
    https://rt.cpan.org/Public/Bug/Display.html?id=99508

Data-Dumper (requires 2.145) has 1 advisories
  * CPANSA-Data-Dumper-2014-01
    Infinite recursion.

    Affected range: <2.154
    Fixed range: >=2.154

    CVEs: CVE-2014-4330

    References:
    https://metacpan.org/changes/distribution/Data-Dumper

Encode (requires 2.51) has 1 advisories
  * CPANSA-Encode-2016-01
    Loading optional modules from . (current directory).

    Affected range: <2.85
    Fixed range: >=2.85

    CVEs: CVE-2016-1238

    References:
    https://metacpan.org/changes/distribution/Encode
    https://github.com/dankogai/p5-encode/pull/58/commits/12be15d64ce089154c4367dc1842cd0dc0993ec6

File-Path (requires 2.09) has 1 advisories
  * CPANSA-File-Path-2017-01
    Race condition in the rmtree and remove_tree functions allows attackers to set the mode on arbitrary files via vectors involving directory-permission loosening logic.

    Affected range: <2.13
    Fixed range: >=2.13

    CVEs: CVE-2017-6512

    References:
    https://metacpan.org/changes/distribution/File-Path
    https://github.com/jkeenan/File-Path/commit/e5ef95276ee8ad471c66ee574a5d42552b3a6af2

HTTP-Tiny (requires 0.033) has 1 advisories
  * CPANSA-HTTP-Tiny-2016-01
    Loading modules from . (current directory).

    Affected range: <0.059
    Fixed range: >=0.059

    CVEs: CVE-2016-1238

    References:
    https://metacpan.org/changes/distribution/HTTP-Tiny
    https://github.com/chansen/p5-http-tiny/commit/b239c95ea7a256cfee9b8848f1bd4d1df6e66444

PathTools (requires 3.40) has 2 advisories
  * CPANSA-PathTools-2016-02
    Does not properly remove . (period) characters from the end of the includes directory array, which might allow local users to gain privileges via a Trojan horse module under the current working directory.

    Affected range: <3.65
    Fixed range: >=3.65

    CVEs: CVE-2016-1238

    References:
    https://metacpan.org/changes/distribution/PathTools

  * CPANSA-PathTools-2016-01
    Does not properly preserve the taint attribute of data, which might allow context-dependent attackers to bypass the taint protection mechanism via a crafted string.

    Affected range: <3.62
    Fixed range: >=3.62

    CVEs: CVE-2015-8607

    References:
    https://metacpan.org/changes/distribution/PathTools

Storable (requires 2.45) has 1 advisories
  * CPANSA-Storable-2017-01
    Malcrafted storable files or buffers.

    Affected range: <3.05
    Fixed range: >=3.05

    References:
    https://metacpan.org/changes/distribution/Storable
    https://cxsecurity.com/issue/WLB-2007120031

XML-LibXML (requires 2.0018) has 1 advisories
  * CPANSA-XML-LibXML-2015-01
    The _clone function does not properly set the expand_entities option, which allows remote attackers to conduct XML external entity (XXE) attacks via crafted XML data to the (1) new or (2) load_xml function.

    Affected range: <2.0120
    Fixed range: >=2.0120

    CVEs: CVE-2015-3451

    References:
    https://metacpan.org/changes/distribution/XML-LibXML

Total advisories found: 19

    WARNING: CPAN::Audit reported that one or more installed CPAN modules have known vulnerabilities (see above). Please note that there might be false positives for distributions patching Perl modules without changing their version number.

    Step 6 of 16: Check if database has been backed up ...
    Step 7 of 16: Upgrade database structure ...
[Tue Aug 16 22:25:21 2022] MigrateToZnuny6_4.pl: DBD::mysql::db do failed: Cannot add or update a child row: a foreign key constraint fails (`otrs`.`#sql-7bf_6b`, CONSTRAINT `FK_article_flag_article_id_id` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`)) at /opt/otrs/Kernel/System/DB.pm line 471.
ERROR: OTRS-otrs.Console.pl-Dev::Code::CPANAudit-72 Perl: 5.16.3 OS: linux Time: Tue Aug 16 22:25:21 2022

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

 Traceback (9987): 
   Module: scripts::Migration::Base::ExecuteXMLDBString Line: 394
   Module: scripts::Migration::Base::ExecuteXMLDBArray Line: 342
   Module: scripts::Migration::Znuny::UpgradeDatabaseStructure::RecreateForeignKeysToArticleTable::_RecreateForeignKeysPointingToArticleTable Line: 69
   Module: scripts::Migration::Znuny::UpgradeDatabaseStructure::RecreateForeignKeysToArticleTable::Run Line: 31
   Module: scripts::Migration::Znuny::UpgradeDatabaseStructure::Run Line: 81
   Module: scripts::Migration::_ExecuteComponent Line: 155
   Module: scripts::Migration::Run Line: 67
   Module: scripts/MigrateToZnuny6_4.pl Line: 82


ERROR: OTRS-otrs.Console.pl-Dev::Code::CPANAudit-72 Perl: 5.16.3 OS: linux Time: Tue Aug 16 22:25:21 2022

 Message: Error during execution of 'EXECUTE FKStatement'!

 Traceback (9987): 
   Module: scripts::Migration::Base::ExecuteXMLDBString Line: 397
   Module: scripts::Migration::Base::ExecuteXMLDBArray Line: 342
   Module: scripts::Migration::Znuny::UpgradeDatabaseStructure::RecreateForeignKeysToArticleTable::_RecreateForeignKeysPointingToArticleTable Line: 69
   Module: scripts::Migration::Znuny::UpgradeDatabaseStructure::RecreateForeignKeysToArticleTable::Run Line: 31
   Module: scripts::Migration::Znuny::UpgradeDatabaseStructure::Run Line: 81
   Module: scripts::Migration::_ExecuteComponent Line: 155
   Module: scripts::Migration::Run Line: 67
   Module: scripts/MigrateToZnuny6_4.pl Line: 82




 Not possible to complete migration. Check previous messages for more information.
Linux ist ein CentOS 7. Extra Packages haben wir nicht installiert.

Vielen Dank schon mal!
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Update 6.3.4 zu 6.4.x

Post by root »

Hallo,

eine der Tabellen ticket_history, article_flag oder time_accounting enthält einen Verweis auf einen Artikel den es nicht mehr gibt.
Da hilft dann nur manuelle aufräumen. Du musst die Einträge per SQL finden und löschen.

1.) SELECT * FROM ticket_history WHERE article_id NOT IN (SELECT id FROM article)
2.) SELECT * FROM article_flag WHERE article_id NOT IN (SELECT id FROM article)
3.) SELECT * FROM time_accounting WHERE article_id NOT IN (SELECT id FROM article)


Finden die Abfragen denn etwas bei Dir?

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
daveman2909
Znuny newbie
Posts: 5
Joined: 25 Jul 2019, 15:57
Znuny Version: 6.0.30
Real Name: David T
Company: Stadtwerke

Re: Update 6.3.4 zu 6.4.x

Post by daveman2909 »

Hallo root,

vielen Dank für die schnelle Rückmeldung! Tatsächlich findet er bei einer Suche etwas:

Code: Select all

MariaDB [(none)]> USE otrs;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [otrs]> SELECT * FROM ticket_history WHERE article_id NOT IN (SELECT id FROM article);
Empty set (0.70 sec)

MariaDB [otrs]> SELECT * FROM article_flag WHERE article_id NOT IN (SELECT id FROM article);
+------------+-------------+---------------+---------------------+-----------+
| article_id | article_key | article_value | create_time         | create_by |
+------------+-------------+---------------+---------------------+-----------+
|          0 | Seen        | 1             | 2021-03-18 09:55:55 |         2 |
+------------+-------------+---------------+---------------------+-----------+
1 row in set (0.22 sec)

MariaDB [otrs]> SELECT * FROM time_accounting WHERE article_id NOT IN (SELECT id FROM article)
    -> ;
Empty set (0.00 sec)

MariaDB [otrs]> 
Ist hier etwas zu tun?
hkais
Znuny expert
Posts: 280
Joined: 16 Apr 2016, 08:55
Znuny Version: see in post
Real Name: Hans
Contact:

Re: Update 6.3.4 zu 6.4.x

Post by hkais »

daveman2909 wrote: 17 Aug 2022, 00:05 Hallo zusammen,

ich habe mich heute getraut unser OTRS 6.0.30 bis 6.3.4 upzudaten. Das hat ohne Probleme Funktioniert 8) Leider gab es aber ein Problem von Version 6.3.4 auf 6.4 upzudaten. Das ausführen von scripts/MigrateToZnuny6_4.pl gibt Folgendes aus
seltsam, solche Probleme kenne ich nur von vor 6.0 Zeiten
Wird bei euch händisch in der Datenbank "operiert"?

daveman2909 wrote: 17 Aug 2022, 00:05 Linux ist ein CentOS 7. Extra Packages haben wir nicht installiert.

Hier würde ich zügig wechseln, das CentOS7 ist seit 2020 aus dem Main Support raus, ab 2024 vollends abgekündigt.
Und nicht vergessen, Entwickler arbeiten meist mit/an "neuesten" Versionen, die neue Package-Versionen voraussetzen. Auch wenn gut entwicklerseitig getestet wird, ist es doch ein CentOS ein OS das von 2014 ist und es ist sehr unwahrscheinlich, dass die Tests genau so intensiv sind wie mit neueren OS Versionen...

Falls Interesse besteht auf Ubuntu zu wechseln einfach mal Google befragen . Ubuntu LTS ist mind. genau so beliebt wie CentOS und hat auch 5 Jahre support. (RHEL hat 10, daher hatte centOS7 diese 10 Jahre auch)

Ich weiß es wird gerade auch an einem Artikel gearbeitet wie man auf Ubuntu 22.04 upgrade kann. Wird aber noch etwas dauern bis dieser online ist. Das Setup ist allerdings nahezu identisch zu Ubuntu 20.04
Ich darf den direkten Link leider nicht mehr posten und bin auch schon verwarnt worden. Es wurden nach der Verwarnung auch die Forenregeln geändert
Elected 2022-06 as an IT Governance Portal Expert. The portal for Znuny, OTRS and OTOBO users
hkais
Znuny expert
Posts: 280
Joined: 16 Apr 2016, 08:55
Znuny Version: see in post
Real Name: Hans
Contact:

Re: Update 6.3.4 zu 6.4.x

Post by hkais »

daveman2909 wrote: 17 Aug 2022, 10:20
MariaDB [otrs]> SELECT * FROM article_flag WHERE article_id NOT IN (SELECT id FROM article);
+------------+-------------+---------------+---------------------+-----------+
| article_id | article_key | article_value | create_time | create_by |
+------------+-------------+---------------+---------------------+-----------+
| 0 | Seen | 1 | 2021-03-18 09:55:55 | 2 |
+------------+-------------+---------------+---------------------+-----------+
1 row in set (0.22 sec)

Ist hier etwas zu tun?
einfach einen Gegentest noch machen mit

Code: Select all

SELECT * FROM article_flag WHERE article_id = 0;
falls hier eine Row zurück kommt (sollte der Fall sein):

Code: Select all

delete from article_flag WHERE article_id = 0;
Elected 2022-06 as an IT Governance Portal Expert. The portal for Znuny, OTRS and OTOBO users
daveman2909
Znuny newbie
Posts: 5
Joined: 25 Jul 2019, 15:57
Znuny Version: 6.0.30
Real Name: David T
Company: Stadtwerke

Re: Update 6.3.4 zu 6.4.x

Post by daveman2909 »

hkais wrote: 17 Aug 2022, 10:47 seltsam, solche Probleme kenne ich nur von vor 6.0 Zeiten
Wird bei euch händisch in der Datenbank "operiert"?
Nein, wir haben nichts manuell an der Datenbank geändert.
hkais wrote: 17 Aug 2022, 10:52 CODE: SELECT ALL

SELECT * FROM article_flag WHERE article_id = 0;
falls hier eine Row zurück kommt (sollte der Fall sein):
CODE: SELECT ALL

delete from article_flag WHERE article_id = 0;
Vielen Dank! jetzt ist das Script ohne Probleme durchgelaufen :-)
hkais wrote: 17 Aug 2022, 10:47 Hier würde ich zügig wechseln, das CentOS7 ist seit 2020 aus dem Main Support raus, ab 2024 vollends abgekündigt.
Tatsächlich werden wir bald auf Ubuntu wechseln, aber bis 1.Q nächsten Jahres muss es noch durchhalten. Das Ticketsystem ist rein Intern und von außen nicht erreichbar.

Vielen Dank an euch beiden!
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Update 6.3.4 zu 6.4.x

Post by root »

hkais wrote: 17 Aug 2022, 10:47 seltsam, solche Probleme kenne ich nur von vor 6.0 Zeiten
We aufmerksam die CHANGES.md und Release Notes liest kann sowas mitbekommen. Basiert auf einem Bugs aus Pre Znuny LTS-Zeiten.

hkais wrote: 17 Aug 2022, 10:47 Ich darf den direkten Link leider nicht mehr posten und bin auch schon verwarnt worden. Es wurden nach der Verwarnung auch die Forenregeln geändert
Keine Regeln wurde danach geändert, externe Links zu kommerziellen Angeboten wurden stets verwarnt. Auch hier: vorher gründlich lesen.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Update 6.3.4 zu 6.4.x

Post by root »

daveman2909 wrote: 17 Aug 2022, 11:52 Vielen Dank! jetzt ist das Script ohne Probleme durchgelaufen :-)
Hallo,

schön zu hören.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
hkais
Znuny expert
Posts: 280
Joined: 16 Apr 2016, 08:55
Znuny Version: see in post
Real Name: Hans
Contact:

Re: Update 6.3.4 zu 6.4.x

Post by hkais »

root wrote: 17 Aug 2022, 12:08 Keine Regeln wurde danach geändert, externe Links zu kommerziellen Angeboten wurden stets verwarnt. Auch hier: vorher gründlich lesen.
Eigentlich lohnt es sich hierüber nicht zu diskutieren, aber ein Text-Diff würde hier klar einen Change bringen:
Screenshot_02877.png
dazwischen: Warning issued
Screenshot_02878.png

Es ist das Hausrecht von Znuny hier, trotzdem wäre es schön vorher informiert zu werden,
"hey Du, das möchten wir nicht, wir ändern nun auch die Regeln"
Dann kann man auch sauber darauf reagieren und eine Lösung finden. Insb. war der Link ein hilfreicher Link um Probleme von Usern zu lösen...
You do not have the required permissions to view the files attached to this post.
Elected 2022-06 as an IT Governance Portal Expert. The portal for Znuny, OTRS and OTOBO users
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Update 6.3.4 zu 6.4.x

Post by root »

Hi,

um das ganze mal abzukürzen, weil Diskussionen lohne nicht wirklich: es handelt sich dabei um eine angepasst Version der Bedingungen. Die muss bei jedem Update des Boards manuell aktualisiert werden. Und, Menschen übersehen auch mal was. Fakt ist: direkte Links zu kommerziellen Angeboten in Posts waren von Beginn an nur im Marktplatz geduldet, egal von wem. Das wurde dann auch vom ehemaligen Trägerverein, dem Otterhub e.V., so mitgetragen.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
kivide
Znuny newbie
Posts: 4
Joined: 03 Jun 2022, 10:48
Znuny Version: 6.3.1
Real Name: Kevin D

Re: Update 6.3.4 zu 6.4.x

Post by kivide »

Hallo,

bei uns ist ein ähnlicher Fehler beim Update von 6.3.4 auf 6.4.1 aufgetreten:

Beim Ausführen von "scripts/MigrateToZnuny6_4.pl" haben wir folgende Fehlermeldung erhalten

Code: Select all

    Step 6 of 16: Check if database has been backed up ...
    Step 7 of 16: Upgrade database structure ...
[Fri Sep  2 10:38:32 2022] MigrateToZnuny6_4.pl: DBD::mysql::db do failed: Cannot add or update a child row: a foreign key constraint fails (`otrs`.`#sql-2ce_ac`, CONSTRAINT `FK_article_flag_article_id_id` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`)) at /opt/znuny-6.4.1/Kernel/System/DB.pm line 471.
ERROR: OTRS-otrs.Console.pl-Dev::Code::CPANAudit-10 Perl: 5.30.0 OS: linux Time: Fri Sep 2 08:38:32 2022

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

 Traceback (2861): 
   Module: scripts::Migration::Base::ExecuteXMLDBString Line: 394
   Module: scripts::Migration::Base::ExecuteXMLDBArray Line: 342
   Module: scripts::Migration::Znuny::UpgradeDatabaseStructure::RecreateForeignKeysToArticleTable::_RecreateForeignKeysPointingToArticleTable Line: 69
   Module: scripts::Migration::Znuny::UpgradeDatabaseStructure::RecreateForeignKeysToArticleTable::Run Line: 31
   Module: scripts::Migration::Znuny::UpgradeDatabaseStructure::Run Line: 81
   Module: scripts::Migration::_ExecuteComponent Line: 155
   Module: scripts::Migration::Run Line: 67
   Module: scripts/MigrateToZnuny6_4.pl Line: 82
Ich habe dann die o.g. SQL ausgeführt und zwei Artikel gefunden

Code: Select all

mysql> SELECT * FROM article_flag WHERE article_id NOT IN (SELECT id FROM article);
+------------+-------------+---------------+---------------------+-----------+
| article_id | article_key | article_value | create_time         | create_by |
+------------+-------------+---------------+---------------------+-----------+
|      58161 | Seen        | 1             | 2019-02-06 03:00:09 |         1 |
|      62245 | Seen        | 1             | 2019-03-17 08:30:15 |         1 |
+------------+-------------+---------------+---------------------+-----------+
 
Der Gegentest hat soweit wieder die beiden Artikel ausgegeben.

Code: Select all

mysql> SELECT * FROM article_flag WHERE article_id = 58161;
+------------+-------------+---------------+---------------------+-----------+
| article_id | article_key | article_value | create_time         | create_by |
+------------+-------------+---------------+---------------------+-----------+
|      58161 | Seen        | 1             | 2019-02-06 03:00:09 |         1 |
+------------+-------------+---------------+---------------------+-----------+
1 row in set (0.00 sec)

mysql> SELECT * FROM article_flag WHERE article_id = 62245;
+------------+-------------+---------------+---------------------+-----------+
| article_id | article_key | article_value | create_time         | create_by |
+------------+-------------+---------------+---------------------+-----------+
|      62245 | Seen        | 1             | 2019-03-17 08:30:15 |         1 |
+------------+-------------+---------------+---------------------+-----------+
1 row in set (0.01 sec)
Zur Sicherheit :D: Sind diese Artikel verwaist und im OTRS nicht mehr auffindbar. Kann ich die sicher löschen?
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Update 6.3.4 zu 6.4.x

Post by root »

kivide wrote: 02 Sep 2022, 11:29 Zur Sicherheit :D: Sind diese Artikel verwaist und im OTRS nicht mehr auffindbar. Kann ich die sicher löschen?
Hi,

Ja, es sind ja Verweise auf Artikel die es nicht mehr gibt. Ohne das Löschen dieser Artikel geht's nicht weiter.
Du kannst ja mal mit

Code: Select all

SELECT * FROM article WHERE id in (58161, 62245) 
prüfen was drin steht ;-)

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
hkais
Znuny expert
Posts: 280
Joined: 16 Apr 2016, 08:55
Znuny Version: see in post
Real Name: Hans
Contact:

Re: Update 6.3.4 zu 6.4.x

Post by hkais »

kivide wrote: 02 Sep 2022, 11:29
Message: Cannot add or update a child row: a foreign key constraint fails (`otrs`.`#sql-2ce_ac`, CONSTRAINT `FK_article_flag_article_id_id` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`)), SQL: 'EXECUTE FKStatement'
habt Ihr in der Vergangenheit manuell gelöscht (in der Datenbank)?

@root, solche Fehler kenne ich nur aus der vor 6.0 Zeiten. Waren das Bugs in OTRS?
Darf ja eigentlich, wenn sauber transaktional programmiert wird, nicht passieren. Oder täusche ich mich?
Elected 2022-06 as an IT Governance Portal Expert. The portal for Znuny, OTRS and OTOBO users
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Update 6.3.4 zu 6.4.x

Post by root »

hkais wrote: 02 Sep 2022, 13:35
@root, solche Fehler kenne ich nur aus der vor 6.0 Zeiten. Waren das Bugs in OTRS?
Darf ja eigentlich, wenn sauber transaktional programmiert wird, nicht passieren. Oder täusche ich mich?
Ja, das war in Fehler in der 6.0. Da wurde irgendwann mal der Constraint gelöscht. Das haben wir nur gefixt: https://github.com/znuny/Znuny/issues/245

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
kivide
Znuny newbie
Posts: 4
Joined: 03 Jun 2022, 10:48
Znuny Version: 6.3.1
Real Name: Kevin D

Re: Update 6.3.4 zu 6.4.x

Post by kivide »

root wrote: 02 Sep 2022, 11:43 Ja, es sind ja Verweise auf Artikel die es nicht mehr gibt. Ohne das Löschen dieser Artikel geht's nicht weiter.
Danke :D . Update auf dem Produktionssystem hat soweit geklappt.
hkais wrote: 02 Sep 2022, 13:35 habt Ihr in der Vergangenheit manuell gelöscht (in der Datenbank)?
Änderungen per Hand haben wir nicht gemacht.
Post Reply