Skip to content

Package reinstall from command line throws DB errors #3

Description

@wollmers

OTOBO Version 10.0.5
FAQ Version 10.0.0 fetched from git ba8e45f

Severity: minor (workaround: install via web interface)

Impact: Caused unusable installation the first time. Now reproducing results in a working installation.

Remark: Update of uploaded package via web interface works (no errors in the logs)

Reproduce and log:

$ bin/otobo.Console.pl Dev::Package::Build --module-directory faq faq/FAQ.sopm .
Building package...
Done.

$ bin/otobo.Console.pl Admin::Package::Install FAQ-10.0.0.opm
[...]
Done.

$ bin/otobo.Console.pl Admin::Package::Reinstall FAQ-10.0.0.opm
Reinstalling package...
[...]

        # create the package name
        my $CodeModule = 'var::packagesetup::' . $Param{Structure}->{Name}->{Content};

        $Kernel::OM->Get($CodeModule)->CodeReinstall();
    
[Fri Nov  6 16:59:04 2020] otobo.Console.pl: DBD::mysql::db do failed: Duplicate entry 'external (customer)' for key 'faq_state_name' at /home/VirtualOTOBO/ov14/Kernel/System/DB.pm line 566.
ERROR: OTOBO-otobo.Console.pl-Admin::Package::Reinstall-14 Perl: 5.26.1 OS: linux Time: Fri Nov 6 15:59:04 2020

 Message: Duplicate entry 'external (customer)' for key 'faq_state_name', SQL: '
            INSERT INTO faq_state (name, type_id)
            VALUES ( ?, ? )'

 Traceback (4038): 
   Module: Kernel::Config::Files::AAAFred::__ANON__ Line: 125
   Module: Kernel::System::FAQ::State::StateAdd Line: 74
   Module: var::packagesetup::FAQ::_InsertFAQStates Line: 326
   Module: var::packagesetup::FAQ::CodeReinstall Line: 136
   Module: (eval) Line: 6
   Module: Kernel::System::Package::_Code Line: 3652
   Module: Kernel::System::Package::PackageReinstall Line: 751
   Module: Kernel::System::Console::Command::Admin::Package::Reinstall::Run Line: 87
   Module: (eval) Line: 468
   Module: Kernel::System::Console::BaseCommand::Execute Line: 462
   Module: Kernel::System::Console::InterfaceConsole::Run Line: 88
   Module: bin/otobo.Console.pl Line: 35

[Fri Nov  6 16:59:04 2020] otobo.Console.pl: DBD::mysql::db do failed: Duplicate entry 'internal (agent)' for key 'faq_state_name' at /home/VirtualOTOBO/ov14/Kernel/System/DB.pm line 566.
ERROR: OTOBO-otobo.Console.pl-Admin::Package::Reinstall-14 Perl: 5.26.1 OS: linux Time: Fri Nov 6 15:59:04 2020

 Message: Duplicate entry 'internal (agent)' for key 'faq_state_name', SQL: '
            INSERT INTO faq_state (name, type_id)
            VALUES ( ?, ? )'

[Traceback same as above]

[Fri Nov  6 16:59:04 2020] otobo.Console.pl: DBD::mysql::db do failed: Duplicate entry 'public (all)' for key 'faq_state_name' at /home/VirtualOTOBO/ov14/Kernel/System/DB.pm line 566.
ERROR: OTOBO-otobo.Console.pl-Admin::Package::Reinstall-14 Perl: 5.26.1 OS: linux Time: Fri Nov 6 15:59:04 2020

 Message: Duplicate entry 'public (all)' for key 'faq_state_name', SQL: '
            INSERT INTO faq_state (name, type_id)
            VALUES ( ?, ? )'

[Traceback same as above]

Done.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

wontfixThis will not be worked on

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions