Icinga / docker-icingadb

GNU General Public License v2.0
3 stars 5 forks source link

Inconsistent password options between containers in README #51

Open danielbierstedt opened 2 years ago

danielbierstedt commented 2 years ago

Anybody experiencing this during startup?

FATAL icingadb ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?

julianbrost commented 2 years ago

Sounds like you have specified a Redis password in the Icinga DB configuration but not in Redis (or maybe forgot to restart Redis after updating the configuration). Redis actively rejects passwords if none is configured on the server.

danielbierstedt commented 2 years ago

Thanks for the hint. I was following the official Icinga Docker instructions, where the icingadb gets an "icingadb-redis-password" argument. I just left that out and the container starts. Will investigate further, thank you.

julianbrost commented 2 years ago

ICINGADB_REDIS_PASSWORD is only required if Redis is configured to require a password. Otherwise just omit it.

For MySQL/MariaDB, the Readme actually specifies a password in the options for the other container, but not for Redis (where it doesn't seem to be possible to do this by just setting an environment variable, unfortunately). Could be a bit more consistent.

danielbierstedt commented 2 years ago

Got a few steps further and now working on icingaweb2. The web setup module does not continue at redis configuration. I provides the redis host (the container) and port, but left the password empty (there is none). But web says "failed to connect to redis: connection refused". Looks like a password is necessary if I want to run the complete icinga2 stack...

julianbrost commented 2 years ago

Connection refused has nothing to do with password checks. If that happens, something went wrong before it even had the chance to send a password. Take extra care with the port numbers: 6379 (Redis default, used in the Redis Docker image) vs. 6380 (used by the icingadb-redis packages and therefore the default in other components)

danielbierstedt commented 2 years ago

Thanks, I am paying attention to the port numbers.

Redis: 1:M 26 Jul 2022 12:20:21.934 * Running mode=standalone, port=6379.

icingadb: docker run --network icinga --name icingadb -e ICINGADB_REDIS_HOST=redis-icingadb -e ICINGADB_REDIS_PORT=6379 -e ICINGADB_DATABASE_HOST=mariadb-icingadb -e ICINGADB_DATABASE_PORT=3306 -e ICINGADB_DATABASE_DATABASE=icingadb -e ICINGADB_DATABASE_USER=icingadb -e ICINGADB_DATABASE_PASSWORD=icingadb icinga/icingadb

2022-07-26T12:30:00.846Z INFO icingadb Starting Icinga DB 2022-07-26T12:30:00.847Z INFO icingadb Connecting to database 2022-07-26T12:30:00.847Z INFO icingadb Connecting to Redis 2022-07-26T12:30:00.847Z WARN redis Can't connect to Redis. Retrying {"error": "dial tcp 127.0.0.1:6379: connect: connection refused"}

Looks like the ICINGADB_REDIS_HOST option is being ignored.

When: docker run --network icinga --name icingadb -e ICINGADB_REDIS_ADDRESS=redis-icingadb:6379 -e ICINGADB_DATABASE_HOST=mariadb-icingadb -e ICINGADB_DATABASE_PORT=3306 -e ICINGADB_DATABASE_DATABASE=icingadb -e ICINGADB_DATABASE_USER=icingadb -e ICINGADB_DATABASE_PASSWORD=icingadb icinga/icingadb

2022-07-26T12:34:52.043Z INFO icingadb Starting Icinga DB 2022-07-26T12:34:52.043Z INFO icingadb Connecting to database 2022-07-26T12:34:52.043Z INFO icingadb Connecting to Redis 2022-07-26T12:34:55.046Z INFO icingadb Waiting for current Redis schema version

No info about host or port, see no connection incoming on the redis host.

julianbrost commented 2 years ago

You can have a look at https://github.com/lippserd/docker-compose-icinga/blob/master/docker-compose.yml#L123-L136 for a working example. Also make sure you're using the latest version of the image (i.e. run docker pull).

danielbierstedt commented 2 years ago

Julian, I owe you some beers! Image update did it. THANK YOU.

strajansebastian commented 1 year ago

I think I hit the same problem.

After removing -e ICINGADB_REDIS_PASSWORD=123456 \ from the icingadb docker run command in started working.

The icingadb run command shouldn't have the redis password set if the docker run redis commands doesn't have it specified at startup.

Zottel92 commented 10 months ago

Would it maybe make sense to switch the example from redis to bitnami/redis? Their redis container allows for a env-var based password configuration.