juanluisbaptiste / docker-otrs

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

Errors when starting containers #8

Closed zoell closed 7 years ago

zoell commented 7 years ago

Hi,

I cloned the containers, changed the yml a little bit to remove unnecessary things like volumes (I just wanted to test if I can run these) and when trying to start the compose it gives me some errors.

yml:

otrs:
  image: juanluisbaptiste/otrs:latest
  ports:
  - "80:80"
  links:
  - mariadb:mariadb
  - postfix:postfix
  environment:
    OTRS_INSTALL: "yes"
    OTRS_POSTMASTER_FETCH_TIME: 0
    OTRS_HOSTNAME: xyz.domain
    OTRS_ADMIN_EMAIL: admin@xyz.domain
    OTRS_ROOT_PASSWORD: otrsotrs
    MYSQL_ROOT_PASSWORD: otrsotrs
    OTRS_DB_PASSWORD: otrsotrs

mariadb:
  image: juanluisbaptiste/otrs-mariadb:latest
  expose:
  - "3306"
  environment:
      MYSQL_ROOT_PASSWORD: otrsotrs
postfix:
   image: juanluisbaptiste/postfix:latest
   expose:
   - "25"
   environment:
     SMTP_SERVER: smtp.bar.com
     SMTP_USERNAME: foo@bar.com
     SMTP_PASSWORD: XXXXXXXX
     SERVER_HOSTNAME: helpdesk.mycompany.com

Error I get:

mariadb_1 | 170217 14:29:39 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
postfix_1 | postmap: warning: /etc/postfix/sasl_passwd.db: duplicate entry: "[smtp.bar.com]:587"
mariadb_1 | 170217 14:29:39 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
postfix_1 | /usr/lib/python2.7/site-packages/supervisor/options.py:296: 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.
postfix_1 |   'Supervisord is running as root and it is searching '
postfix_1 | 2017-02-17 14:28:08,546 CRIT Supervisor running as root (no user in config file)
postfix_1 | 2017-02-17 14:28:08,546 WARN Included extra file "/etc/supervisord.d/postfix.ini" during parsing
postfix_1 | Unlinking stale socket /var/run/supervisor/supervisor.sock
postfix_1 | 2017-02-17 14:28:08,860 INFO RPC interface 'supervisor' initialized
postfix_1 | 2017-02-17 14:28:08,860 CRIT Server 'unix_http_server' running without any HTTP authentication checking
postfix_1 | 2017-02-17 14:28:08,860 INFO supervisord started with pid 12
postfix_1 | 2017-02-17 14:28:09,862 INFO spawned: 'master' with pid 15
postfix_1 | 2017-02-17 14:28:10,010 INFO success: master entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
postfix_1 | 2017-02-17 14:28:10,010 INFO exited: master (exit status 0; expected)
otrs_1    | [INFO] ERROR
otrs_1    | [WARNING] DB server still isn't up, sleeping a little bit ...
otrs_1    | [INFO] COUNT(*)
otrs_1    | [INFO] Server is up !
otrs_1    | [INFO] Starting  OTRS 5.0.16-01 installer !!
otrs_1    | [INFO] Starting supervisord...
otrs_1    | [INFO] Restarting OTRS daemon...
otrs_1    | 2017-02-17 14:29:41,420 CRIT Supervisor running as root (no user in config file)
otrs_1    | 2017-02-17 14:29:41,424 INFO /var/tmp/supervisor.sock:Medusa (V1.1.1.1) started at Fri Feb 17 14:29:41 2017
otrs_1    |     Hostname: <unix domain socket>
otrs_1    |     Port:/var/tmp/supervisor.sock
otrs_1    | 2017-02-17 14:29:41,443 CRIT Running without any HTTP authentication checking
otrs_1    | 2017-02-17 14:29:41,443 INFO supervisord started with pid 15
otrs_1    | 2017-02-17 14:29:41,444 INFO spawned: 'httpd' with pid 18
otrs_1    | 2017-02-17 14:29:41,444 INFO spawned: 'crond' with pid 19
otrs_1    | 2017-02-17 14:29:41,445 INFO spawned: 'rsyslog' with pid 20
otrs_1    | 2017-02-17 14:29:41,484 INFO exited: httpd (exit status 1; not expected)
otrs_1    | 2017-02-17 14:29:41,484 INFO received SIGCLD indicating a child quit
otrs_1    | Can't locate Encode/Locale.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/Encode.pm line 15.
otrs_1    | BEGIN failed--compilation aborted at Kernel/System/Encode.pm line 15.
otrs_1    | Compilation failed in require at Kernel/System/ObjectManager.pm line 29.
otrs_1    | BEGIN failed--compilation aborted at Kernel/System/ObjectManager.pm line 29.
otrs_1    | Compilation failed in require at /opt/otrs/bin/otrs.Daemon.pl line 35.
otrs_1    | BEGIN failed--compilation aborted at /opt/otrs/bin/otrs.Daemon.pl line 35.
otrs_1    | 2017-02-17 14:29:42,485 INFO success: crond entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
otrs_1    | 2017-02-17 14:29:42,485 INFO success: rsyslog entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
otrs_1    | 2017-02-17 14:29:42,486 INFO spawned: 'httpd' with pid 25
otrs_1    | 2017-02-17 14:29:42,505 INFO exited: httpd (exit status 1; not expected)
otrs_1    | 2017-02-17 14:29:42,505 INFO received SIGCLD indicating a child quit
otrs_1    | Can't locate Encode/Locale.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/Encode.pm line 15.
otrs_1    | BEGIN failed--compilation aborted at Kernel/System/Encode.pm line 15.
otrs_1    | Compilation failed in require at Kernel/System/ObjectManager.pm line 29.
otrs_1    | BEGIN failed--compilation aborted at Kernel/System/ObjectManager.pm line 29.
otrs_1    | Compilation failed in require at /opt/otrs/bin/otrs.Daemon.pl line 35.
otrs_1    | BEGIN failed--compilation aborted at /opt/otrs/bin/otrs.Daemon.pl line 35.
otrs_1    | 2017-02-17 14:29:44,507 INFO spawned: 'httpd' with pid 29
otrs_1    | 2017-02-17 14:29:44,526 INFO exited: httpd (exit status 1; not expected)
otrs_1    | 2017-02-17 14:29:44,526 INFO received SIGCLD indicating a child quit
otrs_1    | 2017-02-17 14:29:47,530 INFO spawned: 'httpd' with pid 30
otrs_1    | 2017-02-17 14:29:48,550 INFO success: httpd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
otrs_1    | 2017-02-17 14:29:48,550 INFO exited: httpd (exit status 1; not expected)
otrs_1    | 2017-02-17 14:29:48,550 INFO received SIGCLD indicating a child quit
otrs_1    | 2017-02-17 14:29:49,552 INFO spawned: 'httpd' with pid 31

Do you have any suggestion?

juanluisbaptiste commented 7 years ago

Did you test it with the original yml file ? I haven't tested it without volumes because it doesn't make sense for a production environment.

zoell commented 7 years ago

Yeah its the same error with the original file.

Could you please check if you can run this with docker-compose up?

juanluisbaptiste commented 7 years ago

When using the defaullt yml file, did you check the file system permissions as described on the README ?

zoell commented 7 years ago

Yes

juanluisbaptiste commented 7 years ago

I just tested the default yml file and it works fine. Most of the problems come from the permissions of the directories that hold the container volumes as explained on the README file.

zoell commented 7 years ago

That is intereting.

So to just start at the beggining, with zero (or almost zero) configuration what I have to do is:

1: clone the repo 2: add the files: for otrs: otrs-setup.env for postfix: credentials-smtp.env 3: change to OTRS_INSTALL: "yes"

and do docker-compose up right? I want to replicate exactly what you have done to try it out. Btw do you have an example for those two env files?

juanluisbaptiste commented 7 years ago

You don't list to check/fix directory permissions, please check the README and fix permissions before starting the service.

zoell commented 7 years ago

I did that already as I mentioned. Please give me an example for the env files.

juanluisbaptiste commented 7 years ago

The error you posted has to do with filesystem permissions, it has nothing to do with env files. You can remove them and put all the env variables on the yml file and the error should be the same. Test with the docker-compose-prod.yml file (which doesn't use env_file), the other one I use it to build the images, and use the -prod one as a base for my production installations (but using env_file).

juanluisbaptiste commented 7 years ago

Also don't use OTRS_INSTALL=yes (the default is no), the default install is ready to be configured, you don't need to do the installation, that parameter is more for tests and haven't tested it in a long time.

zoell commented 7 years ago

Thanks, the issue was with the OTRS_INSTALL=yes.