FindBin.pm problem in Docker - OTRS 5.0.42

Moderator: crythias

Locked
titus
Znuny newbie
Posts: 2
Joined: 28 Apr 2021, 11:02
Znuny Version: 5.0.42
Real Name: Jens

FindBin.pm problem in Docker - OTRS 5.0.42

Post by titus »

Hi all,

I've searched a lot about this problem and found only some very old topics - but no solution.

I'm trying to run OTRS 5.0.42 in a Docker container based on "httpd" (Apache 2.4 / Debian Buster). The main reason is that our Server has a too old perl version for updating to Znuny 6, so I hoped to make a transition to Znuny possible by dockerizing it.

The code of OTRS (copied from our production system) is inserted via ADD in Dockerfile to /opt/otrs and SetPermissions.pl is run. CheckModules showed that all Perl-modules are successfully installed. Running index.pl via shell (both as user otrs and "daemon" (webserver)) successfully returns the HTML of the login page.

But when I call it via webserver I'll get an error 500 in the apache-logs showing this message:

Code: Select all

[:error] [pid 12:tid 139884073256704] Cannot find current script '/opt/' at /usr/share/perl/5.28/FindBin.pm line 166.
BEGIN failed--compilation aborted at /usr/share/perl/5.28/FindBin.pm line 166.
Compilation failed in require at /opt/otrs/bin/cgi-bin/index.pl line 23.
BEGIN failed--compilation aborted at /opt/otrs/bin/cgi-bin/index.pl line 23.
Any ideas how I can solve this?

Thanks in advance,
Titus
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: FindBin.pm problem in Docker - OTRS 5.0.42

Post by reneeb »

Did you copy the apache2 config for OTRS?
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
titus
Znuny newbie
Posts: 2
Joined: 28 Apr 2021, 11:02
Znuny Version: 5.0.42
Real Name: Jens

Re: FindBin.pm problem in Docker - OTRS 5.0.42

Post by titus »

Sorry, forgot to mention this. Yes, I've copied the scripts/apache2-httpd.include.conf to /usr/local/apache2/conf/otrs5.conf and included it in the httpd.conf:

Code: Select all

Include /usr/local/apache2/conf/otrs5.conf
nedmaj
Znuny expert
Posts: 168
Joined: 26 Nov 2014, 20:34
Znuny Version: 6.3.4
Real Name: Samuel Casimiro
Company: Câmara dos Deputados
Contact:

Re: FindBin.pm problem in Docker - OTRS 5.0.42

Post by nedmaj »

Hi,

I know this an old post, but got this problem recently when trying the same thing, e.g., run an old OTRS 5 inside a container.

Since this post doesn't have any solution [yet], here's some maybe useful info.

Newer installations of httpd and mod_perl are not fully compatible with the old scripts/apache2-perl-startup.pl script. I suggest use a newer OTRS startup script. In my case, was enough to adjust line below (39) from:

Code: Select all

    if ( !-e $0) {
to:

Code: Select all

    if ( !-e $0 || -d $0 ) {
I'm now successfully running OTRS 5 using a httpd:2.4-bookworm image.

Hope this helps someone else!
Samuel

Znuny 6.3.4 | OTRS 5.0.17
OS: Debian 11 | CentOS 6.5
Database: Postgres | Oracle 12.1
Number of agents: 450 | Number of customers: 20000 | Number of CIs: 30000
Locked