Icinga / docker-icingaweb2

GNU General Public License v2.0
15 stars 11 forks source link

Error starting Docker container #106

Open danelhe opened 1 year ago

danelhe commented 1 year ago

Running this command I'm getting this error:


docker run \
    -p 8080:8080 \
    -v icingaweb:/data \
    -e icingaweb.enabledModules=icingadb \
    -e icingaweb.passwords.icingaweb2.icingaadmin=123456 \
    -e icingaweb.authentication.icingaweb2.backend=db \
    -e icingaweb.authentication.icingaweb2.resource=icingaweb_db \
    -e icingaweb.config.global.config_backend=db \
    -e icingaweb.config.global.config_resource=icingaweb_db \
    -e icingaweb.config.logging.log=php \
    -e icingaweb.groups.icingaweb2.backend=db \
    -e icingaweb.groups.icingaweb2.resource=icingaweb_db \
    -e icingaweb.modules.icingadb.config.icingadb.resource=icingadb \
    -e icingaweb.modules.icingadb.redis.redis1.host=2001:db8::192.0.2.18 \
    -e icingaweb.modules.icingadb.redis.redis1.port=6379 \
    -e icingaweb.modules.icingadb.commandtransports.icinga2.transport=api \
    -e icingaweb.modules.icingadb.commandtransports.icinga2.host=2001:db8::192.0.2.9 \
    -e icingaweb.modules.icingadb.commandtransports.icinga2.username=root \
    -e icingaweb.modules.icingadb.commandtransports.icinga2.password=123456 \
    -e icingaweb.resources.icingaweb_db.type=db \
    -e icingaweb.resources.icingaweb_db.db=mysql \
    -e icingaweb.resources.icingaweb_db.host=2001:db8::192.0.2.13 \
    -e icingaweb.resources.icingaweb_db.dbname=icingaweb \
    -e icingaweb.resources.icingaweb_db.username=icingaweb \
    -e icingaweb.resources.icingaweb_db.password=123456 \
    -e icingaweb.resources.icingaweb_db.charset=utf8mb4 \
    -e icingaweb.resources.icingadb.type=db \
    -e icingaweb.resources.icingadb.db=mysql \
    -e icingaweb.resources.icingadb.host=2001:db8::192.0.2.113 \
    -e icingaweb.resources.icingadb.dbname=icingadb \
    -e icingaweb.resources.icingadb.username=icingaweb \
    -e icingaweb.resources.icingadb.password=123456 \
    -e icingaweb.resources.icingadb.charset=utf8mb4 \
    -e icingaweb.roles.Administrators.users=icingaadmin \
    -e icingaweb.roles.Administrators.permissions='*' \
    -e icingaweb.roles.Administrators.groups=Administrators \
    icinga/icingaweb2
[Fri Jan 20 21:52:04.108760896 2023] [docker_entrypoint:info] [pid 1] DOCKERE: Initializing /data as we're the init process
[Fri Jan 20 21:52:04.110432459 2023] [docker_entrypoint:debug] [pid 1] DOCKERE: Creating "/data/etc/icingaweb2/enabledModules"
[Fri Jan 20 21:52:04.110445641 2023] [docker_entrypoint:debug] [pid 1] DOCKERE: Creating "/data/var/lib/icingaweb2"
[Fri Jan 20 21:52:04.110450468 2023] [docker_entrypoint:debug] [pid 1] DOCKERE: Translating env vars to .ini config
[Fri Jan 20 21:52:04.110607764 2023] [docker_entrypoint:trace1] [pid 1] DOCKERE: Writing "/data/etc/icingaweb2/modules/icingadb/redis.ini"
[Fri Jan 20 21:52:04.110777062 2023] [docker_entrypoint:trace1] [pid 1] DOCKERE: Writing "/data/etc/icingaweb2/roles.ini"
[Fri Jan 20 21:52:04.110873683 2023] [docker_entrypoint:trace1] [pid 1] DOCKERE: Writing "/data/etc/icingaweb2/modules/icingadb/config.ini"
[Fri Jan 20 21:52:04.110946801 2023] [docker_entrypoint:trace1] [pid 1] DOCKERE: Writing "/data/etc/icingaweb2/config.ini"
[Fri Jan 20 21:52:04.111138371 2023] [docker_entrypoint:trace1] [pid 1] DOCKERE: Writing "/data/etc/icingaweb2/groups.ini"
[Fri Jan 20 21:52:04.111255376 2023] [docker_entrypoint:trace1] [pid 1] DOCKERE: Writing "/data/etc/icingaweb2/resources.ini"
[Fri Jan 20 21:52:04.11205993 2023] [docker_entrypoint:trace1] [pid 1] DOCKERE: Writing "/data/etc/icingaweb2/modules/icingadb/commandtransports.ini"
[Fri Jan 20 21:52:04.112172803 2023] [docker_entrypoint:trace1] [pid 1] DOCKERE: Writing "/data/etc/icingaweb2/authentication.ini"
[Fri Jan 20 21:52:04.112255293 2023] [docker_entrypoint:debug] [pid 1] DOCKERE: Enabling/disabling modules
[Fri Jan 20 21:52:04.112356227 2023] [docker_entrypoint:info] [pid 1] DOCKERE: Checking database resources used as backends
[Fri Jan 20 21:52:04.246331154 2023] [docker_entrypoint:debug] [pid 1] DOCKERE: Checking database resource "icingaweb_db"
ERROR: PDOException in /usr/share/icingaweb2/modules/setup/library/Setup/Utils/DbTool.php:352 with message: SQLSTATE[HY000] [2002] Connection refused
[Fri Jan 20 21:52:04.369403399 2023] [docker_entrypoint:crit] [pid 1] DOCKERE: exit status 1

I have already started all the containers listed here:

Also the IcingaDB container keeps restarting with this error:

2023-01-20 16:02:45 main.run
2023-01-20 16:02:45     /github/workspace/cmd/icingadb/main.go:89
2023-01-20 16:02:45 main.main
2023-01-20 16:02:45     /github/workspace/cmd/icingadb/main.go:40
2023-01-20 16:02:45 runtime.main
2023-01-20 16:02:45     /usr/local/go/src/runtime/proc.go:250
2023-01-20 16:02:45 runtime.goexit
2023-01-20 16:02:45     /usr/local/go/src/runtime/asm_amd64.s:1571
2023-01-20 16:03:45 2023-01-20T22:03:45.774Z    DEBUG   entrypoint/main.go:40   translating env vars to YAML config
2023-01-20 16:03:45 2023-01-20T22:03:45.775Z    DEBUG   entrypoint/main.go:85   checking SQL database
2023-01-20 16:03:45 2023-01-20T22:03:45.781Z    DEBUG   entrypoint/main.go:79   starting actual daemon via exec(3)
2023-01-20 16:03:45 2023-01-20T22:03:45.843Z    INFO    icingadb        Starting Icinga DB
2023-01-20 16:03:45 2023-01-20T22:03:45.843Z    INFO    icingadb        Connecting to database at 'mariadb-icingadb:3306'
2023-01-20 16:03:45 2023-01-20T22:03:45.846Z    INFO    icingadb        Connecting to Redis at 'redis-icingadb:6379'
2023-01-20 16:03:45 2023-01-20T22:03:45.849Z    FATAL   icingadb        ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
2023-01-20 16:03:45 can't connect to Redis
Al2Klimov commented 1 year ago

I have already started all the containers listed here:

And the database(s)?

danelhe commented 1 year ago

I have already started all the containers listed here:

And the database(s)?

If you mean the containers with the databases listed here, yes I have https://hub.docker.com/r/icinga/icingadb

Al2Klimov commented 1 year ago

I mean MySQL/Postgres

Al2Klimov commented 1 year ago

E.g. as here:

https://github.com/lippserd/docker-compose-icinga/blob/4bf4395d1959eca2608fdbeefcf616786f26f206/docker-compose.yml#L160-L171

Btw. this repo is a good big picture example of an Icinga Docker setup.

laszloszurok commented 1 year ago

In the icingadb example here: https://hub.docker.com/r/icinga/icingadb icingadb is started with this env var: ICINGADB_REDIS_PASSWORD=123456, but redis is started without any password set. That is the cause of this error: ERR AUTH <password> called without any password configured for the default user. I just removed this env var from the startup command to solve the issue.

Al2Klimov commented 6 months ago

-e icingaweb.resources.icingaweb_db.host=2001:db8::192.0.2.13 \

I'm afraid both subnets (2001:db8::/32, 192.0.2.0/24) are just example ones. You'll have to run a database container as well: