TypeErrors after Upgrade to 6.3.4

Moderator: crythias

Post Reply
nltui
Znuny newbie
Posts: 33
Joined: 22 May 2015, 22:41
Znuny Version: 6.5.2
Real Name: Neil Thackeray
Company: Beckman Institute University of Illinois

TypeErrors after Upgrade to 6.3.4

Post by nltui »

I've run into some problems upgrading from Znuny 6.2.2 -> 6.3.4. Everything worked on my dev server, but when I tried to upgrade my production site I ran into problems. After the upgrade, I was unable to click or type on anything on the page. In the console I got the following javascript errors:

Code: Select all

Uncaught ReferenceError: jQuery is not defined
    at CommonJS_98438509d670bd6340016cff0bdc34ac.js:1:1
(anonymous) @ CommonJS_98438509d670bd6340016cff0bdc34ac.js:1
TranslationJS_en_337b25b35234c86543806f554be85340.js:2 
        
       Uncaught TypeError: Cannot read properties of undefined (reading 'Load')
    at TranslationJS_en_337b25b35234c86543806f554be85340.js:2:15
(anonymous) @ TranslationJS_en_337b25b35234c86543806f554be85340.js:2
TemplateJS_57d9e599885d0ba4a1f205ab57be0b2c.js:2 
        
       Uncaught TypeError: Cannot read properties of undefined (reading 'Load')
    at TemplateJS_57d9e599885d0ba4a1f205ab57be0b2c.js:2:15
(anonymous) @ TemplateJS_57d9e599885d0ba4a1f205ab57be0b2c.js:2
ModuleJS_b8326a59b24d73684d6ebc2489c6977d.js:14 
        
       Uncaught TypeError: Cannot read properties of undefined (reading 'RegisterNamespace')
    at ModuleJS_b8326a59b24d73684d6ebc2489c6977d.js:14:103
    at ModuleJS_b8326a59b24d73684d6ebc2489c6977d.js:14:161
(anonymous) @ ModuleJS_b8326a59b24d73684d6ebc2489c6977d.js:14
(anonymous) @ ModuleJS_b8326a59b24d73684d6ebc2489c6977d.js:14
index.pl:257 
        
       Uncaught TypeError: Cannot read properties of undefined (reading 'ExecuteInit')
    at index.pl:257:11
(anonymous) @ index.pl:257
index.pl:276 
        
       Uncaught TypeError: Core.App.Ready is not a function
    at index.pl:276:10
(anonymous) @ index.pl:276
index.pl:288 
        
       Uncaught TypeError: Core.App.Ready is not a function
    at index.pl:288:10
(anonymous) @ index.pl:288
I know this error indicates an unassigned variable, but not knowing the code I'm not sure where it's coming from. Running './otrs.Console.pl Maint::Config::Rebuild' didn't seem to do anything.

I have reverted to a snapshot because we need our ticketing system.
OS: Debian GNU/Linux 11 (bullseye)
Znuny Ver: 6.2.2
Web Server: Apache2
Johannes
Moderator
Posts: 393
Joined: 30 Jan 2008, 02:26
Znuny Version: All of them ^^
Real Name: Hannes
Company: Znuny|OTTERHUB

Re: TypeErrors after Upgrade to 6.3.4

Post by Johannes »

Hi,

please run otrs.Console.pl Maint::Config::Rebuild --cleanup
and also clean your browser cache.
This should resolve the issue.

Regards
Murphy
Znuny newbie
Posts: 7
Joined: 17 Oct 2022, 13:40
Znuny Version: 6.2.2
Real Name: Martin Svec
Company: CloverDX

Re: TypeErrors after Upgrade to 6.3.4

Post by Murphy »

Hi,
I have similar problem after update from 6.2.2 to 6.3.4 in browser console

Code: Select all

Uncaught ReferenceError: jQuery is not defined
    <anonymous> https://znuny.example.com/otrs-web/js/js-cache/CommonJS_97e160ba3f85fc413a3c5f153ad0e9fd.js:1
CommonJS_97e160ba3f85fc413a3c5f153ad0e9fd.js:1:1
Uncaught TypeError: Core.Language is undefined
    <anonymous> https://znuny.example.com/otrs-web/js/js-cache/TranslationJS_en_9728b22204307208fa20088cf2f9e68c.js:2
TranslationJS_en_9728b22204307208fa20088cf2f9e68c.js:2:1
Uncaught TypeError: Core.Template is undefined
    <anonymous> https://znuny.example.com/otrs-web/js/js-cache/TemplateJS_b3d854d6e9e2610703cdb9a2bb084ee4.js:2
TemplateJS_b3d854d6e9e2610703cdb9a2bb084ee4.js:2:1
Uncaught TypeError: Core.Init is undefined
    Login https://znuny.example.com/otrs-web/js/js-cache/ModuleJS_be48347554e234e7644f204dd8fdab50.js:14
    <anonymous> https://znuny.example.com/otrs-web/js/js-cache/ModuleJS_be48347554e234e7644f204dd8fdab50.js:14
ModuleJS_be48347554e234e7644f204dd8fdab50.js:14:93
Uncaught TypeError: Core.Init is undefined
    <anonymous> https://znuny.example.com/otrs/index.pl?Action=Admin:222
index.pl:222:1
Uncaught TypeError: Core.App.Ready is not a function
    <anonymous> https://znuny.example.com/otrs/index.pl?Action=Admin:241
index.pl:241:10
Uncaught TypeError: Core.App.Ready is not a function
    <anonymous> https://znuny.example.com/otrs/index.pl?Action=Admin:253
I tried to delete browser and znuny cache ( otrs.Console.pl Maint::Config::Rebuild --cleanup), restart VM.
Any ideas on what to do next?

Code: Select all

/opt/otrs/bin/otrs.CheckModules.pl --all
  o Apache::DBI......................ok (v1.12)
  o Apache2::Reload..................ok (v0.13)
  o Archive::Tar.....................ok (v2.28)
  o Archive::Zip.....................ok (v1.30)
  o Authen::SASL.....................ok (v2.16)
  o Crypt::Eksblowfish::Bcrypt.......ok (v0.009)
  o CSS::Minifier::XS................ok (v0.09)
  o Data::UUID.......................ok (v1.226)
  o Date::Format.....................ok (v2.24)
  o DateTime.........................ok (v1.55)
    o DateTime::TimeZone.............ok (v2.51)
  o DBI..............................ok (v1.627)
  o DBD::mysql.......................ok (v4.033)
  o DBD::ODBC........................Not installed! (optional - Required to connect to a MS-SQL database.)
  o DBD::Oracle......................Not installed! (optional - Required to connect to a Oracle database.)
  o DBD::Pg..........................Not installed! To install, you can use: 'yum install "perl(DBD::Pg)"'. (optional - Required to connect to a PostgreSQL database.)
  o Digest::SHA......................ok (v5.85)
  o Encode::HanExtra.................ok (v0.23)
  o Excel::Writer::XLSX..............ok (v0.95)
  o Hash::Merge......................Not installed! To install, you can use: 'yum install "perl(Hash::Merge)"'. (optional - Required for the creation of Excel statistical reports.)
  o IO::Socket::SSL..................ok (v2.027)
    Please consider updating to version 2.066 or higher: This version fixes email sending (bug#14357).
  o JavaScript::Minifier::XS.........ok (v0.09)
  o Jq...............................Not installed! To install, you can use: 'yum install "perl(Jq)"'. (optional - Support for extended condition checking via Jq for the generic interface.)
  o JSON::XS.........................ok (v3.01)
  o List::Util::XS...................ok (v1.60)
  o LWP::UserAgent...................ok (v6.53)
  o Mail::IMAPClient.................ok (v3.37)
    o IO::Socket::SSL................ok (v2.027)
    Please consider updating to version 2.066 or higher: This version fixes email sending (bug#14357).
    o Authen::NTLM...................ok (v1.09)
  o ModPerl::Util....................ok (v2.000011)
  o Moo..............................ok (v2.004004)
  o Net::DNS.........................ok (v1.07)
  o Net::LDAP........................ok (v0.56)
  o Net::SMTP........................ok (v2.31)
    Please consider updating to version 3.11 or higher: This version fixes email sending (bug#14357).
  o Spreadsheet::XLSX................Not installed! To install, you can use: 'yum install "perl(Spreadsheet::XLSX)"'. (optional - Spreadsheet::XLSX enables import and export of Excel files in certain dialogs.)
  o Template.........................ok (v2.25)
  o Template::Stash::XS..............ok (undef)
  o Text::Diff::FormattedHTML........ok (v0.08)
  o Text::CSV_XS.....................ok (v1.25)
  o Time::HiRes......................ok (v1.9725)
  o XML::LibXML......................ok (v2.0122)
  o XML::LibXSLT.....................ok (v1.80)
  o XML::Parser......................ok (v2.46)
  o YAML::XS.........................ok (v0.83)

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.004004)
  o Mozilla::CA......................ok (v20211001)
  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)
  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)

Johannes
Moderator
Posts: 393
Joined: 30 Jan 2008, 02:26
Znuny Version: All of them ^^
Real Name: Hannes
Company: Znuny|OTTERHUB

Re: TypeErrors after Upgrade to 6.3.4

Post by Johannes »

Question:
https://znuny.example.com/

this is really your FQDN? You can resolve this in your local network?
Murphy
Znuny newbie
Posts: 7
Joined: 17 Oct 2022, 13:40
Znuny Version: 6.2.2
Real Name: Martin Svec
Company: CloverDX

Re: TypeErrors after Upgrade to 6.3.4

Post by Murphy »

Hi Johannes,
thanks for reply. I changed my real FQDN to znuny.example.org in log before posting here.
skullz
Znuny superhero
Posts: 621
Joined: 24 Feb 2012, 03:58
Znuny Version: LTS and Features
Real Name: Mo Azfar
Location: Kuala Lumpur, MY
Contact:

Re: TypeErrors after Upgrade to 6.3.4

Post by skullz »

I would do.

1. Cache cleanup via otrs.Cosole.pl

2. Cache generate via otrs.Console.pl

3. Check system configuration for jquery registration..compare the registered version in configuration and filesystem..it should match
Murphy
Znuny newbie
Posts: 7
Joined: 17 Oct 2022, 13:40
Znuny Version: 6.2.2
Real Name: Martin Svec
Company: CloverDX

Re: TypeErrors after Upgrade to 6.3.4

Post by Murphy »

Hi skullz,
1. do you mean ./otrs.Console.pl Maint::Cache::Delete ? I tried it, but without success. (Clean cache and restart VM (for sure), clean cache in anonymous browser mode, another browser, regenerate config)
2. I don't know how to (re)generate cache. I can't see any usable option in help.

Code: Select all

Maint
 Maint::Cache::Delete                                                    - Delete cache files created by OTRS.
 Maint::Calendar::Ticket::Cleanup                                  - Cleanup obsolete calendar based ticket creation data.
3. It looks like versions are the same - jquerry-3.6.0
skullz
Znuny superhero
Posts: 621
Joined: 24 Feb 2012, 03:58
Znuny Version: LTS and Features
Real Name: Mo Azfar
Location: Kuala Lumpur, MY
Contact:

Re: TypeErrors after Upgrade to 6.3.4

Post by skullz »

Murphy wrote: 21 Oct 2022, 09:25 Hi skullz,
1. do you mean ./otrs.Console.pl Maint::Cache::Delete ? I tried it, but without success. (Clean cache and restart VM (for sure), clean cache in anonymous browser mode, another browser, regenerate config)
2. I don't know how to (re)generate cache. I can't see any usable option in help.

Code: Select all

Maint
 Maint::Cache::Delete                                                    - Delete cache files created by OTRS.
 Maint::Calendar::Ticket::Cleanup                                  - Cleanup obsolete calendar based ticket creation data.
3. It looks like versions are the same - jquerry-3.6.0
If im correct,

Code: Select all

/opt/otrs/bin/otrs.Console.pl Maint::Loader::CacheCleanup
/opt/otrs/bin/otrs.Console.pl Maint::Loader::CacheGenerate
root
Administrator
Posts: 3961
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: TypeErrors after Upgrade to 6.3.4

Post by root »

Hi Neil,

I recommend disabling the Javascript loader via shell:

bin/otrs.Console.pl Admin::Config::Update --setting-name Loader::Enabled::JS --value 0

Then use a clean browser and load the page. With the browser console, you will see which files can't be loaded, there is probably a 404 file not found to see.

Knowing this file is required to find the setting to fix.

- 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 ?
Murphy
Znuny newbie
Posts: 7
Joined: 17 Oct 2022, 13:40
Znuny Version: 6.2.2
Real Name: Martin Svec
Company: CloverDX

Re: TypeErrors after Upgrade to 6.3.4

Post by Murphy »

Hi Roy,
you are absolutely right! I got 404 error after disabling JS.
(NOTE: real domain name from log changed to example.org)

Code: Select all

GET https://znuny.example.org/otrs-web/js/thirdparty/jquery-3.5.1/jquery.js [HTTP/2 404 Not Found 15ms]
GET https://znuny.example.org/otrs-web/js/thirdparty/jquery-ui-1.12.1/jquery-ui.js [HTTP/2 404 Not Found 16ms]
GET https://znuny.example.org/otrs-web/js/thirdparty/nunjucks-3.0.1/nunjucks.js [HTTP/2 404 Not Found 40ms]
When I list third-party plugins, I have newer versions of the JQ libraries. I have tried running /opt/otrs/scripts/MigrateToZnuny6_3.pl several times. Could there be a bug in the migration script?

Code: Select all

ls /opt/otrs/var/httpd/htdocs/js/thirdparty/ -1
canvg-1.4
ckeditor-4.17.1
clipboardjs-1.7.1
d3-3.5.6
farahey-0.5
fullcalendar-3.10.2
fullcalendar-scheduler-1.10.1
jquery-3.6.0
jquery-browser-detection
jquery-jstree-3.3.7
jquery-migrate-3.0.0
jquery-pubsub
jquery-tablesorter-2.28.14
jquery-ui-1.13.1
jquery-ui-touch-punch-0.2.3
jquery-validate-1.16.0
jscolor-2.4.6
jsplumb-1.6.4
jsplumb-labelspacer
momentjs-2.29.1
nunjucks-3.2.2
nvd3-1.7.1
qunit-2.3.3
spectrum-1.8.1
StringView-8
Murphy
Znuny newbie
Posts: 7
Joined: 17 Oct 2022, 13:40
Znuny Version: 6.2.2
Real Name: Martin Svec
Company: CloverDX

Re: TypeErrors after Upgrade to 6.3.4

Post by Murphy »

skullz wrote: 21 Oct 2022, 10:07 If im correct,

Code: Select all

/opt/otrs/bin/otrs.Console.pl Maint::Loader::CacheCleanup
/opt/otrs/bin/otrs.Console.pl Maint::Loader::CacheGenerate
Sorry, my mistake. I looked only in Maint::Cache::
Maint::Loader:: is new for me. Thank you.
It looks like my problem is in wrong js libs versions as you mentioned in point 3 your first post. I searched in config files, but I didn't find any references to older versions of libs. Maybe is something in DB.
root
Administrator
Posts: 3961
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: TypeErrors after Upgrade to 6.3.4

Post by root »

Murphy wrote: 21 Oct 2022, 16:39

Code: Select all

GET https://znuny.example.org/otrs-web/js/thirdparty/jquery-3.5.1/jquery.js [HTTP/2 404 Not Found 15ms]
GET https://znuny.example.org/otrs-web/js/thirdparty/jquery-ui-1.12.1/jquery-ui.js [HTTP/2 404 Not Found 16ms]
GET https://znuny.example.org/otrs-web/js/thirdparty/nunjucks-3.0.1/nunjucks.js [HTTP/2 404 Not Found 40ms]
Hi,

This means you have settings which does not match the default and therefor the new values does not apply.
Solution:

Save your file Kernel/Config/Files/ZZZAAuto.pm and then

search for jquery-3.5.1 and jquery-ui-1.12.1 and nunjucks-3.0.1 in Kernel/Config/Files/ZZZAAuto.pm

For every match, I would reset the setting via the command line.

Example:

Code: Select all

znuny@host grep -B5 jquery-ui-1.12.1 Kernel/Config.pm
$Self->{'Loader::Agent::CommonJS'}->{'000-Framework'} =  [
  'thirdparty/jquery-3.5.1/jquery.js',
  'thirdparty/jquery-browser-detection/jquery-browser-detection.js',
  'thirdparty/jquery-ui-1.12.1/jquery-ui.js',
  'thirdparty/jquery-ui-touch-punch-0.2.3/jquery.ui.touch-punch.js',

znuny@host bin/otrs.Console.pl Admin::Config::Update --setting-name 'Loader::Agent::CommonJS###000-Framework' --reset
'Loader::Agent::CommonJS'}->{'000-Framework' becomes 'Loader::Agent::CommonJS###000-Framework'
The last step is checking with your file copy what changed and why. Reapply the changes if needed or leave the default.

- 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 ?
Murphy
Znuny newbie
Posts: 7
Joined: 17 Oct 2022, 13:40
Znuny Version: 6.2.2
Real Name: Martin Svec
Company: CloverDX

Re: TypeErrors after Upgrade to 6.3.4

Post by Murphy »

Hi Roy,
you're great! It's working! Just this two commands is enough to update all three packages versions in the ZZZAAuto.pm file

Code: Select all

znuny@host bin/otrs.Console.pl Admin::Config::Update --setting-name 'Loader::Agent::CommonJS###000-Framework' --reset
znuny@host bin/otrs.Console.pl Admin::Config::Update --setting-name 'Loader::Customer::CommonJS###000-Framework' --reset
May I revert the JS loader settings back? E.g.

Code: Select all

bin/otrs.Console.pl Admin::Config::Update --setting-name Loader::Enabled::JS --value 1
Thank you one again Roy.
Martin
Post Reply