[SOLVED] Calendar Overview does not display entries after migration

Moderator: crythias

Post Reply
cokev
Znuny newbie
Posts: 4
Joined: 17 Jun 2021, 18:39
Znuny Version: 5.0.20/6.0.35
Real Name: Kevin

[SOLVED] Calendar Overview does not display entries after migration

Post by cokev »

Hello fellow OTRS Admins,

since CentOS 6.9 is End-of-Life we tried to migrate our OTRS 5.0.20 installation to a fresh Debian 10 installation with the same version number. Everything works fine, except the CalendarOverview "index.pl?Action=AgentAppointmentCalendarOverview" does not show any of the entries. If we look into the Database, these entries are still there, adding new entries also works and the agent agenda list these items properly.

I threw on Firefox Developer Tools on the test-migration-vm and on the currently-in-production-vm and found a difference. When the site loads up, it does a POST request to the otrs server to get the calendar information as json. However, on the new installation, the same request returns the login page of the server.
agentappointmentlist-request.jpg
agentappointmentlist-response.jpg
We have two snapshots at the moment for trying this issue out, the current otrs 5.0.20 and a znuny 6.0.35 updated from the former.

I have several leads on this topic and might be able to get to the answer myself with a small nudge:
1. The perl module versions. The new VM is on Perl 5.28, the production VM is on Perl 5.10.1. The Calendar supposedly uses libdatetime-perl and libdatetime-timezone-perl which are installed. This could result in the relevant code to fail, but I cannot find any hint that perl code might be running into errors

2. The request for the AgentAppointmentList doesn't go through / it doesn't start the module.
I wanted to see if I could debug the module myself and resolve the version. To start off, I edited the file /opt/otrs/Kernel/Modules/AgendAppointmentList.pm and added log statements at the start of Run and New as a sanity check if these functions are relevant.

Code: Select all

# --
# Copyright (C) 2001-2021 xxx, https://otrs.com/
# Copyright (C) 2021 Znuny GmbH, https://znuny.org/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
# did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.
# --

package Kernel::Modules::AgentAppointmentList;

use strict;
use warnings;

use Kernel::System::VariableCheck qw(:all);

our $ObjectManagerDisabled = 1;

sub new {
    $Kernel::OM->Get('Kernel::System::Log')->Log(
        Priority => 'error',
        Message  => 'AgentAppointmentList::new started',
    );
    
    (...)
}

sub Run {

    $Kernel::OM->Get('Kernel::System::Log')->Log(
        Priority => 'error',
        Message  => 'AgentAppointmentList::run started',
    );

    (...)
Since only this package included perl-code for the Request relevant String like "ListAppointsments" I expected this module to be run when I cause the POST request like in the screenshot. And when it runs, it should log something, but if I go to index.pl?Action=AdminLog there is no entry with the given message.


The concrete questions I have right now are:
a) Where would be the settings that tells Znuny which requests are meant to run which .pm file?
b) The way I just edited the Kernel/Modules/AgentAppointmentList.pm, would that work in the first place, or do I have to do it differently?
c) Where can I see the required perl package versions / perl version for otrs5/ znuny6? otrs.CheckModules.pl returns OK for all packages on both versions.

Edit: I also already searched for similar help requests: viewtopic.php?f=62&t=40072 has the same origin os, but I mention more information here. There is also a german topic viewtopic.php?p=138425 that mentions clearing ZZZAuto.pm and incrementally adding the config back piecewise, but I do not know how that would apply to a Znuny 6 installation.
You do not have the required permissions to view the files attached to this post.
Last edited by cokev on 26 Jul 2021, 09:48, edited 1 time in total.
Znuny 6.0.35 on Debian 10 (currently migrating from OTRS 5.0.20)
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Calendar Overview does not display entries after migration

Post by root »

Hi,
cokev wrote: 18 Jun 2021, 12:25 The concrete questions I have right now are:
a) Where would be the settings that tells Znuny which requests are meant to run which .pm file?
b) The way I just edited the Kernel/Modules/AgentAppointmentList.pm, would that work in the first place, or do I have to do it differently?
c) Where can I see the required perl package versions / perl version for otrs5/ znuny6? otrs.CheckModules.pl returns OK for all packages on both versions.
to a) same as with all the other versions: scripts/apache2-httpd.include.conf. Just link to to /etc/apache2/conf-available/znuny.conf and enable if with a2enconf znuny.

to b) Sorry, but it looks like sth went wrong during the migration. One small question before continuing here: which database and version do you use?

to c) otrs/.CheckModules.pl does the job, you can add --all to get some more. Do you have the same result run this as root and the otrs user? if not what's the result of 'env|grep PERL'?

- 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 ?
cokev
Znuny newbie
Posts: 4
Joined: 17 Jun 2021, 18:39
Znuny Version: 5.0.20/6.0.35
Real Name: Kevin

Re: Calendar Overview does not display entries after migration

Post by cokev »

a) For prosperities sake I moved the existing apache2 sites to a backup and enabled the conf file you mentioned, as to remove a source of noise. It didn't change the behaviour.

b) Taken from the database prompt: Server version: 10.3.27-MariaDB-0+deb10u1 Debian 10

This is the current scheme of the calendar tables on the 6.0.35 migration-test-vm
calendar_scheme.png
c) The output doesn't differ between root and otrs

Code: Select all

  o Apache::DBI......................ok (v1.12)
  o Apache2::Reload..................ok (v0.13)
  o Archive::Tar.....................ok (v2.30)
  o Archive::Zip.....................ok (v1.64)
  o Crypt::Eksblowfish::Bcrypt.......ok (v0.009)
  o CSS::Minifier::XS................ok (v0.09)
  o Date::Format.....................ok (v2.24)
  o DateTime.........................ok (v1.54)
    o DateTime::TimeZone.............ok (v2.47)
  o DBI..............................ok (v1.642)
  o DBD::mysql.......................ok (v4.050)
  o DBD::ODBC........................ok (v1.60)
  o DBD::Oracle......................Not installed! (optional - Required to connect to a Oracle database.)
  o DBD::Pg..........................ok (v3.7.4)
  o Digest::SHA......................ok (v6.01)
  o Encode::HanExtra.................ok (v0.23)
  o IO::Socket::SSL..................ok (v2.060)
    Please consider updating to version 2.066 or higher: This version fixes email sending (bug#14357).
  o JavaScript::Minifier::XS.........ok (v0.11)
  o JSON::XS.........................ok (v3.04)
  o List::Util::XS...................ok (v1.50)
  o LWP::UserAgent...................ok (v6.53)
  o Mail::IMAPClient.................ok (v3.42)
    o IO::Socket::SSL................ok (v2.060)
    Please consider updating to version 2.066 or higher: This version fixes email sending (bug#14357).
    o Authen::SASL...................ok (v2.16)
    o Authen::NTLM...................Not installed! To install, you can use: 'apt-get install -y libauthen-ntlm-perl'. (optional - Required for NTLM authentication mechanism in IMAP connections.)
  o ModPerl::Util....................ok (v2.000010)
  o Moo..............................ok (v2.005004)
  o Net::DNS.........................ok (v1.19)
  o Net::LDAP........................ok (v0.65)
  o Net::SMTP........................ok (v3.11)
  o Template.........................ok (v2.27)
  o Template::Stash::XS..............ok (undef)
  o Text::CSV_XS.....................ok (v1.38)
  o Time::HiRes......................ok (v1.9759)
  o XML::LibXML......................ok (v2.0134)
  o XML::LibXSLT.....................ok (v1.96)
  o XML::Parser......................ok (v2.44)
  o YAML::XS.........................ok (v0.76)

Bundled modules:

  o Algorithm::Diff..................ok (v1.1903)
  o Apache::DBI......................ok (v1.12)
  o CGI..............................ok (v4.36)
  o CSS::Minifier....................ok (v0.01)
  o Class::Inspector.................ok (v1.31)
  o Crypt::PasswdMD5.................ok (v1.40)
  o Crypt::Random::Source............ok (v0.14)
  o Email::Valid.....................ok (v1.202)
  o Encode::Locale...................ok (v1.05)
  o Exporter::Tiny...................ok (v1.002001)
  o IO::Interactive..................ok (v1.022)
  o JSON.............................ok (v2.94)
  o JSON::PP.........................ok (v2.27203)
  o JavaScript::Minifier.............ok (v1.15)
  o LWP..............................ok (v6.53)
  o Linux::Distribution..............ok (v0.23)
  o Locale::Codes....................ok (v3.52)
  o MIME::Tools......................ok (v5.509)
  o Mail::Address....................ok (v2.18)
  o Mail::Internet...................ok (v2.18)
  o Math::Random::ISAAC..............ok (v1.004)
  o Math::Random::Secure.............ok (v0.080001)
  o Module::Find.....................ok (v0.15)
  o Module::Refresh..................ok (v0.17)
  o Moo..............................ok (v2.005004)
  o Mozilla::CA......................ok (v20200520)
  o Net::HTTP........................ok (v6.17)
  o Net::IMAP::Simple................ok (v1.2209)
  o Net::SSLGlue.....................ok (v1.058)
  o PDF::API2........................ok (v2.033)
  o SOAP::Lite.......................ok (v1.20)
Argument "v4" isn't numeric in sprintf at bin/otrs.CheckModules.pl line 876.
  o Sisimai..........................ok (vv4.25.11)
  o Sys::Hostname::Long..............ok (v1.5)
  o Text::CSV........................ok (v1.95)
  o Text::Diff.......................ok (v1.44)
  o Types::TypeTiny..................ok (v1.010000)
  o URI..............................ok (v1.71)
  o YAML.............................ok (v1.23)
  o namespace::clean.................ok (v0.27)
  o parent...........................ok (v0.236)

Code: Select all

root@otrs:~# env | grep PERL
root@otrs:~# su otrs
$ bash
otrs@otrs:/root$ env | grep PERL
otrs@otrs:/root$
You do not have the required permissions to view the files attached to this post.
Znuny 6.0.35 on Debian 10 (currently migrating from OTRS 5.0.20)
cokev
Znuny newbie
Posts: 4
Joined: 17 Jun 2021, 18:39
Znuny Version: 5.0.20/6.0.35
Real Name: Kevin

Re: Calendar Overview does not display entries after migration

Post by cokev »

Hi,

If I put the current OTRSAgentInterface=<SessionID> into the request, I can see per Log Statement that the AgentAppointmentList.pm gets called now and the JSON I receive appears to be well-formed and has data inside it.

I feel like our installation is supposed to be authorizing the POST request for AgentAppointmentList since a challenge token is being provided, at least that is how it is apparently handled on our live OTRS5.

I tried looking in the Loader registration but didnt find any version number for the js code.

Can someone tell me the parameters of the POST request on the AgentAppointmentCalendarOverview when a calendar is being turned on on Znuny6? In particular, whether or not ChallengeToken and OTRSAgentInterface are present, e.g. via Firefox Devtools

Push come to shove Im just gonna hotfix it locally by modifying the JS, since it must be working normally for other folks
Znuny 6.0.35 on Debian 10 (currently migrating from OTRS 5.0.20)
cokev
Znuny newbie
Posts: 4
Joined: 17 Jun 2021, 18:39
Znuny Version: 5.0.20/6.0.35
Real Name: Kevin

Re: Calendar Overview does not display entries after migration

Post by cokev »

I'm really embarassed by the solution we got in the end. So on one hand there is the """code fix""", on the other the issue resolved itself as soon as we around to giving it proper TLS certification. I think the whole "authorization not granted" was because Znuny refused to serve the JSON calendar data over HTTP only.

So I hope this wasn't in vain and someone else can be helped by this.
Znuny 6.0.35 on Debian 10 (currently migrating from OTRS 5.0.20)
Post Reply