Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration: Errors in ConfigurationDeploy() might not show up in migration.pl web interface #1216

Closed
bschmalhofer opened this issue Sep 2, 2021 · 9 comments
Assignees
Labels
bug Something isn't working as intended
Milestone

Comments

@bschmalhofer
Copy link
Contributor

During migration from OTRS 6 to OTOBO 10 the following line was encountered in the Apache log file:

[Error][Kernel::System::SysConfig::ConfigurationDeploy][Line:3506]: Setting PostmasterDefaultQueue Effective value is not correct: Entity value is invalid(Platinum-Support)!

This message is emitted by Kernel::System::SysConfig::ConfigurationDeploy() which is called in Kernel/System/MigrateFromOTRS/OTOBOMigrateConfigFromOTRS.pm. The cause of the error message is that the queue Platinum-Support is not available in the migrated database. This could have been caused by a misconfiguration in the source system.

However the code that calls ConfigurationDeploy() looks fishy.

   # Write ZZZAAuto.pm
    my $Success = $SysConfigObject->ConfigurationDeploy(
        Comments    => $Param{Comments} || "Migrate Configuration from OTRS to OTOBO",
        AllSettings => 1,
        Force       => 1,
        UserID      => 1,
    );

The method should return a list of key value pairs, not a single scalar. This means that $Success is set to the last value of that list, which can be 0 by chance. Thus it depends on chance whether a failure of ConfigurationDeploy() is detected and thus reported in the webinterface. A missing error message is bad because in the error case the file ZZZAAuto.pm is propably not updated.

@bschmalhofer bschmalhofer added the bug Something isn't working as intended label Sep 2, 2021
@bschmalhofer bschmalhofer added this to the OTOBO 10.0.13 milestone Sep 2, 2021
@bschmalhofer bschmalhofer self-assigned this Sep 2, 2021
@bschmalhofer
Copy link
Contributor Author

See also #744.

@bschmalhofer bschmalhofer changed the title Migration: Errors in ConfigurationDeploy() might not shown in migration.pl web interface Migration: Errors in ConfigurationDeploy() might not show up in migration.pl web interface Sep 2, 2021
@bschmalhofer
Copy link
Contributor Author

Tested this be renaming the state 'closed successful' to 'closed successful renamed'. During migration there was no error message but ZZZAAuto,pm was not written. This effect should not happen all the time, but it did in my initial tests.
Testing now the solution where the result of ConfigurationDeploy() is treated as a hash.

Along the way, I did a bit of tidying of the migration modules.

@bschmalhofer
Copy link
Contributor Author

The fix looks fine. Here is the changed message:

Migriert die Konfigurationseinstellungen.

The merged configuration could not be deployed. Please try to fix the configuration by running these console commands:
Admin::Config::ListInvalid, Admin::Config::FixInvalid, Maint::Config::Rebuild.

bschmalhofer added a commit that referenced this issue Sep 7, 2021
Because the migration is not only about notifications.
bschmalhofer added a commit that referenced this issue Sep 7, 2021
when OTRS already has been replaced be OTOBO
bschmalhofer added a commit that referenced this issue Sep 7, 2021
as not everything is a notification message
bschmalhofer added a commit that referenced this issue Sep 7, 2021
bschmalhofer added a commit that referenced this issue Sep 7, 2021
In the POD of the the migration modules.
@bschmalhofer
Copy link
Contributor Author

bschmalhofer commented Sep 7, 2021

TODO:

  • Documment the message as an known migration problem in content/migration-from-otrs-6.rst .

bschmalhofer added a commit to RotherOSS/doc-otobo-installation that referenced this issue Sep 8, 2021
Mention that in OTOBO 10.0.12 there is a new check for NULLs before the data transfer.
bschmalhofer added a commit to RotherOSS/doc-otobo-installation that referenced this issue Sep 8, 2021
bschmalhofer added a commit to RotherOSS/doc-otobo-installation that referenced this issue Sep 8, 2021
@bschmalhofer
Copy link
Contributor Author

I think that there is still an issue with caching. In the test scenario where the state 'closed successful' I could repair the sysconfig with Admin::Config::FixInvalid. But at first there was a complaint for some other settings, indicating that the new states were not valid. This could be explained by the Kernel::System::State cache holding still the states of the initiial OTOBO installation. Let's try to do the migration task OTOBOCacheCleanup twice. The first time before OTOBOMigrateConfigFromOTRS and then before OTOBOPackageSpecifics.

@bschmalhofer
Copy link
Contributor Author

bschmalhofer commented Sep 9, 2021

Using the step OTOBOCacheCleanuptwice did not pan out, as step names are used in a hash somewhere. The second usage thus overwrites the first usage.
The alternative solution is to clean up the cache directly in the OTOBODatabaseMigrate step. This seems to work fine. Redoing the testmigraion from above, the error message is shown as expected. But this time the fixing worked smoothly.

bes:/devel/OTOBO/otobo (issue-#1216-ConfigurationDeploy)$ bin/otobo.Console.pl Admin::Config::ListInvalid
The following settings have an invalid value:
Ticket::Frontend::AgentTicketQuickClose###State = 'closed successful';
bes:
/devel/OTOBO/otobo (issue-#1216-ConfigurationDeploy)$ bin/otobo.Console.pl Admin::Config::FixInvalid

Ticket::Frontend::AgentTicketQuickClose###State is invalid, select one of the choices below:
[1] new
[2] closed successful renamed
[3] closed unsuccessful
[4] open
[5] removed
[6] pending reminder
[7] pending auto close+
[8] pending auto close-
[9] merged

Your choice: 2

Deployment successful.
Done.

Apparently the deployment is already done by FixInvalid.

TODO:

  • Remove Maint::Config::Rebuild from the documentation and the message.

bschmalhofer added a commit that referenced this issue Sep 9, 2021
@bschmalhofer
Copy link
Contributor Author

bschmalhofer commented Sep 9, 2021

Another test migration ran fine. The PR is merged . Closing this issue.

@bschmalhofer
Copy link
Contributor Author

While Testing #1297 I ran into more SecureMode errors after calling Admin::Config::FixInvalid. The difference to the previous migration scenarios must have been, that SecureMode was now enabled in the source OTRS installation. This can be fixed by calling bin/otobo.Console.pl Maint::Config::ReBuild.
Reopening this issue as the message must be enhanced again.

@bschmalhofer bschmalhofer reopened this Oct 6, 2021
bschmalhofer added a commit that referenced this issue Oct 6, 2021
especially when SecureMode was active in the source OTRS installation.
bschmalhofer added a commit that referenced this issue Oct 6, 2021
Issue #1216: Maint::Config::Rebuild is needed after all,
@bschmalhofer
Copy link
Contributor Author

Adapted the message. Closing this issue again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as intended
Projects
None yet
Development

No branches or pull requests

1 participant