Migration from OTRS: HTTP 413 when installing OTRS migration plugin

Infos:

  • Used Zammad version: not applicable
  • Used Zammad installation source: not applicable
  • Used OTRS version: 3.2.9
  • Operating system: Windows 7, 64 Bit
  • Webserver: IIS 7
  • Browser + version: Internetexplorer

Reffering to steps from migration manual from https://docs.zammad.org/en/latest/migration/otrs.html

Expected behavior:

In existing OTRS:

  • Install Znuny4OTRS-Repo
  • Install OTRS migration plugin

Actual behavior:

  • Install Znuny4OTRS-Repo --> worked fine
  • Install OTRS migration plugin --> HTTP Error 413 when uploading opm-file via browser
    HTTP-Fehler 413.1 - Request Entity Too Large

Steps to reproduce the behavior:

  • Use Win 7 VM with OTRS 3.2.9
  • Login to OTRS, Administration --> Packagemanagement
  • Install OTRS migration plugin via opm fileupload

Already altered the “uploadReadAheadSize” value in IIS7 management to a bigger value, so the opm-file (~40mb) wold be accepted, but still no upload possible

I managed to fix the 413 Error by additionally increasing the value of “maxAllowedContentLength” in “system.webserver/security/requestFiltering” in IIS 7 configuration.

Now uploading the file doesn’t return an HTTP 413 error anymore, but also there is no confirmation for the successful upload/installation of the plug in.
When selecting the file and uploading it via packagemanagement, it just returns to the index page and when checking the packagemanagement, there is no new package listed there.

“Znuny4OTRS-Repo” is listed though, as this uploaded was successful at the first try.
So I guess, when the installation would be successful, the " OTRS migration plugin" should be listed there aswell?

Maybe @thorsteneckel can help.

Hi @lxk3il - can you please share your OTRS logs when uploading the package via the PackageManager?

Hi @thorsteneckel , thank you very much for your help!
As the concerned system is running on a Win7 VM I checked the logs in [install dir]\otrs\var\log\otrs
Unfortunately there is no new error log entry, when attempting to install the migration plugin.
To test the functionality I tried to reinstall the Znuny repository plugin, which gave a proper error both, in the browser and inside the error log:

[Mon Mar  2 11:04:25 2020][Error][Kernel::System::Package::PackageUpgrade][677] Can't upgrade, package 'Znuny4OTRS-Repo-3.3.2' already installed!

But as stated before, there is no new log entry, when trying to install the migration plugin.

Am I missing something out here? Maybe it’s still an issue with the IIS7 config?

Hey @thorsteneckel do you have any idea what could be the problem here?
Also tried to install via firefox and chrome, but I still can’t install the migration plugin unfortunately.

Hey @lxk3il - that’s really weird. I currently have no idea what the cause could be. Can you try to install it via the CLI:

perl bin/otrs.PackageManager.pl -a install -p /path/to/Znuny4OTRS-ZammadMigrator-3.0.31.opm

This worked on our (Linux) test system.

Thanks @thorsteneckel! I used your command and got some errors now:

PS C:\OTRS\OTRS\bin> perl otrs.PackageManager.pl -a install -p [path to]\Znuny4OTRS-ZammadMigrator-3.0.31.opm
Notice: Install C:/OTRS/OTRS/Kernel/Config/Files/Znuny4OTRSZammadMigrator.xml (644)!
Notice: Install C:/OTRS/OTRS/Kernel/Modules/ZammadMigrator.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Ticket/Event/Znuny4OTRSZammadMigratorTicketDiffSet.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/Customer.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/CustomerUser.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/DynamicField.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/GenericAttribute.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/GenericBase.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/GenericColumn.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/Group.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/PostMasterFilter.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/Priority.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/Queue.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/Role.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/Signature.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/State.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/StateType.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/SysConfig.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/SystemAddress.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/Ticket.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/TicketArticle.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/TicketAttachments.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/TicketHistory.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/User.pm (644)!
Notice: Install C:/OTRS/OTRS/scripts/test/Znuny4OTRSZammadMigrator/System/Zammad/Migrator.t (644)!
Notice: Install C:/OTRS/OTRS/var/development/3_3_6_test_2014-10-09.sql.zip (644)!
Notice: Install C:/OTRS/OTRS/var/packagesetup/Znuny4OTRSZammadMigrator.pm (644)!
Notice: Install C:/OTRS/OTRS/doc/de/Znuny4OTRS-ZammadMigrator.pdf (660)!
Notice: Install C:/OTRS/OTRS/doc/en/Znuny4OTRS-ZammadMigrator.pdf (660)!
DBD::mysql::db do failed: MySQL server has gone away at C:/OTRS/OTRS/Kernel/System/DB.pm line 475.
ERROR: OTRS-otrs.PackageManager.pl-10 Perl: 5.16.3 OS: MSWin32 Time: Thu Mar  5 22:27:24 2020

 Message: MySQL server has gone away, SQL: 'INSERT INTO package_repository (name, version, vendor, filename,  content_size, content_type, content, install_status,  create_time, create_by, change_time, change_by) VALUES  (?, ?, ?, ?, '213',
'text/xml', ?, 'not installed',
        '2020-03-05 22:27:23'
    , 1,
        '2020-03-05 22:27:23'
    , 1)'

 Traceback (4776):
   Module: Kernel::System::Package::RepositoryAdd (OTRS 3.2.9) Line: 333
   Module: Kernel::System::Package::PackageInstall (OTRS 3.2.9) Line: 496
   Module: otrs.PackageManager.pl (unknown version) Line: 353

Oh wow! Can you share the logs of your MySQL Server at the time of the error?

Sure. I’m not as familiar with exporting SQL-logs, but this is what I got after enabling logging and rerunning the perl command:

-- --------------------------------------------------------
-- Host:                         127.0.0.1
-- Server Version:               5.1.51-community-log - MySQL Community Server (GPL)
-- Server Betriebssystem:        Win32
-- HeidiSQL Version:             9.4.0.5125
-- --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

-- Exportiere Daten aus Tabelle mysql.general_log: 2 rows
/*!40000 ALTER TABLE `general_log` DISABLE KEYS */;
INSERT INTO `general_log` (`event_time`, `user_host`, `thread_id`, `server_id`, `command_type`, `argument`) VALUES
	('2020-03-06 10:10:51', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'USE `mysql`'),
	('2020-03-06 10:10:51', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SHOW CREATE TABLE `mysql`.`general_log`'),
	('2020-03-06 10:11:18', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SELECT * FROM `mysql`.`general_log` LIMIT 1000'),
	('2020-03-06 10:11:18', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SHOW CREATE TABLE `mysql`.`general_log`'),
	('2020-03-06 10:11:30', 'otrs[otrs] @ localhost [127.0.0.1]', 679, 1, 'Connect', 'otrs@localhost on otrs'),
	('2020-03-06 10:11:30', 'otrs[otrs] @ localhost [127.0.0.1]', 679, 1, 'Query', 'SET NAMES utf8'),
	('2020-03-06 10:11:32', 'otrs[otrs] @ localhost [127.0.0.1]', 679, 1, 'Query', 'SELECT name FROM package_repository WHERE name = \'Znuny4OTRS-ZammadMigrator\' AND install_status = \'installed\' LIMIT 1'),
	('2020-03-06 10:11:33', 'otrs[otrs] @ localhost [127.0.0.1]', 679, 1, 'Query', 'SELECT content FROM package_repository WHERE name = \'Znuny4OTRS-ZammadMigrator\' AND version = \'3.0.31\' LIMIT 1'),
	('2020-03-06 10:11:43', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SHOW CREATE TABLE `mysql`.`ndb_binlog_index`'),
	('2020-03-06 10:11:43', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SELECT * FROM `mysql`.`ndb_binlog_index` LIMIT 1000'),
	('2020-03-06 10:11:43', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SHOW CREATE TABLE `mysql`.`ndb_binlog_index`'),
	('2020-03-06 10:11:43', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SHOW CREATE TABLE `mysql`.`general_log`'),
	('2020-03-06 10:11:44', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SELECT * FROM `mysql`.`general_log` LIMIT 1000'),
	('2020-03-06 10:11:44', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SHOW CREATE TABLE `mysql`.`general_log`'),
	('2020-03-06 10:11:50', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SHOW CREATE TABLE `mysql`.`ndb_binlog_index`'),
	('2020-03-06 10:11:50', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SELECT * FROM `mysql`.`ndb_binlog_index` LIMIT 1000'),
	('2020-03-06 10:11:50', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SHOW CREATE TABLE `mysql`.`ndb_binlog_index`'),
	('2020-03-06 10:11:51', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SHOW CREATE TABLE `mysql`.`general_log`'),
	('2020-03-06 10:11:51', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SELECT * FROM `mysql`.`general_log` LIMIT 1000'),
	('2020-03-06 10:11:51', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SHOW CREATE TABLE `mysql`.`general_log`'),
	('2020-03-06 10:11:53', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SHOW CREATE TABLE `mysql`.`ndb_binlog_index`'),
	('2020-03-06 10:11:53', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SELECT * FROM `mysql`.`ndb_binlog_index` LIMIT 1000'),
	('2020-03-06 10:11:53', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SHOW CREATE TABLE `mysql`.`ndb_binlog_index`'),
	('2020-03-06 10:11:53', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SHOW CREATE TABLE `mysql`.`general_log`'),
	('2020-03-06 10:11:53', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SELECT * FROM `mysql`.`general_log` LIMIT 1000'),
	('2020-03-06 10:11:53', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SHOW CREATE TABLE `mysql`.`general_log`'),
	('2020-03-06 10:12:06', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SHOW CREATE TABLE `mysql`.`ndb_binlog_index`'),
	('2020-03-06 10:12:06', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SELECT * FROM `mysql`.`ndb_binlog_index` LIMIT 1000'),
	('2020-03-06 10:12:06', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SHOW CREATE TABLE `mysql`.`ndb_binlog_index`'),
	('2020-03-06 10:12:07', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SHOW CREATE TABLE `mysql`.`general_log`'),
	('2020-03-06 10:12:07', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SELECT * FROM `mysql`.`general_log` LIMIT 1000'),
	('2020-03-06 10:12:07', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SHOW CREATE TABLE `mysql`.`general_log`'),
	('2020-03-06 10:13:18', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SELECT \'mysql\' AS `Database`, \'general_log\' AS `Table`, 2 AS `Rows`, 0 AS `Duration`'),
	('2020-03-06 10:13:18', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', '/*!40101 SET @OLD_LOCAL_SQL_MODE=@@SQL_MODE, SQL_MODE=\'\' */'),
	('2020-03-06 10:13:18', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', '/*!40101 SET SQL_MODE=IFNULL(@OLD_LOCAL_SQL_MODE, \'\') */'),
	('2020-03-06 10:13:21', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SELECT \'mysql\' AS `Database`, \'general_log\' AS `Table`, 2 AS `Rows`, 0 AS `Duration`'),
	('2020-03-06 10:13:21', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', '/*!40101 SET @OLD_LOCAL_SQL_MODE=@@SQL_MODE, SQL_MODE=\'\' */'),
	('2020-03-06 10:13:21', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', '/*!40101 SET SQL_MODE=IFNULL(@OLD_LOCAL_SQL_MODE, \'\') */'),
	('2020-03-06 10:13:51', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SELECT \'mysql\' AS `Database`, \'general_log\' AS `Table`, 2 AS `Rows`, 0 AS `Duration`'),
	('2020-03-06 10:13:51', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', '/*!40101 SET @OLD_LOCAL_SQL_MODE=@@SQL_MODE, SQL_MODE=\'\' */'),
	('2020-03-06 10:13:51', 'root[root] @ localhost [127.0.0.1]', 675, 1, 'Query', 'SELECT * FROM `mysql`.`general_log` LIMIT 104857600');
/*!40000 ALTER TABLE `general_log` ENABLE KEYS */;

/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;

Thanks @lxk3il - this looks more like a SQL Query log than an application log. There should be an application log where the cause for the MySQL server has gone away is described more detailed.

Until now I wasn’t able to locate the corresponding log, but found the parameter “max_allowed_packed” wich was limited to 20mb. I increased the value so the migration plugin opm-file would fit and got a new output:

PS C:\OTRS\OTRS\bin> perl otrs.PackageManager.pl -a install -p [path\to]\Znuny4OTRS-ZammadMigrator-3.0.
31.opm
Notice: Install C:/OTRS/OTRS/Kernel/Config/Files/Znuny4OTRSZammadMigrator.xml (644)!
Notice: Install C:/OTRS/OTRS/Kernel/Modules/ZammadMigrator.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Ticket/Event/Znuny4OTRSZammadMigratorTicketDiffSet.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/Customer.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/CustomerUser.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/DynamicField.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/GenericAttribute.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/GenericBase.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/GenericColumn.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/Group.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/PostMasterFilter.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/Priority.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/Queue.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/Role.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/Signature.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/State.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/StateType.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/SysConfig.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/SystemAddress.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/Ticket.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/TicketArticle.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/TicketAttachments.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/TicketHistory.pm (644)!
Notice: Install C:/OTRS/OTRS/Kernel/System/Zammad/Migrator/User.pm (644)!
Notice: Install C:/OTRS/OTRS/scripts/test/Znuny4OTRSZammadMigrator/System/Zammad/Migrator.t (644)!
Notice: Install C:/OTRS/OTRS/var/development/3_3_6_test_2014-10-09.sql.zip (644)!
Notice: Install C:/OTRS/OTRS/var/packagesetup/Znuny4OTRSZammadMigrator.pm (644)!
Notice: Install C:/OTRS/OTRS/doc/de/Znuny4OTRS-ZammadMigrator.pdf (660)!
Notice: Install C:/OTRS/OTRS/doc/en/Znuny4OTRS-ZammadMigrator.pdf (660)!
Notice: CREATE TABLE ticket_changed (
    ticket_id BIGINT NOT NULL,
    create_time DATETIME NOT NULL,
    INDEX ticket_changed_index (ticket_id, create_time)
)
Code:

        # define function name
        my $FunctionName = 'CodeInstall';

        # create the package name
        my $CodeModule = 'var::packagesetup::Znuny4OTRSZammadMigrator';

        # load the module
        if ( $Self->{MainObject}->Require($CodeModule) ) {

            # create new instance
            my $CodeObject = $CodeModule->new( %{$Self} );

            if ($CodeObject) {

                # start methode
                if ( !$CodeObject->$FunctionName(%{$Self}) ) {
                    $Self->{LogObject}->Log(
                        Priority => 'error',
                        Message  => "Could not call method $FunctionName() on $CodeModule.pm."
                    );
                }
            }

            # error handling
            else {
                $Self->{LogObject}->Log(
                    Priority => 'error',
                    Message  => "Could not call method new() on $CodeModule.pm."
                );
            }
        }

Subroutine Load redefined at C:/OTRS/OTRS/Kernel/Config/Files/ZZZAAuto.pm line 7.
Subroutine Load redefined at C:/OTRS/OTRS/Kernel/Config/Files/ZZZAuto.pm line 7.
Subroutine Load redefined at C:/OTRS/OTRS/Kernel/Config/Files/ZZZAAuto.pm line 7.
Subroutine Load redefined at C:/OTRS/OTRS/Kernel/Config/Files/ZZZAuto.pm line 7.
Code:
        return if !$Self->{MainObject}->Require('Kernel::System::ZnunyHelper');

        my $HelperObject = Kernel::System::ZnunyHelper->new();

        my @DynamicFieldRemove = ( 'ZammadMigratorChanged', 'ZammadMigratorChangedOld' );
        $HelperObject->_DynamicFieldsDelete( @DynamicFieldRemove );

Subroutine Load redefined at C:/OTRS/OTRS/Kernel/Config/Files/ZZZAAuto.pm line 7.
Subroutine Load redefined at C:/OTRS/OTRS/Kernel/Config/Files/ZZZAuto.pm line 7.
PS C:\OTRS\OTRS\bin>

Despite those “errors”, the migration plugin is now listed in the packetmanagement of OTRS. :slight_smile:

Migration is currently running and I will let you know if it was successful.

Well done @lxk3il! That’s it! The messages you see is just debugging/info logging that is not shown while installing packages via the web interface. There were no errors. Congratulations. Your package is now installed completely and correctly and you’re ready do go :rocket:

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.