juanluisbaptiste / docker-otrs

The unofficial Znuny/OTRS Ticketing System docker image
https://www.juanbaptiste.tech/category/otrs
GNU Lesser General Public License v3.0
172 stars 101 forks source link

Container not starting (fresh build) #97

Closed gslongo closed 4 years ago

gslongo commented 4 years ago

Reporting a bug First of all, this is not a problem reporting forum, only report if you are pretty sure what you are experiencing is a bug with this image and docker, not a configuration issue of OTRS, for that you can go to the OTRS community forums.

If the container starts up, you can login and don't have any issues with the stuff you configured on the .env file, then the problem probably is in OTRS.

Also be sure you are using the latest image by doing docker pull juanluisbaptiste/otrs.

Image and OTRS versions latest

Please include the contents of:

Describe the issue

otrs_1     | AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.18.0.4. Set the 'ServerName' directive globally to suppress this message
otrs_1     | [Tue Aug 11 11:04:33.659017 2020] [perl:error] [pid 130] Can't locate Apache/DBI.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs/ /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /etc/httpd) at /opt/otrs/scripts/apache2-perl-startup.pl line 51.\nBEGIN failed--compilation aborted at /opt/otrs/scripts/apache2-perl-startup.pl line 51.\nCompilation failed in require at (eval 2) line 1.\n
otrs_1     | [Tue Aug 11 11:04:33.659188 2020] [perl:error] [pid 130] Can't load Perl file: /opt/otrs/scripts/apache2-perl-startup.pl for server 172.18.0.4:0, exiting...
otrs_1     | 2020-08-11 11:04:33,661 INFO exited: httpd (exit status 1; not expected)
otrs_1     | 2020-08-11 11:04:34,663 INFO gave up: httpd entered FATAL state, too many start retries too quickly
otrs_1     | Aug 11 11:05:01 b56963b293d9 CROND[132]: (otrs) CMD ($HOME/bin/otrs.Daemon.pl start >> /dev/null)
otrs_1     | Aug 11 11:05:01 b56963b293d9 CROND[131]: (otrs) CMDOUT (Can't locate Kernel/System/ObjectManager.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /opt/otrs//bin/otrs.Daemon.pl line 33.)
otrs_1     | Aug 11 11:05:01 b56963b293d9 CROND[131]: (otrs) CMDOUT (BEGIN failed--compilation aborted at /opt/otrs//bin/otrs.Daemon.pl line 33.)

Expected behavior Container web to start

Screenshots If applicable, add screenshots to help explain your problem.

gslongo commented 4 years ago

After manually adding some dependencies in the container

yum install perl-Apache-DBI.noarch perl-IO-Interactive.noarch

I get this and error 500 when I try to reach the Interface :

otrs_1     | Can't locate Kernel/System/ObjectManager.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /opt/otrs/bin/otrs.Daemon.pl line 33.
otrs_1     | BEGIN failed--compilation aborted at /opt/otrs/bin/otrs.Daemon.pl line 33.
otrs_1     | Can't locate Kernel/System/ObjectManager.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /opt/otrs/bin/otrs.Console.pl line 28.
otrs_1     | BEGIN failed--compilation aborted at /opt/otrs/bin/otrs.Console.pl line 28.
otrs_1     | Can't locate Kernel/System/ObjectManager.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /opt/otrs/bin/otrs.Console.pl line 28.
otrs_1     | BEGIN failed--compilation aborted at /opt/otrs/bin/otrs.Console.pl line 28.
otrs_1     | [INFO] Swtiching Article Storage Type to: ArticleStorageDB ...
otrs_1     | Can't locate Kernel/System/ObjectManager.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /opt/otrs/bin/otrs.Console.pl line 28.
otrs_1     | BEGIN failed--compilation aborted at /opt/otrs/bin/otrs.Console.pl line 28.
otrs_1     | ./functions.sh: line 599: [: !=: unary operator expected
otrs_1     | [INFO] Current Article storage type already configured to: ArticleStorageDB
otrs_1     | [INFO] Starting supervisord...
otrs_1     | [INFO] Restarting OTRS daemon...
otrs_1     | Can't locate Kernel/System/ObjectManager.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /opt/otrs/bin/otrs.Daemon.pl line 33.
otrs_1     | BEGIN failed--compilation aborted at /opt/otrs/bin/otrs.Daemon.pl line 33.
otrs_1     | /usr/lib/python2.7/site-packages/supervisor/options.py:461: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
otrs_1     |   'Supervisord is running as root and it is searching '
otrs_1     | 2020-08-11 11:20:23,385 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
otrs_1     | 2020-08-11 11:20:23,385 INFO Included extra file "/etc/supervisord.d/otrs.ini" during parsing
otrs_1     | Unlinking stale socket /var/run/supervisor/supervisor.sock
otrs_1     | 2020-08-11 11:20:23,732 INFO RPC interface 'supervisor' initialized
otrs_1     | 2020-08-11 11:20:23,732 CRIT Server 'unix_http_server' running without any HTTP authentication checking
otrs_1     | 2020-08-11 11:20:23,733 INFO supervisord started with pid 44
otrs_1     | 2020-08-11 11:20:24,737 INFO spawned: 'httpd' with pid 50
otrs_1     | 2020-08-11 11:20:24,740 INFO spawned: 'crond' with pid 51
otrs_1     | 2020-08-11 11:20:24,744 INFO spawned: 'rsyslog' with pid 52
otrs_1     | rsyslogd: pidfile '/var/run/syslogd.pid' and pid 52 already exist.
otrs_1     | If you want to run multiple instances of rsyslog, you need to specify
otrs_1     | different pid files for them (-i option).
otrs_1     | rsyslogd: run failed with error -3000 (see rsyslog.h or try http://www.rsyslog.com/e/3000 to learn what that number means)
otrs_1     | 2020-08-11 11:20:24,764 INFO exited: rsyslog (exit status 1; not expected)
otrs_1     | AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.19.0.4. Set the 'ServerName' directive globally to suppress this message
otrs_1     | [Tue Aug 11 11:20:25.095444 2020] [suexec:notice] [pid 50] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
otrs_1     | AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.19.0.4. Set the 'ServerName' directive globally to suppress this message
otrs_1     | [Tue Aug 11 11:20:25.363310 2020] [lbmethod_heartbeat:notice] [pid 50] AH02282: No slotmem from mod_heartmonitor
otrs_1     | [Tue Aug 11 11:20:25.368929 2020] [mpm_prefork:notice] [pid 50] AH00163: Apache/2.4.6 (CentOS) mod_perl/2.0.11 Perl/v5.16.3 configured -- resuming normal operations
otrs_1     | [Tue Aug 11 11:20:25.368958 2020] [core:notice] [pid 50] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
otrs_1     | Can't locate Kernel/System/ObjectManager.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /opt/otrs/bin/otrs.Daemon.pl line 33.
otrs_1     | BEGIN failed--compilation aborted at /opt/otrs/bin/otrs.Daemon.pl line 33.
otrs_1     | [INFO] OTRS Ready !
otrs_1     | 2020-08-11 11:20:26,370 INFO success: httpd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
otrs_1     | 2020-08-11 11:20:26,370 INFO success: crond entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
otrs_1     | 2020-08-11 11:20:26,373 INFO spawned: 'rsyslog' with pid 61
otrs_1     | 2020-08-11 11:20:27,375 INFO success: rsyslog entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
otrs_1     | [Tue Aug 11 11:20:58.379754 2020] [:error] [pid 57] Can't locate Kernel/System/Web/InterfaceInstaller.pm in @INC (@INC contains: /usr/sbin/../../Custom /usr/sbin/../../Kernel/cpan-lib /usr/sbin/../.. /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs/ /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /etc/httpd) at /opt/otrs/bin/cgi-bin/installer.pl line 31.\nBEGIN failed--compilation aborted at /opt/otrs/bin/cgi-bin/installer.pl line 31.\n
otrs_1     | 192.168.101.234 - - [11/Aug/2020:11:20:58 +0200] "GET /otrs/installer.pl HTTP/1.1" 500 527 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
otrs_1     | 192.168.101.234 - - [11/Aug/2020:11:20:58 +0200] "GET /favicon.ico HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
otrs_1     | [Tue Aug 11 11:20:59.392906 2020] [:error] [pid 59] Can't locate Kernel/System/Web/InterfaceInstaller.pm in @INC (@INC contains: /usr/sbin/../../Custom /usr/sbin/../../Kernel/cpan-lib /usr/sbin/../.. /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs/ /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /etc/httpd) at /opt/otrs/bin/cgi-bin/installer.pl line 31.\nBEGIN failed--compilation aborted at /opt/otrs/bin/cgi-bin/installer.pl line 31.\n
otrs_1     | 192.168.101.234 - - [11/Aug/2020:11:20:59 +0200] "GET /otrs/installer.pl HTTP/1.1" 500 527 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
otrs_1     | 192.168.101.234 - - [11/Aug/2020:11:20:59 +0200] "GET /favicon.ico HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
juanluisbaptiste commented 4 years ago

Hi, sorry for the late reply.

It seems the fix for issue #95 broke clean install, I thought I had tested this case but it seems not.

I will work on a fix ASAP.

juanluisbaptiste commented 4 years ago

Fixed, new images pushed and will be available shortly.

gslongo commented 3 years ago

Hi,

Thank you for your answser.

There is still missing packages in the image built using the Dockerfile : perl-Apache-DBI.noarch perl-IO-Interactive.noarch

OTRS does not starts without these

Also it seems the error is still present in the latest image :


otrs_1     | 192.168.101.223 - - [28/Aug/2020:16:53:35 +0200] "GET /otrs/index.pl HTTP/1.1" 500 527 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0"
otrs_1     | [Fri Aug 28 16:53:35.212336 2020] [:error] [pid 95] Can't locate Kernel/System/Web/InterfaceAgent.pm in @INC (@INC contains: /usr/sbin/../../Custom /usr/sbin/../../Kernel/cpan-lib /usr/sbin/../.. /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs/ /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /etc/httpd) at /opt/otrs/bin/cgi-bin/index.pl line 32.\nBEGIN failed--compilation aborted at /opt/otrs/bin/cgi-bin/index.pl line 32.\n
otrs_1     | 192.168.101.223 - - [28/Aug/2020:16:53:35 +0200] "GET /favicon.ico HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0"
otrs_1     | 192.168.101.223 - - [28/Aug/2020:16:53:41 +0200] "GET /otrs HTTP/1.1" 404 202 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0"
otrs_1     | [Fri Aug 28 16:53:45.124111 2020] [:error] [pid 96] Can't locate Kernel/System/Web/InterfaceAgent.pm in @INC (@INC contains: /usr/sbin/../../Custom /usr/sbin/../../Kernel/cpan-lib /usr/sbin/../.. /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs/ /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /etc/httpd) at /opt/otrs/bin/cgi-bin/index.pl line 32.\nBEGIN failed--compilation aborted at /opt/otrs/bin/cgi-bin/index.pl line 32.\n
otrs_1     | 192.168.101.223 - - [28/Aug/2020:16:53:45 +0200] "GET /otrs/ HTTP/1.1" 500 527 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0"
otrs_1     | [Fri Aug 28 16:53:50.885553 2020] [:error] [pid 93] Can't locate Kernel/System/Web/InterfaceInstaller.pm in @INC (@INC contains: /usr/sbin/../../Custom /usr/sbin/../../Kernel/cpan-lib /usr/sbin/../.. /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs/ /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /etc/httpd) at /opt/otrs/bin/cgi-bin/installer.pl line 31.\nBEGIN failed--compilation aborted at /opt/otrs/bin/cgi-bin/installer.pl line 31.\n
otrs_1     | 192.168.101.223 - - [28/Aug/2020:16:53:50 +0200] "GET /otrs/installer.pl HTTP/1.1" 500 527 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0"

Files are not present at all in the container :

[root@ef8c049f6867 /]#
[root@ef8c049f6867 /]# find / -name InterfaceInstaller.pm
[root@ef8c049f6867 /]# find / -name InterfaceAgent.pm
[root@ef8c049f6867 /]#
juanluisbaptiste commented 3 years ago

Hi @gslongo ,

I don't know what you are doing wrong but the latest image works fine. I just started a clean install with no issues, and I also see that file on the image:

sh-4.2# find / -name InterfaceInstaller.pm
/opt/otrs/Kernel/System/Web/InterfaceInstaller.pm
sh-4.2# 
juanluisbaptiste commented 3 years ago

@gslongo pelase post your .env file. Are you doing any modifications to the image ?

gslongo commented 3 years ago

Thank you for your answer. The modification I did to the image is to add missing dependencies.

diff --git a/otrs/Dockerfile b/otrs/Dockerfile
index a9091df..6715cb6 100644
--- a/otrs/Dockerfile
+++ b/otrs/Dockerfile
@@ -15,7 +15,7 @@ RUN yum install -y yum-plugin-fastestmirror && \
     yum install -y epel-release && \
     yum -y install https://harbottle.gitlab.io/epmel/7/x86_64/epmel-release.rpm && \
     yum update -y && \
-    yum -y install bzip2 cronie httpd mysql mod_perl \
+    yum -y install bzip2 cronie httpd mysql mod_perl perl-Apache-DBI.noarch perl-IO-Interactive.noarch \
     perl-core "perl(Crypt::SSLeay)" "perl(Net::LDAP)" "perl(URI)" \
     procmail "perl(Date::Format)" "perl(LWP::UserAgent)" \
     "perl(Net::DNS)" "perl(IO::Socket::SSL)" "perl(XML::Parser)" \

I also did a fresh install (removing images, containers, volumes (also local volumes in volumes/ folder of docker-compose dir)... + docker system prune)

Here is my env file :

#####################################
# Database Configuration
#####################################

# Name of database to use. Default is otrs.
#OTRS_DB_NAME=otrs

# Hostname or IP address of the database server. Default is mariadb.
#OTRS_DB_HOST=otrs-mariadb

# Port of the database server. Default is 3306.
#OTRS_DB_PORT=3306

# Database user. Default is otrs.
#OTRS_DB_USER=otrs

# otrs user database password. Default password is changeme
OTRS_DB_PASSWORD=xxxxxxxxxxxxx

# Database root user so it can be setup. Default user is root.
MYSQL_ROOT_USER=root

# Database root password so it can be setup. Default password is changeme.
MYSQL_ROOT_PASSWORD=xxxxxxxxxxxxxxxx

# Path to the docker secret file inside the container.
#OTRS_SECRETS_FILE=

#####################################
# OTRS Configuration
#####################################

# Container startup mode, possible values:
#   - no      : Starts OTRS ready to be configured.
#   - yes     : Runs the OTRS installer.
#   - restore : Restores the backup specified by OTRS_BACKUP_DATE environment variable. Please check the README file for details.
#OTRS_INSTALL=no

#OTRS_BACKUP_DATE=

# On backup restore it drops the otrs database it if already exists (by default the container will fail if the database already exists).
# OTRS_DROP_DATABASE=no

# Set the cron backup time. Default is to run daily at 6am.
# Set it to "disable" to disable automated backups
OTRS_BACKUP_TIME="0 6 * * *"

# Change the backup script that gets called from cron
#OTRS_CRON_BACKUP_SCRIPT="/etc/cron.d/otrs_backup_custom"

# Change the article storage type (ArticleStorageDB|ArticleStorageFS). Default is ArticleStorageDB.
#OTRS_ARTICLE_STORAGE_TYPE=ArticleStorageDB

# Set the backup type (fullbackup|nofullbackup|dbonly). Default is full backup.
OTRS_BACKUP_TYPE="fullbackup"

# Set the backup compression method (gzip|bzip2). Default is gzip format.
#OTRS_BACKUP_COMRESSION="gzip"

# Set backup rotation days. Default is 30 days.
#OTRS_BACKUP_ROTATION="30"

# root@localhost user password. Default password is changeme
OTRS_ROOT_PASSWORD=xxxxxxxxxxxx

# Sets the container's hostname (auto-generated if not defined).
OTRS_HOSTNAME=otrs-tms

# Set the default language for both agent and customer interfaces (For example, "es" for spanish).
OTRS_LANGUAGE=en

# Sets the default timezone.
OTRS_TIMEZONE=Europe/Brussels

# Sets the starting point for the ticket counter.
#OTRS_TICKET_COUNTER=

# Sets the ticket number generator, possible values are : DateChecksum, Date, AutoIncrement or Random.
OTRS_NUMBER_GENERATOR=DateChecksum

# Configure OTRS permissions, possible values are: yes (default), no, skip-article-dir (if using OTRS_ARTICLE_STORAGE_TYPE=ArticleStorageFS)
#OTRS_SET_PERMISSIONS=yes

# To disable the OTRS ASCII logo at container startup.
#SHOW_OTRS_LOGO=yes

# Enable debug mode, this will install some additional packages to help aid when
# debugging
#OTRS_DEBUG=no

####### Major Version Upgrade #######
#####################################
# This settings will perform a major version upgrade. Please read the documentation
# carefully first before attempting to do this upgrade. And don't forget to do a
# backup first or enable OTRS_UPGRADE_BACKUP=yes
#
# https://github.com/juanluisbaptiste/docker-otrs/#major-version-upgrade
#
#####################################

# Do a MAJOR version upgrade. Possible values: yes, no (default). Please check the README file for details.
#OTRS_UPGRADE=no

# Make a full backup before starting the upgrade process. Possible values: yes (default), no.
#OTRS_UPGRADE_BACKUP=yes

# Migrate XML configuration files during major version upgrade. Possible values: yes, no (default).
#OTRS_UPGRADE_XML_FILES=no

#####################################
# SMTP Relay Configuration
#####################################

# Module OTRS should use to send mails (e.g "SMTP", "SMTPS", "Sendmail"). Depends on the modules you've installed
OTRS_SENDMAIL_MODULE=SMTP

# Server address of the SMTP server to use.
OTRS_SMTP_SERVER=relay.xxxxxxx.be

# Port address of the SMTP server to use.
OTRS_SMTP_PORT=25

# Username to authenticate with.
# OTRS_SMTP_USERNAME=

# Password of the SMTP user.
# OTRS_SMTP_PASSWORD=
juanluisbaptiste commented 3 years ago

There are no missing dependencies, please delete your volumes and test with the image from docker hub, it works fine.

juanluisbaptiste commented 3 years ago

This is the service startup output of a clean deploy. As you can see the service starts fine, and as I pointed on an earlier comment dependencies are present.

gslongo commented 3 years ago

There are no missing dependencies, please delete your volumes and test with the image from docker hub, it works fine.

It's already what I did. Maybe I missed something ? What I did is :

docker-compose down
docker container rm ContainersIds
docker rmi juanluisbaptiste/otrs juanluisbaptiste/otrs-mariadb juanluisbaptiste/postfix centos:7
docker-compose  rm
docker system prune -a --volumes
rm -fr volumes/*
git pull
docker-compose build --force-rm
docker-compose up

Did I missed something ?

This is the service startup output of a clean deploy. As you can see the service starts fine, and as I pointed on an earlier comment dependencies are present.

Your local "volumes" folder is also empty ?

The only way to make work (a bit) is to reinstall the OTRS rpm inside the container. Then I can open the web interface but I get other issues later.

Thanks !

juanluisbaptiste commented 3 years ago

Can you please test with the image from docker hub instead of building it ? yes, I remove the volumes directory before doing the test.

gslongo commented 3 years ago

Can you please test with the image from docker hub instead of building it ? yes, I remove the volumes directory before doing the test.

Hum OK. Could you tell me what I'm doing wrong ? I was thinking docker-compose uses dockerhub images when I do things like so..

juanluisbaptiste commented 3 years ago

You are modifying and building the image instead of using the provided ones. I also tested building the image works fine too.

fperk commented 2 years ago

Hello, i have the same issue with the latest image.

I am using these two images:

juanluisbaptiste/otrs           latest    442954f3a6bd   22 hours ago     898MB
juanluisbaptiste/otrs-mariadb   latest    dbedcec894e7   12 months ago    352MB

And i get this error message:

[Wed Aug 17 15:00:08.188805 2022] [perl:error] [pid 119] Can't locate Apache/DBI.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs/ /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /etc/httpd) at /opt/otrs/scripts/apache2-perl-startup.pl line 52.\nBEGIN failed--compilation aborted at /opt/otrs/scripts/apache2-perl-startup.pl line 52.\nCompilation failed in require at (eval 2) line 1.\n
[Wed Aug 17 15:00:08.188967 2022] [perl:error] [pid 119] Can't load Perl file: /opt/otrs/scripts/apache2-perl-startup.pl for server 192.168.32.3:0, exiting...
2022-08-17 15:00:08,191 INFO exited: httpd (exit status 1; not expected)
2022-08-17 15:00:10,195 INFO spawned: 'httpd' with pid 120
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.32.3. Set the 'ServerName' directive globally to suppress this message
[Wed Aug 17 15:00:10.292572 2022] [perl:error] [pid 120] Can't locate Apache/DBI.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs/ /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /etc/httpd) at /opt/otrs/scripts/apache2-perl-startup.pl line 52.\nBEGIN failed--compilation aborted at /opt/otrs/scripts/apache2-perl-startup.pl line 52.\nCompilation failed in require at (eval 2) line 1.\n
[Wed Aug 17 15:00:10.293100 2022] [perl:error] [pid 120] Can't load Perl file: /opt/otrs/scripts/apache2-perl-startup.pl for server 192.168.32.3:0, exiting...
2022-08-17 15:00:10,295 INFO exited: httpd (exit status 1; not expected)
2022-08-17 15:00:13,301 INFO spawned: 'httpd' with pid 121
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.32.3. Set the 'ServerName' directive globally to suppress this message
[Wed Aug 17 15:00:13.389490 2022] [perl:error] [pid 121] Can't locate Apache/DBI.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs/ /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /etc/httpd) at /opt/otrs/scripts/apache2-perl-startup.pl line 52.\nBEGIN failed--compilation aborted at /opt/otrs/scripts/apache2-perl-startup.pl line 52.\nCompilation failed in require at (eval 2) line 1.\n
[Wed Aug 17 15:00:13.390086 2022] [perl:error] [pid 121] Can't load Perl file: /opt/otrs/scripts/apache2-perl-startup.pl for server 192.168.32.3:0, exiting...
2022-08-17 15:00:13,392 INFO exited: httpd (exit status 1; not expected)
2022-08-17 15:00:14,394 INFO gave up: httpd entered FATAL state, too many start retries too quickly
Aug 17 15:01:01 1c7928938ae9 CROND[123]: (root) CMD (run-parts /etc/cron.hourly)
Aug 17 15:01:01 1c7928938ae9 run-parts(/etc/cron.hourly)[123]: starting 0anacron
Aug 17 15:01:01 1c7928938ae9 anacron[132]: Anacron started on 2022-08-17
Aug 17 15:01:01 1c7928938ae9 anacron[132]: Will run job `cron.daily' in 14 min.
Aug 17 15:01:01 1c7928938ae9 anacron[132]: Will run job `cron.weekly' in 34 min.
Aug 17 15:01:01 1c7928938ae9 anacron[132]: Will run job `cron.monthly' in 54 min.
Aug 17 15:01:01 1c7928938ae9 anacron[132]: Jobs will be executed sequentially
Aug 17 15:01:01 1c7928938ae9 run-parts(/etc/cron.hourly)[134]: finished 0anacron

I tried removing all volumes and images and redownloading, but i still have the same issue.

I also tried building the image myself, had the same issue, then i added perl-Apache-DBI.noarch perl-IO-Interactive.noarch to yum install in the Dockerfile and now i dont have the Apache error anymore but it cannot find Kernel/System/ObjectManager.pm and Kernel/System/Web/InterfaceAgent.pm as seen here:

Can't locate Math/Random/Secure.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Kernel/System/Main.pm line 24.
BEGIN failed--compilation aborted at Kernel/System/Main.pm line 24.
Compilation failed in require at Kernel/System/ObjectManager.pm line 35.
BEGIN failed--compilation aborted at Kernel/System/ObjectManager.pm line 35.
Compilation failed in require at /opt/otrs/bin/otrs.Console.pl line 29.
BEGIN failed--compilation aborted at /opt/otrs/bin/otrs.Console.pl line 29.
[WARNING] Cannot enable Package::AllowNotVerifiedPackages
[INFO] Installing OTRS addons...
[INFO] No addons found to install.
(using /opt/otrs) done
Can't locate Math/Random/Secure.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Kernel/System/Main.pm line 24.
BEGIN failed--compilation aborted at Kernel/System/Main.pm line 24.
Compilation failed in require at Kernel/System/ObjectManager.pm line 35.
BEGIN failed--compilation aborted at Kernel/System/ObjectManager.pm line 35.
Compilation failed in require at /opt/otrs/bin/otrs.Daemon.pl line 34.
BEGIN failed--compilation aborted at /opt/otrs/bin/otrs.Daemon.pl line 34.
Can't locate Math/Random/Secure.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Kernel/System/Main.pm line 24.
BEGIN failed--compilation aborted at Kernel/System/Main.pm line 24.
Compilation failed in require at Kernel/System/ObjectManager.pm line 35.
BEGIN failed--compilation aborted at Kernel/System/ObjectManager.pm line 35.
Compilation failed in require at /opt/otrs/bin/otrs.Console.pl line 29.
BEGIN failed--compilation aborted at /opt/otrs/bin/otrs.Console.pl line 29.
Can't locate Math/Random/Secure.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Kernel/System/Main.pm line 24.
BEGIN failed--compilation aborted at Kernel/System/Main.pm line 24.
Compilation failed in require at Kernel/System/ObjectManager.pm line 35.
BEGIN failed--compilation aborted at Kernel/System/ObjectManager.pm line 35.
Compilation failed in require at /opt/otrs/bin/otrs.Console.pl line 29.
BEGIN failed--compilation aborted at /opt/otrs/bin/otrs.Console.pl line 29.
[INFO] Swtiching Article Storage Type to: ArticleStorageDB ...
Can't locate Math/Random/Secure.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Kernel/System/Main.pm line 24.
BEGIN failed--compilation aborted at Kernel/System/Main.pm line 24.
Compilation failed in require at Kernel/System/ObjectManager.pm line 35.
BEGIN failed--compilation aborted at Kernel/System/ObjectManager.pm line 35.
Compilation failed in require at /opt/otrs/bin/otrs.Console.pl line 29.
BEGIN failed--compilation aborted at /opt/otrs/bin/otrs.Console.pl line 29.
./functions.sh: line 650: [: !=: unary operator expected
[INFO] Current Article storage type already configured to: ArticleStorageDB
[INFO] Enabling Email Accounts fetching...
Can't locate Math/Random/Secure.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Kernel/System/Main.pm line 24.
BEGIN failed--compilation aborted at Kernel/System/Main.pm line 24.
Compilation failed in require at Kernel/System/ObjectManager.pm line 35.
BEGIN failed--compilation aborted at Kernel/System/ObjectManager.pm line 35.
Compilation failed in require at /opt/otrs/bin/otrs.Console.pl line 29.
BEGIN failed--compilation aborted at /opt/otrs/bin/otrs.Console.pl line 29.
[INFO] Starting supervisord...
[INFO] Restarting OTRS daemon...
Can't locate Kernel/System/ObjectManager.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /opt/otrs/bin/otrs.Daemon.pl line 34.
BEGIN failed--compilation aborted at /opt/otrs/bin/otrs.Daemon.pl line 34.
/usr/lib/python2.7/site-packages/supervisor/options.py:461: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
  'Supervisord is running as root and it is searching '
2022-08-17 15:26:06,971 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
2022-08-17 15:26:06,971 INFO Included extra file "/etc/supervisord.d/otrs.ini" during parsing
2022-08-17 15:26:07,008 INFO RPC interface 'supervisor' initialized
2022-08-17 15:26:07,008 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2022-08-17 15:26:07,008 INFO supervisord started with pid 124
2022-08-17 15:26:08,012 INFO spawned: 'httpd' with pid 130
2022-08-17 15:26:08,016 INFO spawned: 'crond' with pid 131
2022-08-17 15:26:08,020 INFO spawned: 'rsyslog' with pid 132
Aug 17 15:26:08 83461cb4a003 crond[131]: (CRON) INFO (Syslog will be used instead of sendmail.)
Aug 17 15:26:08 83461cb4a003 crond[131]: (CRON) INFO (RANDOM_DELAY will be scaled with factor 26% if used.)
Aug 17 15:26:08 83461cb4a003 crond[131]: (CRON) INFO (running with inotify support)
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.96.3. Set the 'ServerName' directive globally to suppress this message
[Wed Aug 17 15:26:08.292049 2022] [suexec:notice] [pid 130] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.96.3. Set the 'ServerName' directive globally to suppress this message
[Wed Aug 17 15:26:08.541946 2022] [lbmethod_heartbeat:notice] [pid 130] AH02282: No slotmem from mod_heartmonitor
[Wed Aug 17 15:26:08.547768 2022] [mpm_prefork:notice] [pid 130] AH00163: Apache/2.4.6 (CentOS) mod_perl/2.0.11 Perl/v5.16.3 configured -- resuming normal operations
[Wed Aug 17 15:26:08.547803 2022] [core:notice] [pid 130] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
Can't locate Kernel/System/ObjectManager.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /opt/otrs/bin/otrs.Daemon.pl line 34.
BEGIN failed--compilation aborted at /opt/otrs/bin/otrs.Daemon.pl line 34.
[INFO] OTRS Ready !
2022-08-17 15:26:09,549 INFO success: httpd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-08-17 15:26:09,549 INFO success: crond entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-08-17 15:26:09,549 INFO success: rsyslog entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
[Wed Aug 17 15:28:29.884223 2022] [:error] [pid 135] Can't locate Kernel/System/Web/InterfaceAgent.pm in @INC (@INC contains: /usr/sbin/../../Custom /usr/sbin/../../Kernel/cpan-lib /usr/sbin/../.. /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs/ /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /etc/httpd) at /opt/otrs/bin/cgi-bin/index.pl line 33.\nBEGIN failed--compilation aborted at /opt/otrs/bin/cgi-bin/index.pl line 33.\n

Also when i search for the InterfaceInstaller.pm in the container, it cannot find it:

[root@83461cb4a003 /]# find / -name InterfaceInstaller.pm
[root@83461cb4a003 /]#
juanluisbaptiste commented 2 years ago

@fperk your issue is another one, it is related to the fix for issue #123 , I think for now you have to use 6.0.28 or older.

fperk commented 2 years ago

@fperk your issue is another one, it is related to the fix for issue #123 , I think for now you have to use 6.0.28 or older.

I don't think that this is the same issue, as i cannot even get to the login screen, because of the missing modules. Version 6.0.28 works for me, but that is not a znuny build.

juanluisbaptiste commented 2 years ago

@fperk it is the same problem, trust me on that.

tkoszta commented 2 years ago

6.0.45 (image juanluisbaptiste/znuny:latest) also has cannot be started from scratch. It thinks a current configuration directory exists. The problem is in "functions.sh" I think.

The function "check_host_mount_dir()" finds the "current_version" file when doing "ls -A ${OTRS_CONFIG_DIR}", so it will not copy the default configuration.

vadonka commented 2 years ago

Same issue. Fresh clean deploy got this at start: [Fri Aug 26 13:53:36.041359 2022] [perl:error] [pid 138] Can't locate Apache/DBI.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs/ /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /etc/httpd) at /opt/otrs/scripts/apache2-perl-startup.pl line 52.\nBEGIN failed--compilation aborted at /opt/otrs/scripts/apache2-perl-startup.pl line 52.\nCompilation failed in require at (eval 2) line 1.\n [Fri Aug 26 13:53:36.041457 2022] [perl:error] [pid 138] Can't load Perl file: /opt/otrs/scripts/apache2-perl-startup.pl for server 172.22.0.3:0, exiting... 2022-08-26 13:53:36,043 INFO exited: httpd (exit status 1; not expected) 2022-08-26 13:53:37,044 INFO gave up: httpd entered FATAL state, too many start retries too quickly Aug 26 13:55:01 037c6fc2f570 CROND[140]: (otrs) CMD ($HOME/bin/otrs.Daemon.pl start >> /dev/null) Aug 26 13:55:01 037c6fc2f570 CROND[139]: (otrs) CMDOUT (Can't locate Kernel/System/ObjectManager.pm in @INC (@INC contains: /opt/otrs/Custom /opt/otrs/Kernel/cpan-lib /opt/otrs /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /opt/otrs//bin/otrs.Daemon.pl line 34.) Aug 26 13:55:01 037c6fc2f570 CROND[139]: (otrs) CMDOUT (BEGIN failed--compilation aborted at /opt/otrs//bin/otrs.Daemon.pl line 34.)

vadonka commented 2 years ago

The latest version what works is 6.0.39, 6.0.40 and above drop this even with a fresh install.

vadonka commented 2 years ago

Also deploy the 6.0.39 then upgrade to the latest version not working. It did not drop the perl error but instead i cant even login because of this: https://github.com/juanluisbaptiste/docker-otrs/issues/123 So upgrade from 6.0.39 to latest also break the install, but fresh install also not woring so if there is not possible to use the latest version right now.

Vertganti commented 8 months ago

6.0.45 (image juanluisbaptiste/znuny:latest) also has cannot be started from scratch. It thinks a current configuration directory exists. The problem is in "functions.sh" I think.

The function "check_host_mount_dir()" finds the "current_version" file when doing "ls -A ${OTRS_CONFIG_DIR}", so it will not copy the default configuration.

The analysis by @tkoszta is correct. We were able to fix the issue by modifying line 336 of the functions.sh file:

-  if ([ "$(ls -A ${OTRS_CONFIG_MOUNT_DIR})" ] && [ ! "$(ls -A ${OTRS_CONFIG_DIR})" ]) || [ "${OTRS_UPGRADE}" == "yes" ] || [ ${_MINOR_VERSION_UPGRADE} == true ];
+  if ([ "$(ls -A ${OTRS_CONFIG_MOUNT_DIR})" ] && ([ ! "$(ls -A ${OTRS_CONFIG_DIR})" ] || [ "$(ls -A ${OTRS_CONFIG_DIR})" == "current_version" ])) || [ "${OTRS_UPGRADE}" == "yes" ] || [ ${_MINOR_VERSION_UPGRADE} == true ];

The modified line causes the default configuration to be copied if the OTRS_CONFIG_DIR is either empty (original clause) or if it contains only the current_version file (added clause). This should fix the issue for new installations, we have not tested if it works when upgrading.