juanluisbaptiste / docker-otrs

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

Service 'mariadb' failed to build: unable to find user #101

Closed saijojoe closed 3 years ago

saijojoe commented 3 years ago

A mariadb container is created (I can see it), but it's not running, and I get this error:

ERROR: Service 'mariadb' failed to build: unable to find user [REDACTED]: no matching entries in passwd file

Describe the issue I'm running sudo docker-compose build to try to get everything up and running. You can see the output below.

Expected behavior I expected it to create the mysql username per the .env file entry.

Image/OTRS versions: Latest, 6.0.x

docker-compose.yml:

version: '3'

services:
  otrs:
    image: juanluisbaptiste/otrs:latest
    build: otrs
    ports:
      - '80:80'
    # If running behind a proxy container, expose the ports instead
    # and link the proxy container to this one.
    #  expose:
    #  - "80"
    depends_on:
      - mariadb
      - postfix
    env_file: .env
    volumes:
      - './volumes/config:/opt/otrs/Kernel'
      # Uncomment if using OTRS_ARTICLE_STORAGE_TYPE=ArticleStorageFS
      #- ./volumes/article:/opt/otrs/var/article
      - ./volumes/skins:/opt/otrs/var/httpd/htdocs/skins/
      - './volumes/backup:/var/otrs/backups'
      - './volumes/addons:/opt/otrs/addons'
      - ./volumes/db_upgrade:/opt/otrs/db_upgrade
      - '/etc/localtime:/etc/localtime:ro'
  mariadb:
    image: juanluisbaptiste/otrs-mariadb:latest
    build: mariadb
    expose:
      - "3306"
    env_file: .env
    volumes:
      - './volumes/mysql:/var/lib/mysql'
      - '/etc/localtime:/etc/localtime:ro'
  postfix:
    image: juanluisbaptiste/postfix:latest
    expose:
      - '25'
    # See juanluisbaptiste/postfix github page for the contents
    # and an explanation of credentials-smtp.
    env_file: .env

.env:

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

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

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

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

# Database user. Default is otrs.
OTRS_DB_USER=[REDACTED]

# otrs user database password. Default password is changeme
OTRS_DB_PASSWORD=[REDACTED]

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

# Database root password so it can be setup. Default password is changeme.
MYSQL_ROOT_PASSWORD=[REDACTED]

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

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

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

#OTRS_BACKUP_DATE=

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

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

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

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

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

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

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

# root@localhost user password. Default password is changeme
OTRS_ROOT_PASSWORD=[REDACTED]

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

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

# Sets the default timezone.
OTRS_TIMEZONE=UTC

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

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

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

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

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

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

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

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

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

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

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

# Server address of the SMTP server to use.
OTRS_SMTP_SERVER=smtp.gmail.com

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

# Username to authenticate with.
OTRS_SMTP_USERNAME=[REDACTED]

# Password of the SMTP user.
OTRS_SMTP_PASSWORD=[REDACTED]

startup output w/OTRS_DEBUG=yes:

postfix uses an image, skipping
Building mariadb
Step 1/5 : FROM mariadb:10.1
 ---> ed7a4afc451e
Step 2/5 : LABEL maintainer="Juan Luis Baptiste <juan.baptiste@gmail.com>"
 ---> Using cache
 ---> 85395a276e94
Step 3/5 : ENV MYSQL_ROOT_PASSWORD [REDACTED]
 ---> Using cache
 ---> 10b62c6b3de9
Step 4/5 : USER aquaroot
 ---> Using cache
 ---> f805f3d941d7
Step 5/5 : RUN echo "[mysqld]" >> /etc/mysql/conf.d/otrs.cnf &&    echo "max_allowed_packet=64M" >> /etc/mysql/conf.d/otrs.cnf &&    echo "query_cache_size=32M" >> /etc/mysql/conf.d/otrs.cnf &&    echo "innodb_log_file_size=256M" >> /etc/mysql/conf.d/otrs.cnf &&    echo "skip-character-set-client-handshake" >> /etc/mysql/conf.d/otrs.cnf &&    echo "init-connect='SET NAMES utf8'" >> /etc/mysql/conf.d/otrs.cnf &&    echo "init_connect='SET collation_connection = utf8_unicode_ci'" >> /etc/mysql/conf.d/otrs.cnf &&    echo "collation-server = utf8_general_ci" >> /etc/mysql/conf.d/otrs.cnf &&    echo "character-set-server = utf8" >> /etc/mysql/conf.d/otrs.cnf
 ---> Running in 13ff9e9036aa
ERROR: Service 'mariadb' failed to build: unable to find user [REDACTED]: no matching entries in passwd file

Thanks for any help!

juanluisbaptiste commented 3 years ago

Hi @saijojoe ,

That setting is used when you are using an external database, when using the official mariadb (from which this project's db is based on) the root user is named root.

juanluisbaptiste commented 3 years ago

I just updated the documentation so this is clear.

saijojoe commented 3 years ago

Thanks!