Can't locate WebserviceText.pm in Znuny 6.5.2

Moderator: crythias

Post Reply
sergiy
Znuny newbie
Posts: 17
Joined: 28 Oct 2021, 18:39
Znuny Version: 6.5.3
Real Name: Sergiy
Location: Halifax, NS

Can't locate WebserviceText.pm in Znuny 6.5.2

Post by sergiy »

I am currently performing a test upgrade from 6.0.48 to 6.5.2, going through the intermediary steps 6.1 -> 6.2, etc.

When upgrading from 6.4.5 to 6.5.2, I get an error

Message: Can't locate Kernel/System/DynamicField/Driver/WebserviceText.pm in @INC (you may need to install the Kernel::System::DynamicField::Driver::WebserviceText module) ... at /opt/otrs/Kernel/System/Main.pm line 86

The constructor of Kernel::System::DynamicField::Backend returned undef. at /opt/otrs/Kernel/System/Ticket/TicketSearch.pm line 1427

I confirm that the file Kernel/System/DynamicField/Driver/WebserviceText.pm is missing in 6.5.2, but is present in 6.4.5.

How can I resolve this problem?
root
Administrator
Posts: 3954
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Can't locate WebserviceText.pm in Znuny 6.5.2

Post by root »

Hi,

Have you properly executed all migration scripts for every minor release? The script for 6.5 has a step where the dynamic field WebserviceText is renamed to WebserviceDropDown.

- 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 ?
sergiy
Znuny newbie
Posts: 17
Joined: 28 Oct 2021, 18:39
Znuny Version: 6.5.3
Real Name: Sergiy
Location: Halifax, NS

Re: Can't locate WebserviceText.pm in Znuny 6.5.2

Post by sergiy »

Did the upgrade two times before posting to the forum, and did another one just now again. Same outcome.

I am running Rocky 8. Upgrading to 6.4.5 is fine. The app works, and I see no errors in the Apache log when it runs.

Here is my upgrade path:
znuny-6.0.48
znuny-6.1.2
znuny-6.2.2
znuny-6.3.4
znuny-6.4.5
znuny-6.5.2

There was only one error message when upgrading to znuny-6.3.4:

Code: Select all

    Step 18 of 27: Rebuild configuration ...
ERROR: OTRS-otrs.Console.pl-Dev::Code::CPANAudit-10 Perl: 5.26.3 OS: linux Time: Wed May 10 00:51:56 2023

 Message: Its not an array!

 Traceback (1318803):
   Module: Kernel::System::SysConfig::ConfigurationXML2DB Line: 2690
   Module: scripts::Migration::Base::RebuildConfig Line: 82
   Module: scripts::Migration::Base::RebuildConfig::Run Line: 29
   Module: scripts::MigrateToZnuny6_3::_ExecuteComponent Line: 155
   Module: scripts::MigrateToZnuny6_3::Run Line: 67
   Module: scripts/MigrateToZnuny6_3.pl Line: 82

    Step 19 of 27: Remove Generic Agent system commands ...
But if I run scripts/MigrateToZnuny6_3.pl the second time, the message does not re-appear.

Here is the output from the migration script to 6.5:

Code: Select all

$ scripts/MigrateToZnuny6_5.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: Migrate SysConfig settings ...

        Should the SysConfig be migrated? [Y]es/[N]o: y


 Executing tasks ...

    Step 1 of 18: Check required Perl version ...
    Step 2 of 18: Check required database version ...
    Step 3 of 18: Check database charset ...
    Step 4 of 18: Check required Perl modules ...
    Step 5 of 18: Check if database has been backed up ...
    Step 6 of 18: Rebuild configuration ...
    Step 7 of 18: Migrate SysConfig settings ...
    Step 8 of 18: Migrate DBCRUD UUID columns ...
        Calendar::Plugin: Column dbcrud_uuid in table calendar_appointment_plugin...
            Column successfully created
        OAuth2Token: Column dbcrud_uuid in table oauth2_token...
            Column already exists
        OAuth2TokenConfig: Column dbcrud_uuid in table oauth2_token_config...
            Column already exists
    Step 9 of 18: Migrate dynamic fields ...
    Step 10 of 18: Migrate notification events ...
    Step 11 of 18: Integrate Znuny-NoteToLinkedTicket ...
    Step 12 of 18: Uninstall merged packages ...
    Step 13 of 18: Initialize default cron jobs ...
    Copying /opt/otrs/var/cron/aaa_base.dist to /opt/otrs/var/cron/aaa_base...
    done.
    Copying /opt/otrs/var/cron/otrs_daemon.dist to /opt/otrs/var/cron/otrs_daemon...
    done.
    Step 14 of 18: Clean up the cache ...
    Step 15 of 18: Rebuild configuration another time ...
    Step 16 of 18: Deploy ACLs ...
    Step 17 of 18: Deploy processes ...
    Step 18 of 18: Check invalid settings ...



 Migration completed!
And when I start Apache and try to access the web interface, I get a 500 error and the Apache logs show:

Code: Select all

 RemoteAddress: XXXXXX
 RequestURI: /otrs/index.pl?Action=AgentDashboard

 Traceback (1319059):
   Module: Kernel::System::DynamicField::Backend::new Line: 85
   Module: Kernel::System::ObjectManager::_ObjectBuild Line: 307
   Module: Kernel::System::ObjectManager::Get Line: 201
   Module: Kernel::System::Ticket::TicketSearch::TicketSearch Line: 1427
   Module: Kernel::Output::HTML::Dashboard::TicketStatsGeneric::Run Line: 152
   Module: Kernel::Modules::AgentDashboardCommon::_Element Line: 1002
   Module: Kernel::Modules::AgentDashboardCommon::Run Line: 629
   Module: Kernel::System::Web::InterfaceAgent::Run Line: 1144
   Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler Line: 39
   Module: (eval) (v1.99) Line: 207
   Module: ModPerl::RegistryCooker::run (v1.99) Line: 207
   Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 173
   Module: ModPerl::Registry::handler (v1.99) Line: 32

ERROR: OTRS-CGI-0 Perl: 5.26.3 OS: linux Time: Wed May 10 00:58:10 2023

 Message: Can't load dynamic field backend module for field type WebserviceText!

 RemoteAddress: XXXXXX
 RequestURI: /otrs/index.pl?Action=AgentDashboard

 Traceback (1319059):
   Module: Kernel::System::DynamicField::Backend::new Line: 86
   Module: Kernel::System::ObjectManager::_ObjectBuild Line: 307
   Module: Kernel::System::ObjectManager::Get Line: 201
   Module: Kernel::System::Ticket::TicketSearch::TicketSearch Line: 1427
   Module: Kernel::Output::HTML::Dashboard::TicketStatsGeneric::Run Line: 152
   Module: Kernel::Modules::AgentDashboardCommon::_Element Line: 1002
   Module: Kernel::Modules::AgentDashboardCommon::Run Line: 629
   Module: Kernel::System::Web::InterfaceAgent::Run Line: 1144
   Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler Line: 39
   Module: (eval) (v1.99) Line: 207
   Module: ModPerl::RegistryCooker::run (v1.99) Line: 207
   Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 173
   Module: ModPerl::Registry::handler (v1.99) Line: 32

ERROR: OTRS-CGI-0 Perl: 5.26.3 OS: linux Time: Wed May 10 00:58:10 2023

 Message: The constructor of Kernel::System::DynamicField::Backend returned undef.
sergiy
Znuny newbie
Posts: 17
Joined: 28 Oct 2021, 18:39
Znuny Version: 6.5.3
Real Name: Sergiy
Location: Halifax, NS

Re: Can't locate WebserviceText.pm in Znuny 6.5.2

Post by sergiy »

Not sure if it is relevant, we currently have 27 dynamic fields configured of various types: Text, ProcessID, ActivityID, Dropdown, Multiselect, TextArea, Date/Time, and Date.
sergiy
Znuny newbie
Posts: 17
Joined: 28 Oct 2021, 18:39
Znuny Version: 6.5.3
Real Name: Sergiy
Location: Halifax, NS

Re: Can't locate WebserviceText.pm in Znuny 6.5.2

Post by sergiy »

The problem is due to the WebserviceText driver being defined in ZZZAAuto.pm. It first appears there after the upgrade to 6.1.2 but does not get removed during the upgrade to 6.5.2.

I have removed it manually and the 6.5.2 seems to be up now.

Code: Select all

$Self->{'DynamicFields::Driver'}->{'WebserviceText'} =  {
  'Config' => {
    'DefaultValue' => '',
    'InvokerGet' => 'Invoker',
    'InvokerSearch' => 'Invoker',
    'Link' => '',
    'LinkPreview' => '',
    'Webservice' => 'Webservice'
  },
  'ConfigDialog' => 'AdminDynamicFieldWebservice',
  'DisplayName' => 'Web service (Text)',
  'Module' => 'Kernel::System::DynamicField::Driver::WebserviceText'
};
root
Administrator
Posts: 3954
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Can't locate WebserviceText.pm in Znuny 6.5.2

Post by root »

Hi,

This setting (and all others) in the file ZZZAAuto.om are generated from the default values and your changes from the database. The file is updated
by a scheduled task from the database. That means the error might come back.
I guess someone changed this setting, and a changed value is in the database. I would clean up the system configuration form non-existing/outdated settings:

bin/otrs.Console.pl Maint::Config::Rebuild --cleanup

- 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 ?
sergiy
Znuny newbie
Posts: 17
Joined: 28 Oct 2021, 18:39
Znuny Version: 6.5.3
Real Name: Sergiy
Location: Halifax, NS

Re: Can't locate WebserviceText.pm in Znuny 6.5.2

Post by sergiy »

I have already run "bin/otrs.Console.pl Maint::Config::Rebuild --cleanup" as part of the troubleshooting process, but it did not help.

I am still puzzled however, we have never used WebserviceText anywhere. We are currently running 6.0.48 which has no WebserviceText as a type of the Dynamic field. The file ZZZAAuto.pm there does not contain WebserviceText.

And as far as I can tell, the support for WebserviceText was introduced in version 6.1. And the upgrade process from 6.0 to 6.1 results in "WebserviceText" being added to ZZZAAuto.pm.
root
Administrator
Posts: 3954
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Can't locate WebserviceText.pm in Znuny 6.5.2

Post by root »

Hi,

If you execute with the Znuny user from the user's home these commands, what is the output?

Code: Select all

grep WebserviceText grep WebserviceText Kernel/Config/Files/XML/*
grep WebserviceDropdown Kernel/Config/Files/XML/*
- 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 ?
sergiy
Znuny newbie
Posts: 17
Joined: 28 Oct 2021, 18:39
Znuny Version: 6.5.3
Real Name: Sergiy
Location: Halifax, NS

Re: Can't locate WebserviceText.pm in Znuny 6.5.2

Post by sergiy »

Here is the output for 6.0.48 and 6.5.2 first, and then for all other versions:

Code: Select all

[znuny-6.0.48]$ grep WebserviceText Kernel/Config/Files/XML/*; echo "--";  grep WebserviceDropdown Kernel/Config/Files/XML/*
--

[znuny-6.0.48]$ cd ../znuny-6.5.2/
[znuny-6.5.2]$ grep WebserviceText Kernel/Config/Files/XML/*; echo "--";  grep WebserviceDropdown Kernel/Config/Files/XML/*
--
Kernel/Config/Files/XML/Znuny.xml:    <Setting Name="DynamicFields::Driver###WebserviceDropdown" Required="0" Valid="1">
Kernel/Config/Files/XML/Znuny.xml:                <Item Key="Module">Kernel::System::DynamicField::Driver::WebserviceDropdown</Item>
Kernel/Config/Files/XML/Znuny.xml:                    <Item Key="Title" Translatable="1">Admin configuration dialog for dynamic field types WebserviceDropdown and WebserviceMultiselect</Item>
Kernel/Config/Files/XML/Znuny.xml:        <Description Translatable="1">It might happen that a dynamic field of type WebserviceDropdown or WebserviceMultiselect will be set to a value fetched from a configured web service table but the web service record will not have a value set in the field that is configured as displayed value. Enable this setting to hide those dynamic fields in the ticket information widget of AgentTicketZoom so that they will not be shown as empty.</Description>

[znuny-6.5.2]$ cd ../znuny-6.1.2/
[znuny-6.1.2]$ grep WebserviceText Kernel/Config/Files/XML/*; echo "--";  grep WebserviceDropdown Kernel/Config/Files/XML/*
Kernel/Config/Files/XML/Znuny.xml:    <Setting Name="DynamicFields::Driver###WebserviceText" Required="1" Valid="1">
Kernel/Config/Files/XML/Znuny.xml:                <Item Key="Module">Kernel::System::DynamicField::Driver::WebserviceText</Item>
Kernel/Config/Files/XML/Znuny.xml:                    <Item Key="Title" Translatable="1">Admin configuration dialog for dynamic field types WebserviceText and WebserviceMultiselect</Item>
Kernel/Config/Files/XML/Znuny.xml:        <Description Translatable="1">It might happen that a dynamic field of type WebserviceText or WebserviceMultiselect will be set to a value fetched from a configured web service table but the web service record will not have a value set in the field that is configured as displayed value. Enable this setting to hide those dynamic fields in the ticket information widget of AgentTicketZoom so that they will not be shown as empty.</Description>
--

[znuny-6.1.2]$ cd ../znuny-6.2.2/
[znuny-6.2.2]$ grep WebserviceText Kernel/Config/Files/XML/*; echo "--";  grep WebserviceDropdown Kernel/Config/Files/XML/*
Kernel/Config/Files/XML/Znuny.xml:    <Setting Name="DynamicFields::Driver###WebserviceText" Required="1" Valid="1">
Kernel/Config/Files/XML/Znuny.xml:                <Item Key="Module">Kernel::System::DynamicField::Driver::WebserviceText</Item>
Kernel/Config/Files/XML/Znuny.xml:                    <Item Key="Title" Translatable="1">Admin configuration dialog for dynamic field types WebserviceText and WebserviceMultiselect</Item>
Kernel/Config/Files/XML/Znuny.xml:        <Description Translatable="1">It might happen that a dynamic field of type WebserviceText or WebserviceMultiselect will be set to a value fetched from a configured web service table but the web service record will not have a value set in the field that is configured as displayed value. Enable this setting to hide those dynamic fields in the ticket information widget of AgentTicketZoom so that they will not be shown as empty.</Description>
--

[znuny-6.2.2]$ cd ../znuny-6.3.4/
[znuny-6.3.4]$ grep WebserviceText Kernel/Config/Files/XML/*; echo "--";  grep WebserviceDropdown Kernel/Config/Files/XML/*
Kernel/Config/Files/XML/Znuny.xml:    <Setting Name="DynamicFields::Driver###WebserviceText" Required="1" Valid="1">
Kernel/Config/Files/XML/Znuny.xml:                <Item Key="Module">Kernel::System::DynamicField::Driver::WebserviceText</Item>
Kernel/Config/Files/XML/Znuny.xml:                    <Item Key="Title" Translatable="1">Admin configuration dialog for dynamic field types WebserviceText and WebserviceMultiselect</Item>
Kernel/Config/Files/XML/Znuny.xml:        <Description Translatable="1">It might happen that a dynamic field of type WebserviceText or WebserviceMultiselect will be set to a value fetched from a configured web service table but the web service record will not have a value set in the field that is configured as displayed value. Enable this setting to hide those dynamic fields in the ticket information widget of AgentTicketZoom so that they will not be shown as empty.</Description>
--

[znuny-6.3.4]$ cd ../znuny-6.4.5/
[znuny-6.4.5]$ grep WebserviceText Kernel/Config/Files/XML/*; echo "--";  grep WebserviceDropdown Kernel/Config/Files/XML/*
Kernel/Config/Files/XML/Znuny.xml:    <Setting Name="DynamicFields::Driver###WebserviceText" Required="1" Valid="1">
Kernel/Config/Files/XML/Znuny.xml:                <Item Key="Module">Kernel::System::DynamicField::Driver::WebserviceText</Item>
Kernel/Config/Files/XML/Znuny.xml:                    <Item Key="Title" Translatable="1">Admin configuration dialog for dynamic field types WebserviceText and WebserviceMultiselect</Item>
Kernel/Config/Files/XML/Znuny.xml:        <Description Translatable="1">It might happen that a dynamic field of type WebserviceText or WebserviceMultiselect will be set to a value fetched from a configured web service table but the web service record will not have a value set in the field that is configured as displayed value. Enable this setting to hide those dynamic fields in the ticket information widget of AgentTicketZoom so that they will not be shown as empty.</Description>
--
cisiu
Znuny newbie
Posts: 9
Joined: 26 Feb 2016, 15:38
Znuny Version: 6.4.5 - 6.5.2
Real Name: Krzysztof Ławniczak

Re: Can't locate WebserviceText.pm in Znuny 6.5.2

Post by cisiu »

Hi guys,

Just wanted to say that I've tried to upgrade 6.4.5 to 6.5.2 and ended with the same error ...WebserviceText.pm in @INC
and mentioned above solution/command worked in my case:

otrs.Console.pl Maint::Config::Rebuild --cleanup
root
Administrator
Posts: 3954
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Can't locate WebserviceText.pm in Znuny 6.5.2

Post by root »

Hi,

One question, did any of you copy over the file Kernel/Config/Files/ZZZAAuto.pm or do you use the RPM?

- 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 ?
sergiy
Znuny newbie
Posts: 17
Joined: 28 Oct 2021, 18:39
Znuny Version: 6.5.3
Real Name: Sergiy
Location: Halifax, NS

Re: Can't locate WebserviceText.pm in Znuny 6.5.2

Post by sergiy »

I have always upgraded via source, and I did not copy over ZZZAAuto.pm since it is not in the upgrade instructions.
root
Administrator
Posts: 3954
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Can't locate WebserviceText.pm in Znuny 6.5.2

Post by root »

sergiy wrote: 12 May 2023, 13:32 I have always upgraded via source, and I did not copy over ZZZAAuto.pm since it is not in the upgrade instructions.
Hi,

Can you run the 6.5 migration script with --verbose as a parameter please, and post the output?

- 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 ?
sergiy
Znuny newbie
Posts: 17
Joined: 28 Oct 2021, 18:39
Znuny Version: 6.5.3
Real Name: Sergiy
Location: Halifax, NS

Re: Can't locate WebserviceText.pm in Znuny 6.5.2

Post by sergiy »

Your request has prompted me to re-run the migration steps from the 6.0.48 snapshot yet again. Contrary to my claim from before, running "bin/otrs.Console.pl Maint::Config::Rebuild --cleanup" removes the 'WebserviceText' section from ZZZAAuto.pm. I confirm that it appears in the file during the upgrade process, but then gets removed by the "Rebuild --cleanup". I am not sure why it did not work for me before.

Thanks to the suggested '--verbose', I discovered that Step 15 does not perform the cleanup because add-on packages are not deployed yet. Running the cleanup explicitly manually works fine even before the add-ons are deployed.

I have settled on this sequence then:

Code: Select all

$ scripts/MigrateToZnuny6_5.pl
$ bin/otrs.Console.pl Admin::Package::UpgradeAll
$ bin/otrs.Console.pl Maint::Config::Rebuild --cleanup
Here is the task execution output of MigrateToZnuny6_5.pl showing where it skips the cleanup:

Code: Select all


 Executing tasks ...

    Step 1 of 18: Check required Perl version ...
    Step 2 of 18: Check required database version ...
    Step 3 of 18: Check database charset ...
    Step 4 of 18: Check required Perl modules ...
    Step 5 of 18: Check if database has been backed up ...
    Step 6 of 18: Rebuild configuration ...
    Step 7 of 18: Migrate SysConfig settings ...
    Step 8 of 18: Migrate DBCRUD UUID columns ...
        Calendar::Plugin: Column dbcrud_uuid in table calendar_appointment_plugin...
            Column already exists
        OAuth2Token: Column dbcrud_uuid in table oauth2_token...
            Column already exists
        OAuth2TokenConfig: Column dbcrud_uuid in table oauth2_token_config...
            Column already exists
    Step 9 of 18: Migrate dynamic fields ...
    Step 10 of 18: Migrate notification events ...
    Step 11 of 18: Integrate Znuny-NoteToLinkedTicket ...
    Step 12 of 18: Uninstall merged packages ...
    Step 13 of 18: Initialize default cron jobs ...
    Step 14 of 18: Clean up the cache ...
    Step 15 of 18: Rebuild configuration another time ...

    Configuration cleanup was not possible as packages are not correctly deployed!

    If you see warnings about 'Subroutine Load redefined', that's fine, no need to worry!
    Step 16 of 18: Deploy ACLs ...
    Step 17 of 18: Deploy processes ...
    Step 18 of 18: Check invalid settings ...

 Migration completed!

Post Reply