GithubHelp home page GithubHelp logo

juanluisbaptiste / docker-otrs Goto Github PK

View Code? Open in Web Editor NEW
172.0 14.0 99.0 1.09 MB

The unofficial Znuny/OTRS Ticketing System docker image

Home Page: https://www.juanbaptiste.tech/category/otrs

License: GNU Lesser General Public License v3.0

Shell 94.26% Dockerfile 5.74%
docker-otrs docker otrs otrs-image otrs-free helpdesk ticket-system

docker-otrs's Introduction

Znuny OTRS Community Edition Fork

Znuny - The ((OTRS)) Community Edition Ticketing System Fork

Docker Build Status Docker Stars Docker Pulls

⚠️ NOTICE:

On February 24th OTRS AG announced they would be discontinuing the OTRS ((Community Edition)) until further notice. This means no more security or bug fixes from that day onward. Due to this we have switched to the Znuny release of OTRS ((Community Edition)), as they will continue to provide new releases with their LTS version. Znuny has been providing consulting services for OTRS customers for a long time and runs the OTRS community forum. More information about this here.

You can follow the discussion about the migration process, report any bugs you find or do any suggestion on this issue.

Znuny - The ((OTRS)) Community Edition Fork docker image. This repository contains the Dockerfiles and all other files needed to build and run the container.

Current community edition is at version 6.

We also include a MariaDB Dockerfile for a pre-configured image with the required database settings.

The OTRS image doesn't include a SMTP service, decoupling applications into multiple containers makes it much easier to scale horizontally and reuse containers. If you don't have access to a SMTP server, you can instead link against this SMTP relay postfix container.

These images are based on the official CentOS images and include the latest OTRS version. Older images will be tagged with the OTRS version they run.

Note:

If you want to follow the development of this project check out my blog.

Table of Contents

Build Instructions

We use docker-compose to build the images. Clone this repo and then:

cd docker-otrs
sudo docker-compose build

This command will build all the images and pull the missing ones like the SMTP relay. This SMTP relay container has its own configuration, you need to specify the environment variables for the SMTP account that will be used to send OTRS email notifications. Please take a look at the documentation.

How To Run It

The container behavior is controlled by environment variables (see full list below). By default, when the container is run it will load a default vanilla OTRS installation (OTRS_INSTALL=no) that is ready to be configured as you need. However, you can load a backup or run the installer by defining one of these environment variables:

  • OTRS_INSTALL=restore Will restore the backup specified by OTRS_BACKUP_DATE environment variable. See bellow for more details on backup and restore procedures.

  • OTRS_DROP_DATABASE=yes Will drop the otrs database it if already exists (by default the container will fail if the database already exists).

  • OTRS_INSTALL=yes (currently unsupported) Will run the installer which you can access at:

    http://localhost/otrs/install.pl

If you are running the container remotely, replace localhost with the server's hostname. If starting with the default mode (OTRS__INSTALL=no), you will need to configure it before starting it. Copy the example env file as .env on the same directory as the docker-compose file and configure it as you need (don't forget to configure the SMTP relay section at the end). You can then test the service with docker-compose:

sudo docker-compose -f docker-compose.yml up

This will pull and bring up all needed containers, link them and mount volumes according to the docker-compose.yml configuration file. This is a sample output of the boot up process:

Container boot

The default database password is changeme, to change it, edit your copy of the env file file and change the MYSQL_ROOT_PASSWORD environment variable on the mariadb image definition before running docker-compose.

To start the containers in production mode the the -d parameter to the previous command:

sudo docker-compose -f docker-compose.yml -p companyotrs up -d

After the containers finish starting up you can access the OTRS system at the following addresses:

NOTE: OTRS_INSTALL=yes was used to run the installer but currently is unsupported and have not been tested in a long time so please do not use it, it will be removed soon.

Administration Interface

http://$OTRS_HOSTNAME/otrs/index.pl

Customer Interface

http://$OTRS_HOSTNAME/otrs/customer.pl

Runtime Configuration

There are also some other environment variables that can be set to customize the default install:

  • OTRS_HOSTNAME Sets the container's hostname (auto-generated if not defined).
  • OTRS_DB_NAME Name of database to use. Default is otrs.
  • OTRS_DB_HOST Hostname or IP address of the database server. Default is mariadb.
  • OTRS_DB_PORT Port of the database server. Default is 3306.
  • OTRS_DB_USER Database user. Default is otrs.
  • OTRS_DB_PASSWORD otrs user database password. Default password is changeme.
  • OTRS_ROOT_PASSWORD root@localhost user password. Default password is changeme.
  • MYSQL_ROOT_USER Database root user name so it can be setup when using an external database. Default user is root.
  • MYSQL_ROOT_PASSWORD Database root password so it can be setup. Default password is changeme.
  • OTRS_SECRETS_FILE Path to the docker secret file inside the container.
  • OTRS_LANGUAGE Set the default language for both agent and customer interfaces (For example, "es" for spanish).
  • OTRS_TIMEZONE to set the default timezone.
  • OTRS_TICKET_COUNTER Sets the starting point for the ticket counter.
  • OTRS_NUMBER_GENERATOR Sets the ticket number generator, possible values are : DateChecksum, Date, AutoIncrement or Random.
  • OTRS_SET_PERMISSIONS Configure OTRS permissions, possible values are: yes, no or skip-article-dir (if using OTRS_ARTICLE_STORAGE_TYPE=ArticleStorageFS, useful with big articles directories). Default is yes.
  • OTRS_BACKUP_SCRIPT Path to a custom backup script to be called by cron by default /etc/cron.d/otrs_backup script. The script must be added by custom image. Default value is /otrs_backup.sh.
  • OTRS_CRON_BACKUP_SCRIPT Path to a custom backup script to be called by cron. The script must be added by custom image. Default value is /etc/cron.d/otrs_backup.
  • OTRS_ARTICLE_STORAGE_TYPE Change the article storage type (attachments), possible values are ArticleStorageFS and ArticleStorageDB. This feature will also move the articles from the database to the filesystem or vice-versa.
  • OTRS_ALLOW_NOT_VERIFIED_PACKAGES Enable the installation of unverified addons. Useful when installing addons downladed form 3rd party sources like OPAR at startup.
  • SHOW_OTRS_LOGO To disable the OTRS ASCII logo at container startup.
  • OTRS_SENDMAIL_MODULE Module OTRS should use to send mails (e.g SMTP, SMTPS, Sendmail).
  • OTRS_SMTP_SERVER Server address of the SMTP server to use.
  • OTRS_SMTP_PORT Port of the SMTP server to use.
  • OTRS_SMTP_USERNAME Username to authenticate with.
  • OTRS_SMTP_PASSWORD Password to authenticate with.

Those environment variables is what you can configure by running the installer for a default install, plus other useful ones.

Custom Configuration File

You can also add your own Config.pm file configured as you need, by creating a custom image and adding your custom configuration file to /Kernel/ (NOT /opt/otrs/Kernel), where the container stores OTRS's default configuration files, which are copied back to /opt/otrs on container start, if they have not been already copied and you are using host volumes. This means that configuration files will not be overwritten on container restart. An example Dockerfile:

FROM juanluisbaptiste/otrs:latest
LABEL maintainer='xxxxxx'

COPY Config.pm /Kernel

Changing Default Article Storage Type

The article storage type can be controlled using the OTRS_ARTICLE_STORAGE_TYPE environment variable, useful when the database size is getting out of hands so a filesystem based storage is better suited. Possible values are ArticleStorageFS and ArticleStorageDB (this is the default).

This feature will also move the articles from the database to the filesystem or vice-versa as described in the documentation. If you change the storage type to ArticleStorageFS you have to mount /opt/otrs/var/article directory so exported articles from the database aren't lost at container restart/recreation. The example docker-compose files has this commented out.

Container auto-start

As a convenience, a pre-made systemd service file otrs.service is included as part of the repository to automatically start the container as a host service.

To use it you will need to update /opt/docker-otrs/docker-compose-prod.yml to the path to your docker compose file, then copy the service file from the repository to /usr/lib/systemd/system/, and run the command systemctl daemon-reload. You will then be able to use systemd to control your container.

Docker Secrets

In order to keep your repositories and images free from any sensitive information you can specify a path to you secrets file to deploy the container easier and safer within a docker swarm/kubernetes environment. You can store any key/value-pair from the list above exactly like the .env file.

e.g.

OTRS_DB_PASSWORD=12345
MYSQL_ROOT_PASSWORD=67890
OTRS_ROOT_PASSWORD=54321

And add the path to this secret file (within the container) to OTRS_SECRETS_FILE. Docker stores those files in /run/secrets/.

services:
  otrs:
    environment:
      - OTRS_SECRETS_FILE=/run/secrets/my_otrs_secrets

Installing Addons

To install any addon at container start, map /opt/otrs/addons directory to a volume and place the /opm files there. The container will install them when starting up.

If you have installed any additional addon, the OTRS container will reinstall them after an upgrade or when a container is removed so they continue working.

Notes

  • The included docker-compose file uses host mounted data containers to store the database and configuration contents outside the containers. Please take a look at the docker-compose.yml file to see the directory mappings and adjust them to your needs.
  • Any setting set using the previous environment variables cannot be edited later through the web interface, if you need to change them then you need to update it in your docker-compose/env file and restart your container. The reason for this is that OTRS sets as read-only any setting set on $OTRS_ROOT/Kernel/Config.pm.
  • For production use there's another docker-compose file that points to the pre-built images.

Changing Default Skins

The default skins and logos for the agent and customer interfaces can be controlled with the following environment variables:

To set the agent interface skin set OTRS_AGENT_SKIN environment variable, for example:

OTRS_AGENT_SKIN: "ivory"

To set the customer interface skin set OTRS_CUSTOMER_SKIN environment variable, for example:

OTRS_CUSTOMER_SKIN: "ivory"

Custom skin

If you are adding your own skins, the easiest way is create your own Dockerfile inherited from this image and then COPY the skin files there. Take a look at the official documentation on instructions on how to create one. You can also set all the environment variables in there too, for example:

FROM juanluisbaptiste/otrs:latest
MAINTAINER Foo Bar <[email protected]>
ENV OTRS_AGENT_SKIN mycompany
ENV OTRS_AGENT_LOGO skins/Agent/mycompany/img/logo.png
ENV OTRS_CUSTOMER_LOGO skins/Customer/default/img/logo_customer.png

COPY skins/ $SKINS_PATH/
RUN mkdir -p $OTRS_ROOT/Kernel/Config/Files/
COPY skins/Agent/MyCompanySkin.xml $OTRS_ROOT/Kernel/Config/Files/

Backups & Restore Procedures

Backup

By default, automated backups are done daily at 6:00 AM. Backups are compressed using gzip and are stored in /var/otrs/backups. If you mounted that directory as a host volume then you will have access to the backups files from the docker host server.

You can control the backup behavior with the following variables:

  • OTRS_BACKUP_TIME: Sets the backup excecution time, in cron format. If set to disable automated backups will be disabled.
  • OTRS_BACKUP_TYPE: Sets the type of backup, it receives the same values as the OTRS backup script:
    • fullbackup: Saves the database and the whole OTRS home directory (except /var/tmp and cache directories). This is the default.
    • nofullbackup: Saves only the database, /Kernel/Config* and /var directories.
    • dbonly: Only the database will be saved.
  • OTRS_BACKUP_COMPRESSION: Sets the backup compression method to use, it receives the same values as the OTRS backup script (gzip|bzip2). The default is gzip.
  • OTRS_BACKUP_ROTATION: Sets the number of days to keep the backup files. The default is 30 days.
  • OTRS_BACKUP_STOP_SERVICES: Controls whether OTRS services should be stopped before doing a backup. The default is yes.

For example, to change the backup time to database only backups, compress them using bzip2 and run twice each day set those variables like this:

OTRS_BACKUP_TYPE=dbonly
OTRS_BACKUP_TIME="0 12,12 * * *"
OTRS_BACKUP_COMPRESSION=bzip2

Restore

To restore an OTRS backup file (not necessarily created with this container) the following environment variables must be added:

  • OTRS_INSTALL=restore Will restore the backup specified by OTRS_BACKUP_DATE environment variable.
  • OTRS_BACKUP_DATE is the backup name to restore. It can have two values:
    • Uncompressed backup: A directory with its name in the same date_time format that the OTRS backup script uses, for example OTRS_BACKUP_DATE="2015-05-26_00-32" with the backup files inside. A backup file created with this image or with any OTRS installation will work (the backup script creates the directory with that name). This feature is useful when migrating from another OTRS install to this container.
    • Compressed backup file: A gzip tarball of the previously described directory with the backup files. These tarballs are created by this container when doing a backup.

Backups must be inside the /var/otrs/backups directory (host mounted by default in the docker-compose file).

❗ Remember to remove the OTRS_INSTALL=restore from the docker-compose file environment variables afterwards.

Upgrading

There are two types of upgrades When upgrading OTRS: minor and major version upgrades. This section describes how to upgrade on each case.

Minor Version Upgrade

For example from 6.0.1 to 6.0.5, just pull the new image and restart your services:

sudo docker-compose -f docker-compose-prod.yml pull
sudo docker-compose -f docker-compose-prod.yml stop
sudo docker-compose -f docker-compose-prod.yml up -d

Major Version Upgrade

This upgrade option will do a major version upgrade of OTRS. For example from OTRS 5.0x to 6.0.x. The upgrade process will also upgrade installed packages only from the official repository.

To do a major version upgrade, follow these steps:

  1. Set the OTRS_UPGRADE=yes environment variable in the docker-compose file
  2. Replace the current image version tag with the new one on the image: configuration option. For example, change:
    image: juanluisbaptiste/otrs:latest-5x

with:

  image: juanluisbaptiste/otrs:latest
  1. Pull the release image you are upgrading to:
    sudo docker-compose -f docker-compose-prod.yml pull
  1. Restart the containers:
    sudo docker-compose -f docker-compose-prod.yml stop
    sudo docker-compose -f docker-compose-prod.yml up -d

The upgrade procedure will pause the boot process for 10 seconds to give the user the chance to cancel the upgrade.

The first thing done by the upgrade process is to do a backup of the current version before starting with the upgrade process. Then it will follow the official upgrade instructions (run db upgrade script and upgrade modules, software was updated when pulling the new image). You can use these variables to control the upgrade process:

  • OTRS_UPGRADE_BACKUP=yes|no to control if a backup should be done before starting an upgrade (default: yes).

Aditional SQL files

Sometimes there are fixes needed to be done to the database when doing an upgrade. When the database upgrade script is executed it will do some inconsistencies checks and it will spit out the sql commands needed to be run to fix the database and continue with the upgrade process. Map /opt/otrs/db_upgrade to a host directory and put the sql files in it, they will get loaded before the database upgrade script is run.

XML Configuration Files

Since OTRS 6 the location and XML schema of configuration files has changed. OTRS can try to migrate this configuration files and put them in the new location. For this set OTRS_UPGRADE_XML_FILES=yes (default value: no).

Add-ons

The upgrade process will upgrade official modules (FAQ, Survey, etc). If you have additional 3rd party modules you will need to manually update them in the Package Manager.

Custom Skins & Configuration Files

As mentioned before, the XML files of custom skins can be migrated to the new location and updated schema setting OTRS_UPGRADE_XML_FILES=yes.

Troubleshooting

  • If after upgrade you can't login with any account, delete the cookies for your OTRS website and try again.
  • If you get an 500 error after login it could mean that a module could not be automatically upgraded. Check the container output and look for the messages about modules upgrade.

❗ Remember to remove the OTRS_UPGRADE=yes from the docker-compose file environment variables afterwards.

Enabling debug mode

If you are having issues starting up the containers you can set OTRS_DEBUG=yes to print a more verbose container startup output. It will also install some tools to aid with troubleshooting like telnet and dig.

Consulting & Support

Do you need help setting your OTRS ticketing system or configuring it to match your organization's needs ? I also offer consulting services, drop me a line at: juan at juanbaptiste dot tech

docker-otrs's People

Contributors

estevao90 avatar fajfer avatar glmars avatar grantcurell avatar hollmanenciso avatar hos-ftv avatar juanluisbaptiste avatar kordianbruck avatar rdxmb avatar rillke avatar wodka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-otrs's Issues

Make SendmailModule configurable

Hello,

currently the SendmailModule settings are static in Kernel/Config.pm:
https://github.com/juanluisbaptiste/docker-otrs/blob/master/otrs/Config.pm#L96

It would be nice if those could be removed or overwritten with environment variables, for example we would like to use SendmailModule => 'Kernel::System::Email::SMTPTLS' with custom settings from the DB.

The otrs config params are;

SendmailModule
SendmailModule::AuthUser
SendmailModule::AuthPassword
SendmailModule::Host
SendmailModule::Port

Thanks

OTRS not starting

My Composefile is

   version: '2'
  services:
    otrs:
      image: juanluisbaptiste/otrs:latest
      ports:
      - "80:80"
      links:
      - mariadb:mariadb
      - postfix:postfix
      volumes_from:
      - data
      environment:
          MYSQL_ROOT_PASSWORD: root
          OTRS_ROOT_PASSWORD: root
          OTRS_NUMBER_GENERATOR: Date
          OTRS_LANGUAGE: es
          OTRS_POSTMASTER_FETCH_TIME: 5

    mariadb:
      image: juanluisbaptiste/otrs-mariadb:latest
      expose:
      - "3306"
      volumes_from:
      - data
      environment:
          MYSQL_ROOT_PASSWORD: root

    postfix:
        image: juanluisbaptiste/postfix:latest
        expose:
       - "587"
       environment:
         SMTP_SERVER: smtp.server.com
          SMTP_USERNAME: [email protected]
         SMTP_PASSWORD: password@123
          SERVER_HOSTNAME: linuxdocker

     #  nginx:
     #   image: juanluisbaptiste/bigbluebutton-proxy
     #    ports:
     #      - "80:80"
     #      - "443:443"
     #    volumes: 
     #     - /var/run/docker.sock:/tmp/docker.sock
     #      - "/etc/localtime:/etc/localtime:ro"

    data:
       image: centos/mariadb:latest
       volumes:
       #- "./db:/var/lib/mysql"
       - /var/lib/mysql"
       - "./otrs/backup:/var/otrs/backups"
       - "./volumes/config:/opt/otrs/Kernel"
       - "/etc/localtime:/etc/localtime:ro"
       command: /bin/true

Output is

  docker-compose up
  Creating otrsrel501_postfix_1
  Creating otrsrel501_data_1
  Creating otrsrel501_mariadb_1
   Creating otrsrel501_otrs_1
  Attaching to otrsrel501_postfix_1, otrsrel501_data_1, otrsrel501_mariadb_1, otrsrel501_otrs_1
  mariadb_1  | Running mysql_install_db ...
  mariadb_1  | Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
  otrsrel501_data_1 exited with code 0
  otrs_1     | [INFO] ERROR
   otrs_1     | [WARNING] DB server still isn't up, sleeping a little bit ...
  mariadb_1  | 170131 16:51:02 [Note] /usr/libexec/mysqld (mysqld 5.5.52-MariaDB) starting as process      28 ...
  mariadb_1  | OK
  mariadb_1  | Filling help tables...
   mariadb_1  | 170131 16:51:03 [Note] /usr/libexec/mysqld (mysqld 5.5.52-MariaDB) starting as  process 37 ...
  postfix_1  | postmap: fatal: bad string length 0 < 1: mydomain =
  mariadb_1  | OK
   mariadb_1  |
  mariadb_1  | To start mysqld at boot time you have to copy
   mariadb_1  | support-files/mysql.server to the right place for your system
  mariadb_1  |
   mariadb_1  | PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
  mariadb_1  | To do so, start the server, then issue the following commands:
  mariadb_1  |
   mariadb_1  | '/usr/bin/mysqladmin' -u root password 'new-password'
   mariadb_1  | '/usr/bin/mysqladmin' -u root -h b9a40aabad25 password 'new-password'
   mariadb_1  |
    mariadb_1  | Alternatively you can run:
    mariadb_1  | '/usr/bin/mysql_secure_installation'
    mariadb_1  |
    mariadb_1  | which will also give you the option of removing the test
    mariadb_1  | databases and anonymous user created by default.  This is
    mariadb_1  | strongly recommended for production servers.
    mariadb_1  |
    mariadb_1  | See the MariaDB Knowledgebase at http://mariadb.com/kb or the
    mariadb_1  | MySQL manual for more instructions.
    mariadb_1  |
    mariadb_1  | You can start the MariaDB daemon with:
    mariadb_1  | cd '/usr' ; /usr/bin/mysqld_safe --datadir='/var/lib/mysql'
    mariadb_1  |
    mariadb_1  | You can test the MariaDB daemon with mysql-test-run.pl
    mariadb_1  | cd '/usr/mysql-test' ; perl mysql-test-run.pl
    mariadb_1  |
    mariadb_1  | Please report any problems at http://mariadb.org/jira
    mariadb_1  |
    mariadb_1  | The latest information about MariaDB is available at http://mariadb.org/.
    mariadb_1  | You can find additional information about the MySQL part at:
    mariadb_1  | http://dev.mysql.com
    mariadb_1  | Support MariaDB development by buying support/new features from MariaDB
    mariadb_1  | Corporation Ab. You can contact us about this at [email protected].
    mariadb_1  | Alternatively consider joining our community based development effort:
    mariadb_1  | http://mariadb.com/kb/en/contributing-to-the-mariadb-project/
    mariadb_1  |
    mariadb_1  | Finished mysql_install_db
    mariadb_1  | 170131 16:51:03 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
   mariadb_1  | 170131 16:51:04 mysqld_safe Starting mysqld daemon with databases from   /var/lib/mysql
    otrs_1     | [INFO] ERROR
    otrs_1     | [WARNING] DB server still isn't up, sleeping a little bit ...
    postfix_1  | /usr/lib/python2.7/site-packages/supervisor/options.py:295: 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-01-31 11:21:04,954 CRIT Supervisor running as root (no user in config file)
     postfix_1  | 2017-01-31 11:21:04,958 WARN Included extra file "/etc/supervisord.d/postfix.ini" during parsing
     postfix_1  | 2017-01-31 11:21:05,119 INFO RPC interface 'supervisor' initialized
     postfix_1  | 2017-01-31 11:21:05,135 CRIT Server 'unix_http_server' running without any HTTP  authentication checking
     postfix_1  | 2017-01-31 11:21:05,136 INFO supervisord started with pid 11
     postfix_1  | 2017-01-31 11:21:06,155 INFO spawned: 'master' with pid 14
     postfix_1  | 2017-01-31 11:21:07,191 INFO success: master entered RUNNING state, process has   stayed up for > than 0 seconds (startsecs)
     otrs_1     | [INFO] ERROR
    otrs_1     | [WARNING] DB server still isn't up, sleeping a little bit ...
    postfix_1  | 2017-01-31 11:21:08,542 INFO exited: master (exit status 1; not expected)
     otrs_1     | [INFO] ERROR
    otrs_1     | [WARNING] DB server still isn't up, sleeping a little bit ...
     otrs_1     | [INFO] ERROR
     otrs_1     | [WARNING] DB server still isn't up, sleeping a little bit ...
     otrs_1     | [INFO] ERROR
     otrs_1     | [WARNING] DB server still isn't up, sleeping a little bit ...
     otrs_1     | [INFO] ERROR

OTRS cannot install db

[INFO] Updating SMTP server on configuration file...
Enter password: ERROR 2005 (HY000): Unknown MySQL server host 'mariadb' (1)
[INFO] Creating OTRS database...
Enter password: ERROR 2005 (HY000): Unknown MySQL server host 'mariadb' (1)
[ERROR] Couldn't create OTRS database !!

This is its output.
Do you know why it is not working? I just use your dockerfile for pure fresh installation

Cant connect with DB

Hello!

I'm trying to run a stack from docker-compose.yml with default .env and I can't connect with MySQL:
otrs.Daemon.pl: DBI connect('database=otrs;host=127.0.0.1;','otrs',...) failed: Can't connect to MySQL server on '127.0.0.1' (111) at /opt/otrs/Kernel/System/DB.pm line 204.

Inside container with OTRS deamon:

Can't connect:

 mysql -u root -p -h localhost
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Can connect:

[root@cd2480e8d50c Kernel]# mysql -u root -p -h mariadb
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
....

DB otrs doesn't exist:

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

I suppose data in Config.pm are too wrong - Should be data with our variables set in .env file :

[root@cd2480e8d50c Kernel]# pwd
/opt/otrs/Kernel

[root@cd2480e8d50c Kernel]# cat Config.pm | grep -A 14 "The database host"
    # The database host
    $Self->{DatabaseHost} = '127.0.0.1';

    # The database name
    $Self->{Database} = 'otrs';

    # The database user
    $Self->{DatabaseUser} = 'otrs';

    # The password of database user. You also can use bin/otrs.Console.pl Maint::Database::PasswordCrypt
    # for crypted passwords
    $Self->{DatabasePw} = 'some-pass'; 

Please check it.

Include spamassassin

Hi there,

would it be possible to include spamassassin? There is a setting (i didn't know of) in Core::Email::PostMaster which we like to use.
So if you agree that this would be a benefit to this project I would create a pull request.

Kind Regards

Env OTRS_DB_NAME lost in some point

Hello, I have a problem when deploying the image of OTRS 6, the problem is that when I use the variable OTRS_DB_NAME at some point in the execution, its value is lost or maybe it is not being respected. For example if I have OTRS_DB_NAME=otrs3 the container executes all the steps in mysql container and creates the database otrs3 but when OTRS tries to start it tries to connect to the DB otrs and not to otrs3.

I took as a base your Dockerfile file to create my own image and that is what I use for the Stack.

config file

version: "3.2"

services:
  uat-otrs2:
    image: my-image # base your dockerfile
    environment:
    # Default first run
      - OTRS_INSTALL=no
      - OTRS_DROP_DATABASE=yes
    # DB configs
      - OTRS_DB_HOST=uat-mysql2
      - OTRS_DB_PORT=3306
      - OTRS_DB_USER=prueba
      - OTRS_DB_PASSWORD=prueba
      - OTRS_DB_NAME=otrs3
    # MySQL root pass for create de initial DB
      - MYSQL_ROOT_PASSWORD=*****

    # OTRS configs
      - OTRS_ROOT_PASSWORD=OTRSadmin
      - OTRS_LANGUAGE=es
      - OTRS_TIMEZONE=UTC
      - OTRS_NUMBER_GENERATOR=DateChecksum

    # Debug mode
      - OTRS_DEBUG=yes
...
other stuff

logs

| ERROR 1049 (42000) at line 1: Unknown database 'otrs3'
| + '[' 1 -gt 0 ']'
| + create_db
| + print_info 'Creating OTRS database...'
| + echo -e '\e[46m[INFO]\e[0m Creating OTRS database...'
| + mysql -uroot -h uat-mysql2 -P 3306 -p***** -e 'CREATE DATABASE IF NOT EXISTS otrs3;'
| [INFO] Creating OTRS database...
| + '[' 0 -gt 0 ']'
| + mysql -uroot -h uat-mysql2 -P 3306 -p**** -e ' GRANT ALL ON otrs3.* to '\''prueba'\''@'\''%'\'' identified by '\''prueba'\'''
| + '[' 0 -gt 0 ']'
| + '[' no == no ']'
| + print_info 'Loading default db schemas...'
| + echo -e '\e[46m[INFO]\e[0m Loading default db schemas...'
| [INFO] Loading default db schemas...
| + mysql -uroot -h uat-mysql2 -P 3306 -p***** otrs3
| [INFO] Loading initial db inserts...
| + '[' 0 -gt 0 ']'
| + print_info 'Loading initial db inserts...'
| + echo -e '\e[46m[INFO]\e[0m Loading initial db inserts...'
| + mysql -uroot -h uat-mysql2 -P 3306 -p***** otrs3
| [INFO] Loading initial schema constraints...
| + '[' 0 -gt 0 ']'
| + print_info 'Loading initial schema constraints...'
| + echo -e '\e[46m[INFO]\e[0m Loading initial schema constraints...'
| + mysql -uroot -h uat-mysql2 -P 3306 -p***** otrs3
| + '[' 0 -gt 0 ']'
| + print_info 'Setting password for default admin account \e[38;5;31mroot@localhost\e[0m to: \e[31mOTRSadmin\e[0m'
| [INFO] Setting password for default admin account root@localhost to: OTRSadmin
| + echo -e '\e[46m[INFO]\e[0m Setting password for default admin account \e[38;5;31mroot@localhost\e[0m to: \e[31mOTRSadmin\e[0m'
| + su -c '/opt/otrs/bin/otrs.Console.pl Admin::User::SetPassword root@localhost OTRSadmin' -s /bin/bash otrs
| [Mon Nov  5 22:41:47 2018] otrs.Console.pl: DBI connect('database=otrs;host=uat-mysql2;','prueba',...) failed: Access denied for user 'prueba'@'%' to database 'otrs' at /opt/otrs/Kernel/System/DB.pm line 204.
| ERROR: OTRS-otrs.Console.pl-Admin::User::SetPassword-10 Perl: 5.16.3 OS: linux Time: Mon Nov  5 22:41:47 2018
|
|  Message: Access denied for user 'prueba'@'%' to database 'otrs'

From what I can notice instead of using the otrs3 database some part of the script tries to use otrs.

DB

With the defined user prueba and password prueba

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| otrs3              |
+--------------------+

OTRS is starting but cant login

The container started successfully but i get these errors

`ERROR: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SystemConfigurationSyncManager-10 Perl: 5.16.3 OS: linux Time: Thu Aug 30 11:18:24 2018

Message: There was an error executing ConfigurationDeploySync: [Thu Aug 30 11:18:24 2018] otrs.Daemon.pl: DBD::mysql::st execute failed: Table 'otrs.sysconfig_deployment' doesn't exist at /opt/otrs/Kernel/System/DB.pm line 694.

ERROR: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SystemConfigurationSyncManager-10 Perl: 5.16.3 OS: linux Time: Thu Aug 30 11:18:24 2018`

Alongside with some of these

`ERROR: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SystemConfigurationSyncManager-10 Perl: 5.16.3 OS: linux Time: Thu Aug 30 11:18:24 2018

Message: There was an error executing ConfigurationDeploySync: [Thu Aug 30 11:18:24 2018] otrs.Daemon.pl: DBD::mysql::st execute failed: Table 'otrs.sysconfig_deployment' doesn't exist at /opt/otrs/Kernel/System/DB.pm line 694.

ERROR: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SystemConfigurationSyncManager-10 Perl: 5.16.3 OS: linux Time: Thu Aug 30 11:18:24 2018`

The webui opens but with 'root' and my password i set by adding -e 'OTRS_ROOT_PASSWORD'='test' i can't login. 'changeme' wont work either.

Unable to send emails from newly build images

Hi.
I am using your project source files to build image with some minor tweaks. Everything was great until recent, when I tried to upgrade to 6.14 - outgoing emails stopped sending with "SMTP authentication failed (SMTP code: 500, ErrorMessage: 500, Command unknown: 'AUTH')."
The only change is OTRS version in Dockerfile
Rolled back to 6.12 image and e-mails started working just fine.
Now for the testing:

  1. Fired up different environment
  2. Checked out commit that was used for 6.12 image build
  3. Build 6.12 image
  4. Tested outgoing e-mails - not working
  5. Imported "old" 6.12 image - e-mails are working.
    I have noticed, that images build from same source have different size:
    Build month ago:
    image
    Built today:
    image
    It seems that difference in size comes in this step 9:
    "RUN yum install -y yum-plugin-fastestmirror && yum install -y epel-release && yum update -y && yum -y install cronie httpd mysql mod_perl 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)" "perl(Apache2::Reload)" "perl(Crypt::Eksblowfish::Bcrypt)" "perl(Encode::HanExtra)" "perl(GD)" "perl(GD::Text)" "perl(GD::Graph)" "perl(JSON::XS)" "perl(Mail::IMAPClient)" "perl(PDF::API2)" "perl(DateTime)" "perl(Text::CSV_XS)" "perl(YAML::XS)" "perl(Text::CSV_XS)" "perl(DBD::mysql)" rsyslog supervisor tar which && yum install -y http://ftp.otrs.org/pub/otrs/RPMS/rhel/7/otrs-${OTRS_VERSION}.noarch.rpm && /opt/otrs/bin/otrs.CheckModules.pl && yum clean all"

Could you please confirm if the issue is reproducible

P.S. - I am using SMTPTLS and Office365 account

docker-compose build failed

There seems to be a problem with httpd package

Failed:
  httpd.x86_64 0:2.4.6-80.el7.centos

Complete!
ERROR: Service 'otrs' failed to build: The command '/bin/sh -c yum install

Remove SendmailModule config from Config.pm

Currently the default Config.pm shipped with docker-otrs locks the following OTRS vars:

$Self->{'SendmailModule'} = 'Kernel::System::Email::SMTP';
$Self->{'SendmailModule::Host'} = 'postfix';
$Self->{'SendmailModule::Port'} = '25';

This makes it impossible to use eg. Kernel::System::Email::SMTPTLS as SendmailModule or a custom SendmailModule::Host or SendmailModule::Port, as params set in Config.pm have priority over parameters set within the OTRS sysconfig (DB).

Some possible solutions:

  1. Do not add static default values via Config.pm for SendmailModule
  2. Env variable to disable the inclusion of the default SendmailModule config for the container (eg. OTRS_SENDMAIL_DEFAULT=OFF)
  3. Ability to configure all the SendMailModule parameters via container env variables

Thanks

Configure gmail

Good morning!

I really appreciate if some one could help me, I'm getting crazy trying to configure a Gmail account as my main account, but I really don't know if it is posible, I try to configure it by IMAPS(imap.gmail.com & INBOX folder) and it doesn't work.
In addition, I have checked all the security settings in GMail and IMAP is available. And also, ping imap.gmail.com and telnet imap.gmail.com 993 from container was succesufull.

Would anybody please kindly help me to solve the problem?

OTRS_TIMEZONE values

Hi i wold like to know what are the OTRS_TIMEZONE values. The only value i can see is UTC, but i like to setup to Mexico_City, how do i do that. I tried UTC-6 but it did not work. I really apreciate your help.

Docker-otrs on aws ec2 instance

Running otrs container on ec2 instance remotely results in the following error. Though ssh into ec2 instance and then running the container works fine.

sudo docker-compose -f docker-compose-prod.yml up
Starting sgcotrs_postfix_1
Starting sgcotrs_data_1
Starting sgcotrs_data-otrs_1
Starting sgcotrs_mariadb_1
Starting sgcotrs_otrs_1
Attaching to sgcotrs_data-otrs_1, sgcotrs_data_1, sgcotrs_postfix_1, sgcotrs_mariadb_1, sgcotrs_otrs_1
postfix_1 | postmap: fatal: bad string length 0 < 1: myhostname =
postfix_1 | /usr/lib/python2.7/site-packages/supervisor/options.py:295: 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 '
mariadb_1 | 161224 08:00:57 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
otrs_1 | [INFO] Enter
mariadb_1 | 161224 08:00:57 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
postfix_1 | 2016-12-24 08:00:53,561 CRIT Supervisor running as root (no user in config file)
otrs_1 | [INFO] Server is up !
postfix_1 | 2016-12-24 08:00:53,561 WARN Included extra file "/etc/supervisord.d/postfix.ini" during parsing
postfix_1 | Unlinking stale socket /var/tmp/supervisor.sock
otrs_1 | [INFO] Starting OTRS 5.0.15-01 installer !!
mariadb_1 | 161224 08:01:01 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
otrs_1 | [INFO] Starting supervisord...
postfix_1 | 2016-12-24 08:00:53,898 INFO RPC interface 'supervisor' initialized
otrs_1 | [INFO] Restarting OTRS daemon...
otrs_1 | 2016-12-24 08:01:01,846 CRIT Supervisor running as root (no user in config file)
postfix_1 | 2016-12-24 08:00:53,898 CRIT Server 'unix_http_server' running without any HTTP authentication checking
otrs_1 | Unlinking stale socket /var/tmp/supervisor.sock
postfix_1 | 2016-12-24 08:00:53,899 INFO supervisord started with pid 11
otrs_1 | 2016-12-24 08:01:02,338 INFO /var/tmp/supervisor.sock:Medusa (V1.1.1.1) started at Sat Dec 24 08:01:02 2016
otrs_1 | Hostname:
postfix_1 | 2016-12-24 08:00:54,903 INFO spawned: 'master' with pid 14
otrs_1 | Port:/var/tmp/supervisor.sock
postfix_1 | 2016-12-24 08:00:55,906 INFO success: master entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
postfix_1 | 2016-12-24 08:00:55,916 INFO exited: master (exit status 1; not expected)
otrs_1 | 2016-12-24 08:01:02,382 CRIT Running without any HTTP authentication checking
otrs_1 | 2016-12-24 08:01:02,383 INFO supervisord started with pid 10
otrs_1 | 2016-12-24 08:01:02,385 INFO spawned: 'httpd' with pid 13
otrs_1 | 2016-12-24 08:01:02,389 INFO spawned: 'crond' with pid 14
otrs_1 | 2016-12-24 08:01:02,392 INFO spawned: 'rsyslog' with pid 15
otrs_1 | 2016-12-24 08:01:02,412 INFO exited: rsyslog (exit status 1; not expected)
otrs_1 | 2016-12-24 08:01:02,413 INFO received SIGCLD indicating a child quit
sgcotrs_data-otrs_1 exited with code 0
sgcotrs_data_1 exited with code 0
otrs_1 | 2016-12-24 08:01:03,430 INFO success: httpd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
otrs_1 | 2016-12-24 08:01:03,430 INFO success: crond entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
otrs_1 | 2016-12-24 08:01:03,433 INFO spawned: 'rsyslog' with pid 16
otrs_1 | 2016-12-24 08:01:03,443 INFO exited: rsyslog (exit status 1; not expected)
otrs_1 | 2016-12-24 08:01:03,444 INFO received SIGCLD indicating a child quit
otrs_1 | otrs.Daemon.pl - the OTRS daemon
otrs_1 | Copyright (C) 2001-2016 OTRS AG, http://otrs.com/
otrs_1 |
otrs_1 | Daemon stopped
sgcotrs_mariadb_1 exited with code 0
otrs_1 | 2016-12-24 08:01:05,450 INFO spawned: 'rsyslog' with pid 26
otrs_1 | 2016-12-24 08:01:05,460 INFO exited: rsyslog (exit status 1; not expected)
otrs_1 | 2016-12-24 08:01:05,460 INFO received SIGCLD indicating a child quit
otrs_1 | otrs.Daemon.pl - the OTRS daemon
otrs_1 | Copyright (C) 2001-2016 OTRS AG, http://otrs.com/
otrs_1 |
otrs_1 | ERROR: OTRS-otrs.Daemon.pl-98 Perl: 5.10.1 OS: linux Time: Sat Dec 24 08:01:07 2016
otrs_1 |
otrs_1 | Message: Don't have write permissions in directory '/opt/otrs/var/run/':
otrs_1 |

otrs_1 | Traceback (29):
otrs_1 | Module: main::_PIDLock Line: 483
otrs_1 | Module: main::Start Line: 191
otrs_1 | Module: /opt/otrs/bin/otrs.Daemon.pl Line: 138

OTRS_DB_HOST has no affect

I've started your container with

docker run -ti \
--name otrs \
--network db \
-p 8080:80 \
-e OTRS_INSTALL=yes \
-e OTRS_DB_HOST=mariadb \
-e OTRS_DB_NAME=otrs \
-e OTRS_DB_PORT=3306 \
-e OTRS_DB_USER=otrs \
-e OTRS_DB_PASSWORD=otrs \
-e OTRS_LANGUAGE=de \
-e MYSQL_ROOT_PASSWORD=password \
juanluisbaptiste/otrs:6.0.11

the mariadb server is available and reachable in the db network. e.g. I can ping the mariadb server from the running otrs container

docker exec -ti otrs ping -c 2 mariadb
PING mariadb (10.0.1.5) 56(84) bytes of data.
64 bytes from 10.0.1.5 (10.0.1.5): icmp_seq=1 ttl=64 time=0.047 ms
64 bytes from 10.0.1.5 (10.0.1.5): icmp_seq=2 ttl=64 time=0.060 ms

--- mariadb ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 0.047/0.053/0.060/0.009 ms

but connecting otrs failed, because he try to connect to localhost instead of using mariadb


 Message: Can't connect to MySQL server on '127.0.0.1' (111)

Setting OTRS_NUMBER_GENERATOR=AutoIncrement does not work

I seem to have a repeatable issue whereby setting AutoIncrement throws an error while the config file is being set up while the container boots.

otrs_1 | ERROR: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SystemConfigurationSyncManager-10 Perl: 5.16.3 OS: linux Time: Tue Sep 11 12:28:49 2018
otrs_1 |
otrs_1 | Message: There was an error executing ConfigurationDeploySync: ERROR: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SystemConfigurationSyncManager-10 Perl: 5.16.3 OS: linux Time: Tue Sep 11 12:28:49 2018
otrs_1 |
otrs_1 | Message: No deployments found in Database!
otrs_1 |
otrs_1 | Traceback (64):
otrs_1 | Module: Kernel::System::SysConfig::ConfigurationDeploySync Line: 3730
otrs_1 | Module: (eval) Line: 129
otrs_1 | Module: Kernel::System::Daemon::DaemonModules::SystemConfigurationSyncManager::Run Line: 116
otrs_1 | Module: (eval) Line: 316
otrs_1 | Module: main::Start Line: 316
otrs_1 | Module: /opt/otrs/bin/otrs.Daemon.pl Line: 137
otrs_1 |
otrs_1 |
otrs_1 |
otrs_1 | Traceback (64):
otrs_1 | Module: Kernel::System::Daemon::DaemonModules::BaseTaskWorker::_HandleError Line: 49
otrs_1 | Module: Kernel::System::Daemon::DaemonModules::SystemConfigurationSyncManager::Run Line: 134
otrs_1 | Module: (eval) Line: 316
otrs_1 | Module: main::Start Line: 316
otrs_1 | Module: /opt/otrs/bin/otrs.Daemon.pl Line: 137
otrs_1 |

Wrong permissions of skins/*/css-cache

We have a custom skin and everytime I restart the OTRS container the permissions on the skins css-cache folder is broken. I assume it is because you are running SetPermissions script in your run.sh. I'd assume OTRS would keep this in mind but for some reason the permission is broken in our skin.

Bad (after cotnainer restart):

[root@0d1edda79228 /]# cd /opt/otrs/var/httpd/htdocs/skins/Agent/ubsimple/
[root@0d1edda79228 ubsimple]# ll
total 16
drwxrwsr-x+ 2 otrs   apache 4096 Jun  6 16:13 css
drwxrwsr-x+ 2 otrs   apache 4096 Jun 12 10:11 css-cache
drwxrwsr-x+ 2 otrs   apache 4096 Apr 26 12:54 img
drwxrwsr-x+ 3 otrs   apache 4096 Jun  6 10:15 vendor

Good (after fixing the permissions manually):

[root@0d1edda79228 /]# cd /opt/otrs/var/httpd/htdocs/skins/Agent/ubsimple/
[root@0d1edda79228 ubsimple]# ll
total 16
drwxrwsr-x+ 2 otrs   apache 4096 Jun  6 16:13 css
drwxrwsr-x+ 2 apache apache 4096 Jun 12 10:11 css-cache
drwxrwsr-x+ 2 otrs   apache 4096 Apr 26 12:54 img
drwxrwsr-x+ 3 otrs   apache 4096 Jun  6 10:15 vendor

Port Number

I am setting the parameter OTRS_DB_PORT = 50033

With debug set I am getting

++ mysqladmin ping -h xxx.xxx.xxx.xxx -P 3306 -u root --password=xxxxxxxxx --silent --connect_timeout=3

  • '[' '!' '' ']'
  • print_info 'Database server is not available. Waiting 2 seconds...'
  • echo -e '\e[46m[INFO]\e[0m Database server is not available. Waiting 2 seconds...'
  • sleep 2

Note: I have blanked out the IP address and password

Form the above looks like the OTRS_DB_PORT parameter is not changing the default port number which is remaining as 3306.

What I doing worng?

Thanks, Pete

User otrs/root is operating with the wrong locale

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.

Probably, but the locale of the user root/otrs could be changed during image-creation.

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

Please post the image version you are using (latest, 6.0.x, latest-5x, etc).

I'm on 6.0.17

[otrs@16499fa9a4af ~]$ /opt/otrs/bin/otrs.Console.pl Admin::User::SetPassword root@localhost
Error: The terminal encoding should be set to 'utf-8', but is 'ansi_x3.4-1968'. Some characters might not be displayed correctly.
[otrs@16499fa9a4af ~]$ locale charmap
ANSI_X3.4-1968

As the otrs - user is operating with wrong locale - settings the initial setup of the root@localhost-password can fail. Furthermore other operations could result in unexpected behaviour.

Expected behavior
User root/otrs uses utf-8.

OTRS 5 Support

Any plans of building docker containers with OTRS version 5?

Startup problem refferencing 127.0.0.1 instead of mariadb

I had some weird startup behavior. The docker image "default" Config.pm defined $Self->{'DatabaseHost'} = 'mariadb'; but i get an error in /var/log/httpd/error_log:
-e: DBI connect('database=otrs;host=127.0.0.1;','otrs',...) failed: Can't connect to MySQL server on '127.0.0.1' (111) at /usr/sbin/../../Kernel/System/DB.pm line 202

So the source of my problems (the system is calling 127.0.0.1 instead of mariadb) was the default OTRs configuration folder which was moved to /Kernel.

So i deleted the /Kernel copy and all system are up again. Somehow this folder don't get removed every time? I looked into the corresponding function check_host_mount_dir but i don't see how this works in the context.

[INFO] Database server is not available. Waiting 2 seconds.

root@NAS:# docker inspect juanluisbaptiste-otrs1
[
{
"Id": "a7c276f1dba5cf61496751bcc3274261450ecbf9b45e407fb93fd9ccc2723540",
"Created": "2018-05-19T06:04:25.058168702Z",
"Path": "/run.sh",
"Args": [],
"State": {
"Status": "exited",
"Running": false,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 0,
"ExitCode": 0,
"Error": "",
"StartedAt": "2018-05-20T10:59:45.714163253Z",
"FinishedAt": "2018-05-20T11:11:10.96189853Z",
"StartedTs": 1526813985,
"FinishedTs": 1526814670
},
"Image": "sha256:2eb9b6232849f3dc95d426e9ce129003e3e66f9a6053ec3e8184929675e28775",
"ResolvConfPath": "/volume1/@docker/containers/a7c276f1dba5cf61496751bcc3274261450ecbf9b45e407fb93fd9ccc2723540/resolv.conf",
"HostnamePath": "/volume1/@docker/containers/a7c276f1dba5cf61496751bcc3274261450ecbf9b45e407fb93fd9ccc2723540/hostname",
"HostsPath": "/volume1/@docker/containers/a7c276f1dba5cf61496751bcc3274261450ecbf9b45e407fb93fd9ccc2723540/hosts",
"LogPath": "/volume1/@docker/containers/a7c276f1dba5cf61496751bcc3274261450ecbf9b45e407fb93fd9ccc2723540/log.db",
"Name": "/juanluisbaptiste-otrs1",
"RestartCount": 0,
"Driver": "btrfs",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "docker-default",
"ExecIDs": null,
"HostConfig": {
"Binds": [],
"ContainerIDFile": "",
"LogConfig": {
"Type": "db",
"Config": {}
},
"NetworkMode": "bridge",
"PortBindings": {
"80/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": ""
}
]
},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"Env": [
"OTRS_INSTALL=yes",
"OTRS_LANGUAGE=en",
"OTRS_ROOT_PASSWORD=changeme",
"OTRS_DB_PORT=33306",
"OTRS_DB_HOST= 192.168.3.210",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"OTRS_VERSION=6.0.6-01",
"OTRS_ROOT=/opt/otrs/",
"OTRS_BACKUP_DIR=/var/otrs/backups",
"OTRS_CONFIG_DIR=/opt/otrs/Kernel",
"OTRS_CONFIG_MOUNT_DIR=/config/",
"SKINS_PATH=/opt/otrs//var/httpd/htdocs/skins/"
],
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 50,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": null,
"DeviceCgroupRules": null,
"DiskQuota": 0,
"KernelMemory": 0,
"MemoryReservation": 0,
"MemorySwap": -1,
"MemorySwappiness": -1,
"OomKillDisable": false,
"PidsLimit": 0,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0
},
"GraphDriver": {
"Data": null,
"Name": "btrfs"
},
"Mounts": [],
"Config": {
"Hostname": "juanluisbaptiste-otrs1",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"80/tcp": {}
},
"Tty": true,
"OpenStdin": true,
"StdinOnce": false,
"Env": [
"OTRS_INSTALL=yes",
"OTRS_LANGUAGE=en",
"OTRS_ROOT_PASSWORD=changeme",
"OTRS_DB_PORT=33306",
"OTRS_DB_HOST= 192.168.3.210",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"OTRS_VERSION=6.0.6-01",
"OTRS_ROOT=/opt/otrs/",
"OTRS_BACKUP_DIR=/var/otrs/backups",
"OTRS_CONFIG_DIR=/opt/otrs/Kernel",
"OTRS_CONFIG_MOUNT_DIR=/config/",
"SKINS_PATH=/opt/otrs//var/httpd/htdocs/skins/"
],
"Cmd": [
"/run.sh"
],
"ArgsEscaped": true,
"Image": "juanluisbaptiste/otrs:6.0.6",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": null,
"OnBuild": null,
"Labels": {
"build-date": "20180302",
"license": "GPLv2",
"name": "CentOS Base Image",
"vendor": "CentOS"
},
"DDSM": false
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "1390a3c4736f295f177f226be7c29e478b0afd7a0e83990a5dce7a3a6b763f77",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {},
"SandboxKey": "/var/run/docker/netns/1390a3c4736f",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "a363cbd561add56c5ae47c0f495941348936235cdd1f7ce6cc9d3951067bc45f",
"EndpointID": "",
"Gateway": "",
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": ""
}
}
}
}
]
root@NAS:
#

How to update? (OTRS 5s Patch Level 17)

First: I'm a docker newbie...

What I've done: Stopped all containers (3), pulled new images with docker-compose (found newer images juanluisbaptiste/otrs and juanluisbaptiste/otrs-mariadb), removed the corresponding containers, restarted all with docker-compose.

What happened: Startup looks ok, but http://$OTRS_HOSTNAME says "can't connect to mysql on 127.0.0.1". Due to panicking I can't remember my next steps exactly, but I've tried different things, the last one gives a 500/403 right away when going to http://$OTRS_HOSTNAME, something I found in /var/log/httpd/error.log:

[Tue Mar 14 11:53:20 2017] [error] [client 192.168.1.7] Directory index forbidden by Options directive: /var/www/html/
[Tue Mar 14 11:53:20 2017] -e: DBI connect('database=otrs;host=127.0.0.1;','otrs',...) failed: Can't connect to MySQL server on '127.0.0.1' (111) at /usr/sbin/../../Kernel/System/DB.pm line 202
ERROR: OTRS-CGI-98 Perl: 5.10.1 OS: linux Time: Tue Mar 14 11:53:20 2017

 Message: Can't connect to MySQL server on '127.0.0.1' (111)

 RemoteAddress: 192.168.1.7
 RequestURI: /

 Traceback (67): 
   Module: Kernel::System::Web::InterfaceAgent::Run Line: 164
   Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler Line: 40
   Module: (eval) (v1.99) Line: 204
   Module: ModPerl::RegistryCooker::run (v1.99) Line: 204
   Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 170
   Module: ModPerl::Registry::handler (v1.99) Line: 31

[Tue Mar 14 11:53:20 2017] -e: DBI connect('database=otrs;host=127.0.0.1;','otrs',...) failed: Can't connect to MySQL server on '127.0.0.1' (111) at /usr/sbin/../../Kernel/System/DB.pm line 202
ERROR: OTRS-CGI-98 Perl: 5.10.1 OS: linux Time: Tue Mar 14 11:53:20 2017

 Message: Can't connect to MySQL server on '127.0.0.1' (111)

 RemoteAddress: 192.168.1.7
 RequestURI: /

 Traceback (67): 
   Module: Kernel::System::DB::Prepare Line: 666
   Module: Kernel::System::Package::RepositoryList Line: 170
   Module: Kernel::System::OTRSBusiness::_GetOTRSBusinessPackageFromRepository Line: 909
   Module: Kernel::System::OTRSBusiness::OTRSBusinessIsInstalled Line: 113
   Module: Kernel::Output::HTML::Layout::Error Line: 1030
   Module: Kernel::Output::HTML::Layout::FatalError Line: 942
   Module: Kernel::System::Web::InterfaceAgent::Run Line: 169
   Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler Line: 40
   Module: (eval) (v1.99) Line: 204
   Module: ModPerl::RegistryCooker::run (v1.99) Line: 204
   Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 170
   Module: ModPerl::Registry::handler (v1.99) Line: 31

[Tue Mar 14 11:53:21 2017] [error] Can't call method "fetchrow_array" on an undefined value at /usr/sbin/../../Kernel/System/DB.pm line 746.\n

What I've done next: Started with an empty ./volumes/config directory, keeping the stuff in ./volumes/mysql - now everything is working again, but I've lost several (all) things I've changed via Admin -> SysConfig previously, I think.

Some documentation regarding updates would be nice!

Postfix without authentication

The postfix container exepcts SMTP_PASSWORD and SMTP_USERNAME as parameters. But our smarthost doesn't use authentication.

Can we make this optionally?

How to restore

Hi,
I made a backup of my legacy OTRS install (v5.0.27) with :
linux:/opt/otrs/scripts# ./backup.pl -d /backup/
I put the backup in the folder ./volumes/backup
When trying to restore it, I run into the following error:

mysqladmin:

 connect to server at 'mariadb' failed

error: 'Lost connection to MySQL server at 'reading initial communication packet', system error: 111'

[INFO] Database server is not available. Waiting 2 seconds...

[INFO] Database server is up !

[INFO] Restoring OTRS backup: "2018-11-08_09-34" for host 

[INFO] Updating database password on configuration file...

sed: can't read /opt/otrs/Kernel/Config.pm: No such file or directory

[INFO] Updating databse server on configuration file...

sed: can't read /opt/otrs/Kernel/Config.pm: No such file or directory

[INFO] Updating SMTP server on configuration file...

grep: /opt/otrs/Kernel/Config.pm: No such file or directory

[INFO] Adding configuration option SendmailModule with value: Kernel::System::Email::SMTP

sed: can't read /opt/otrs/Kernel/Config.pm: No such file or directory

grep: /opt/otrs/Kernel/Config.pm: No such file or directory

[INFO] Adding configuration option SendmailModule::Host with value: postfix

sed: can't read /opt/otrs/Kernel/Config.pm: No such file or directory

grep: /opt/otrs/Kernel/Config.pm: No such file or directory

[INFO] Adding configuration option SendmailModule::Port with value: 25

sed: can't read /opt/otrs/Kernel/Config.pm: No such file or directory

ERROR 1049 (42000) at line 1: Unknown database 'otrs'

[INFO] Creating OTRS database...

sed: can't read /opt/otrs/Kernel/Config.pm: No such file or directory

tar (child): /var/otrs/backups/"2018-11-08_09-34": Cannot open: No such file or directory

tar (child): Error is not recoverable: exiting now

tar: Child returned status 2

tar: Error is not recoverable: exiting now

[ERROR] Couldn't uncompress main backup file !!

My compose :

version: '3'

services:
  otrs:
    image: juanluisbaptiste/otrs:5.0.27
    build: otrs
    ports:
      - '80:80'
    depends_on:
      - mariadb
    env_file: otrs-setup.env
    volumes:
      - ./volumes/config:/opt/otrs/Kernel
      - ./volumes/skins:/opt/otrs/var/httpd/htdocs/skins/
      - ./volumes/backup:/var/otrs/backups
      - /etc/localtime:/etc/localtime:ro
  mariadb:
    image: juanluisbaptiste/otrs-mariadb:latest
    build: mariadb
    expose:
      - "3306"
    env_file: otrs-setup.env
    volumes:
      - ./volumes/mysql:/var/lib/mysql
      - /etc/localtime:/etc/localtime:ro

Cannot restore backup

Hi,

I made a backup of my OTRS install. It put it in the volume I set up as expected.

However, when trying to restore it, I run into the following error:

otrs_1     | [INFO] ERROR
otrs_1     | [WARNING] DB server still isn't up, sleeping a little bit ...
otrs_1     | [INFO] ERROR
otrs_1     | [WARNING] DB server still isn't up, sleeping a little bit ...
otrs_1     | [INFO] ERROR
otrs_1     | [WARNING] DB server still isn't up, sleeping a little bit ...
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] Restoring OTRS backup: 2017-05-16_12-55 for host 
otrs_1     | ls: cannot access /opt/otrs/Kernel/: No such file or directory
otrs_1     | [INFO] Found empty /opt/otrs/Kernel/, copying default configuration to it...
otrs_1     | [INFO] Done.
otrs_1     | ERROR 1049 (42000) at line 1: Unknown database 'otrs'
otrs_1     | [INFO] Creating OTRS database...
otrs_1     | ./functions.sh: line 86: update_config_password: command not found
otrs_1     | Restore /var/otrs/backups/2017-05-16_12-55/Config.tar.gz ...
otrs_1     | [Tue May 16 13:19:22 2017] restore.pl: DBI connect('database=otrs;host=127.0.0.1;','otrs',...) failed: Can't connect to MySQL server on '127.0.0.1' (111) at /opt/otrs/Kernel/System/DB.pm line 202
otrs_1     | ERROR: OTRS-restore.pl-10 Perl: 5.10.1 OS: linux Time: Tue May 16 13:19:22 2017
otrs_1     | 
otrs_1     |  Message: Can't connect to MySQL server on '127.0.0.1' (111)
otrs_1     | 
otrs_1     |  Traceback (39): 
otrs_1     |    Module: Kernel::System::DB::Prepare Line: 666
otrs_1     |    Module: /opt/otrs/scripts/restore.pl Line: 121
otrs_1     | 
otrs_1     | Can't call method "fetchrow_array" on an undefined value at /opt/otrs/Kernel/System/DB.pm line 746.
otrs_1     | [ERROR] Couldn't load OTRS backup !!
otrsclientruby_otrs_1 exited with code 1

Below is my docker-compose.yml file:

version: '2'
services:
  otrs:
    image: juanluisbaptiste/otrs:latest
    ports:
      - 80
    depends_on:
      - mariadb
    environment:
      - MYSQL_ROOT_PASSWORD=root
      - OTRS_ROOT_PASSWORD=root
      - OTRS_DB_PASSWORD=root
      - OTRS_INSTALL=restore
      - OTRS_BACKUP_DATE=2017-05-16_12-55
    volumes:
      - ./docker/otrs_backups:/var/otrs/backups

  mariadb:
    image: juanluisbaptiste/otrs-mariadb:latest
    expose:
    - 3306
    environment:
        MYSQL_ROOT_PASSWORD: root

Any ideas on the reason why it happens?

Thanks for your help!

OTRS_ROOT_PASSWORD is emty if not defined

The readme says:
"OTRS_ROOT_PASSWORD root@localhost user password. Default password is changeme."

If OTRS_ROOT_PASSWORD is empty it uses DEFAULT_OTRS_PASSWORD, but the variable is nowhere defined, so the password is set to nothing instead to changeme.

external database

is it able to use external database? (standalone, not docker)
thanks.

mariadb_1 | mkdir: cannot create directory '/var/lib/mysql/mysql': Permission denied

After run sudo docker-compose -f docker-compose-prod.yml up I got an error as title says.

any idea about this?

 docker-otrs git:(master) ✗ sudo docker-compose -f docker-compose-prod.yml up
Starting dockerotrs_data_1
Starting dockerotrs_postfix_1
Starting dockerotrs_data-otrs_1
Starting dockerotrs_mariadb_1
Starting dockerotrs_otrs_1
Attaching to dockerotrs_data_1, dockerotrs_postfix_1, dockerotrs_data-otrs_1, dockerotrs_mariadb_1, dockerotrs_otrs_1
dockerotrs_data_1 exited with code 0
mariadb_1    | Running mysql_install_db ...
otrs_1       | [INFO] ERROR
mariadb_1    | mkdir: cannot create directory '/var/lib/mysql/mysql': Permission denied
otrs_1       | [WARNING] DB server still isn't up, sleeping a little bit ...
mariadb_1    | Fatal error Can't create database directory '/var/lib/mysql/mysql'
mariadb_1    |
mariadb_1    | The latest information about mysql_install_db is available at
mariadb_1    | https://mariadb.com/kb/en/installing-system-tables-mysql_install_db

how best restoring 5.x branch to docker and upgrade?

as the 5.x branch differs quite profoundly from the 6.x branch in regard to the docker-compose (and I have quite some trouble getting it running) I wonder, is it possible to use the 6.x branch docker-compose.yml replace the image with juanluisbaptiste/otrs:latest-5x and do the restore, than upgrade to 6.x according to the README?

External Database

Hi,

would it be possible to add env variables for db host, user and database name?

as far as I can see this is only referenced in functions.sh.

Database Server is not available

Hey Dude,

hope you can help me out, maybe i´m just to stupid .

When i´m starting my Database OTRS is saying database server is not avaible

Output is:

sh-4.2$ sudo docker-compose -f docker-compose.yml up
Creating dockerotrs_mariadb_1
Creating dockerotrs_otrs_1
Attaching to dockerotrs_mariadb_1, dockerotrs_otrs_1
mariadb_1 | 180319 13:57:07 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
mariadb_1 | 180319 13:57:07 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
otrs_1 | [INFO] Database server is not available. Waiting 2 seconds...
otrs_1 | [INFO] Database server is not available. Waiting 2 seconds...

I Will attach you my docker-compose.yml file, hope you can help me
docker-compose.txt

Permissions on the Volumes are set

Best Regards

Masterheese

Build fails: Cannot link to a non running container

After commenting out the following lines in docker-compose.yaml since they are failing, the container won't start.

Commenting out from docker-compose.yaml:

env_file: ../docker-otrs/otrs-setup.env

And:

env_file: ../../credentials-smtp.env

Error occurs when trying to build:

$ docker-compose up
[...]
WARNING: Image for service otrs was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating dockerotrs_data-otrs_1
Creating dockerotrs_postfix_1
Creating dockerotrs_data_1
Creating dockerotrs_mariadb_1
Creating dockerotrs_otrs_1

ERROR: for otrs  Cannot start service otrs: Cannot link to a non running container: /dockerotrs_mariadb_1 AS /dockerotrs_otrs_1/dockerotrs_mariadb_1
ERROR: Encountered errors while bringing up the project.

credentials-smtp.env is missing

Hello,

file credentials-smtp.env is missing thus howto for running docker-compose should be somehow changed. Would you be so kind to add some generic credentials-smtp.env or atleast provide info about how this file should be formated?

Thank you

Fail docker-compose

When i exec :
docker-compose -f docker-compose-prod.yml -p companyotrs up

I've got reponse:
otrs_1 | standard_init_linux.go:190: exec user process caused "no such file or directory"

It seems like CLRF to LF error i'm not sure.
I'm on windows 10, Hyper-V, docker version 18.06.1-ce

Can't connect to MySQL server

Hello,

I insert Docker on a Synology DS918 +. Your packages from MariaDB and Postfix each run in a separate container. I will start your OTRS package with the following environment variables:

OTRS_HOSTNAME helpdesk.test.de
OTRS_DB_NAME otrs
OTRS_DB_USER otrs
OTRS_DB_PASSWORD qwer1234
OTRS_ROOT_PASSWORD qwer1234
MYSQL_ROOT_PASSWORD qwer1234
OTRS_LANGUAGE de
OTRS_TICKET_COUNTER 1
OTRS_NUMBER_GENERATOR AutoIncrement
OTRS_DB_HOST 192.168.178.75
OTRS_DB_PORT 3308

After starting the OTRS package, I get the following Synology-Docker log:

[INFO] Starting a clean OTRS 6.0.14-01 Free installation ready to be configured !! stdout
17:41:06 stdout
17:41:06 ls: cannot access /opt/otrs/Kernel/: No such file or directory stdout
17:41:06 [INFO] Found empty /opt/otrs/Kernel/, copying default configuration to it... stdout
17:41:27 [INFO] Done. stdout
17:41:27 [INFO] Copying default skins... stdout
17:41:30 [INFO] Done. stdout
17:41:30 [INFO] Updating configuration option DatabaseUser with value: otrs stdout
17:41:30 [INFO] Updating configuration option DatabasePw with value: qwer1234 stdout
17:41:30 [INFO] Updating configuration option DatabaseHost with value: 192.168.178.75 stdout
17:41:30 [INFO] Adding configuration option DatabasePort with value: 3308 stdout
17:41:30 [INFO] Updating configuration option Database with value: otrs stdout
17:41:30 [INFO] Adding configuration option DefaultLanguage with value: de stdout
17:41:30 [INFO] Adding configuration option FQDN with value: helpdesk.test.de stdout
17:41:30 [INFO] Adding configuration option SendmailModule with value: Kernel::System::Email::SMTP stdout
17:41:30 [INFO] Adding configuration option SendmailModule::Host with value: postfix stdout
17:41:30 [INFO] Adding configuration option SendmailModule::Port with value: 25 stdout
17:41:30 [INFO] Adding configuration option SecureMode with value: 1 stdout
17:41:30 ERROR 1049 (42000) at line 1: Unknown database 'otrs' stdout
17:41:30 [INFO] Creating OTRS database... stdout
17:41:30 [INFO] Loading default db schemas... stdout
17:41:57 [INFO] Loading initial db inserts... stdout
17:42:25 [INFO] Loading initial schema constraints... stdout
17:44:45 [INFO] Setting password for default admin account root@localhost to: qwer1234 stdout
17:44:47 Error: The terminal encoding should be set to 'utf-8', but is 'ansi_x3.4-1968'. Some characters might not be displayed correctly. stdout
17:44:47 [Fri Dec 14 17:44:47 2018] otrs.Console.pl: DBI connect('database=otrs;host=192.168.178.75;','otrs',...) failed: Can't connect to MySQL server on '192.168.178.75' (111) at /opt/otrs/Kernel/System/DB.pm line 204. stdout
17:44:47 ERROR: OTRS-otrs.Console.pl-Admin::User::SetPassword-10 Perl: 5.16.3 OS: linux Time: Fri Dec 14 17:44:47 2018 stdout
17:44:47 stdout
17:44:47 Message: Can't connect to MySQL server on '192.168.178.75' (111) stdout
17:44:47 stdout
17:44:47 Traceback (51): stdout
17:44:47 Module: Kernel::System::DB::Prepare Line: 682 stdout
17:44:47 Module: Kernel::System::Valid::ValidList Line: 74 stdout
17:44:47 Module: Kernel::System::Valid::ValidLookup Line: 120 stdout
17:44:47 Module: Kernel::System::Valid::ValidIDsGet Line: 160 stdout
17:44:47 Module: Kernel::System::User::UserSearch Line: 729 stdout
17:44:47 Module: Kernel::System::Console::Command::Admin::User::SetPassword::Run Line: 47 stdout
17:44:47 Module: (eval) Line: 460 stdout
17:44:47 Module: Kernel::System::Console::BaseCommand::Execute Line: 454 stdout
17:44:47 Module: Kernel::System::Console::InterfaceConsole::Run Line: 80 stdout
17:44:47 Module: /opt/otrs/bin/otrs.Console.pl Line: 36 stdout
17:44:47 stdout
17:44:47 ERROR: OTRS-otrs.Console.pl-Admin::User::SetPassword-10 Perl: 5.16.3 OS: linux Time: Fri Dec 14 17:44:47 2018 stdout
17:44:47 stdout
17:44:47 Message: No Valid for valid found! stdout
17:44:47 stdout
17:44:47 Traceback (51): stdout
17:44:47 Module: Kernel::System::Valid::ValidLookup Line: 139 stdout
17:44:47 Module: Kernel::System::Valid::ValidIDsGet Line: 160 stdout
17:44:47 Module: Kernel::System::User::UserSearch Line: 729

This means that OTRS can connect to the database for the installation. No more after installation. How can I fix this. Can it be that the database root is root@localhost and therefore does not get a share, because the database does not run in the same container?

Can I ignore the error message regarding utf-8?

I would be very grateful for your help.

Christmas greetings

Andreas

issues with otrs-setup.env

would it be possible to provide an example otrs-setup.env file, to ease use of the docker compose .yml files ?

restoring backup troubles

I have trouble creating a docker container from a non-docker backup. I read the docs this way, that I need to create the backup on the old installation with the script from the docker image. I copied it over together with the functions and let it run. it throw some error about not finding stop_all_services but created a backup file:

otrs-2018-09-06_12_42-full.tar.gz

I copied it to the docker server and mounted the directory with the file in it:

docker-compose.yml:

- '/srv/docker/data/otrs/backup:/var/otrs/backups'

ls -lisa /srv/docker/data/otrs/backup:

11010050       4 drwxr-xr-x 3  500   48       4096 Sep  6 15:07 .
11010049       4 drwxr-xr-x 5 root root       4096 Sep  6 11:24 ..
11012442       4 drwxrwx--- 2 root root       4096 Sep  6 12:49 2018-09-06_12-42
11012446 2356324 -rwxr-xr-x 1 root root 2412871680 Sep  6 13:36 otrs-2018-09-06_12_42-full.tar.gz

as you can see, I also tried to extract it to no avail. also, when extracting, 12_42 turns into 12-42.

anyway, this is what the otrs-setup.env looks like:

OTRS_INSTALL=restore
OTRS_BACKUP_DATE="2018-09-06_12-42"
OTRS_DROP_DATABASE=yes

and this is the error message:

 Restoring OTRS backup: "2018-09-06_12-42" for host otrs-
[INFO] Found existing configuration directory, Ok.
[INFO] Updating configuration option DatabaseUser with value: otrs
[INFO] Updating configuration option DatabasePw with value: changeme
[INFO] Updating configuration option DatabaseHost with value: mariadb
[INFO] Updating configuration option DatabasePort with value: 3306
[ERROR] Backup file does not exist !!

I am quite sure it is something small, but I just can't put my finger on it..

SIGTERM not forwarded to all processes

When attempting to shutdown the OTRS container, it takes the timeout time until the container stops because the SIGTERM signal is not processed by all processes in the container. This causes the docker daemon to perform a forced shutdown after timeout passed, potentially causing a loss of data and other issues.

Expected: Graceful shoutdown.

How to reproduce: docker-compose stop

Further reading: https://medium.com/@gchudnov/trapping-signals-in-docker-containers-7a57fdda7d86

Errors when starting containers

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: [email protected]
    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: [email protected]
     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?

otrs_backup.sh not found

Hi Juan,

First of all thank you for the great work.

When I issue 'docker exec otrs_container /opt/otrs/scripts/otrs_backup.sh' it says no such file is found.

What am I doing wrong?

Thanks.

Database Server is not available

Hi,
thank you for the provision of this image :)
I have a problem with the database which is not available when everything seems correct.
Here are the logs

DB
Running mysql_install_db ..., Installing MariaDB/MySQL system tables in '/var/lib/mysql' ..., 180425 15:01:37 [Note] /usr/libexec/mysqld (mysqld 5.5.56-MariaDB) starting as process 33 ..., OK, Filling help tables..., 180425 15:01:38 [Note] /usr/libexec/mysqld (mysqld 5.5.56-MariaDB) starting as process 40 ..., OK, , To start mysqld at boot time you have to copy, support-files/mysql.server to the right place for your system, , PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !, To do so, start the server, then issue the following commands:, , '/usr/bin/mysqladmin' -u root password 'new-password', '/usr/bin/mysqladmin' -u root -h xxxxxxx password 'new-password', , Alternatively you can run:, '/usr/bin/mysql_secure_installation', , which will also give you the option of removing the test, databases and anonymous user created by default. This is, strongly recommended for production servers., , See the MariaDB Knowledgebase at http://mariadb.com/kb or the, MySQL manual for more instructions., , You can start the MariaDB daemon with:, cd '/usr' ; /usr/bin/mysqld_safe --datadir='/var/lib/mysql', , You can test the MariaDB daemon with mysql-test-run.pl, cd '/usr/mysql-test' ; perl mysql-test-run.pl, , Please report any problems at http://mariadb.org/jira, , The latest information about MariaDB is available at http://mariadb.org/., You can find additional information about the MySQL part at:, http://dev.mysql.com, Consider joining MariaDB's strong and vibrant community:, https://mariadb.org/get-involved/, , Finished mysql_install_db, 180425 15:01:38 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'., 180425 15:01:38 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql,

OTRS:
otrs_1 | [INFO] Database server is not available. Waiting 2 seconds...
otrs_1 | [INFO] Database server is not available. Waiting 2 seconds...
otrs_1 | [INFO] Database server is not available. Waiting 2 seconds...
otrs_1 | [INFO] Database server is not available. Waiting 2 seconds...

Docker Compose

services:
otrs:
image: juanluisbaptiste/otrs:latest
build: otrs
ports:
- '80:80'
depends_on:
- mariadb
env_file: otrs-setup.env
volumes:
- './volumes/config:/opt/otrs/Kernel'
- './otrs/backup:/var/otrs/backups'
- '/etc/localtime:/etc/localtime:ro'
mariadb:
image: juanluisbaptiste/otrs-mariadb:latest
build: mariadb
expose:
- "3306"
env_file: otrs-setup.env
volumes:
- './volumes/mysql:/var/lib/mysql'
- '/etc/localtime:/etc/localtime:ro'

otrs-setup.env :
OTRS_ROOT_PASSWORD=changeme
OTRS_DB_NAME=otrs
OTRS_DB_HOST=mariadb
OTRS_DB_PORT=3306
OTRS_DB_USER=otrs
OTRS_LANGUAGE=fr

Permission :
ls -l ./volumes/mysql/
-rw-rw---- 1 27 sudo 16384 avril 25 15:01 aria_log.00000001 -rw-rw---- 1 27 sudo 52 avril 25 15:01 aria_log_control
-rw-rw---- 1 27 sudo 18874368 avril 25 15:01 ibdata1 -rw-rw---- 1 27 sudo 268435456 avril 25 15:01 ib_logfile0
-rw-rw---- 1 27 sudo 268435456 avril 25 15:01 ib_logfile1 drwx------ 2 27 sudo 4096 avril 25 15:01 mysql
srwxrwxrwx 1 27 sudo 0 avril 25 15:01 mysql.sock drwx------ 2 27 sudo 4096 avril 25 15:01 performance_schema

OTRS_DB_USER not used

functions.sh hardcodes the user as "root" and doesn't allow you to define an already created database.

Postmaster mailboxe fetching is not working

Using an existing otrs database, the postmaster mailbox fetch does not work. The otrs daemon seems to connect to our IMAP-server with an empty username (imap-login: Disconnected (no auth attempts in 0 secs): user=<>) therefore the authentication fails.

When we use a fresh otrs installation on a VM with the same existing otrs-database, the IMAP fetch works without any problems. So the problem must be related to the docker image.

Thanks

OTRS not accessible on given port

I am trying to run the image, went through docs, the only thing I left out if SMTP because even with proper configs it given me exit code 1, but I think It does not play a role in my problem...

OTRS starts correctly and I see it processing over time in the log when run locally with:

sudo docker-compose -f docker-compose-prod.yml up

my problem is that OTRS is not accessible on http://localhost:80

I made sure nothing is using that port.... Even when trying to remap ports in docker-compose-prod file it is not accessible...

I was also looking at docker ps what is the port and it is as desired, but when trying to load nothing appears there....

any ideas where this may originate ?

NOTE: for me is good enough it would be accessible like this on localhost, I only want to use it for local testing of library using its JSON API, so no need for -d detached run or some such...

Thanks 😃

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.