Icinga / docker-icingadb

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

Icingadb crash with SIGSEGV #36

Closed GregorWedlich closed 2 years ago

GregorWedlich commented 3 years ago

Does anyone currently have this problem as well? I use the official docker-compose file from Icinga.

icingadb_1         | 2021-07-13T08:23:09.859Z   DEBUG   entrypoint/main.go:40   translating env vars to YAML config
icingadb_1         | 2021-07-13T08:23:09.860Z   DEBUG   entrypoint/main.go:85   checking SQL database
icingadb_1         | panic: runtime error: invalid memory address or nil pointer dereference
icingadb_1         | [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x6aa4e2]
icingadb_1         |
icingadb_1         | goroutine 1 [running]:
icingadb_1         | github.com/icinga/icingadb/pkg/config.(*Database).Open(0x0, 0xc0001821a0, 0xc0002746e0, 0x0, 0x0)
icingadb_1         |    /go/pkg/mod/github.com/icinga/icingadb@v1.0.0-rc1.0.20210528122710-9fdcc839798a/pkg/config/database.go:37 +0x82
icingadb_1         | main.initDb(0x0, 0x0)
icingadb_1         |    /entrypoint/main.go:92 +0x167
icingadb_1         | main.runDaemon(0x95fee8, 0x40d28a)
icingadb_1         |    /entrypoint/main.go:75 +0x16b
icingadb_1         | main.main()
icingadb_1         |    /entrypoint/main.go:36 +0x37
icinga_icingadb_1 exited with code 2
lippserd commented 3 years ago

We're about to fix this. I'll keep you posted.

Archarachne commented 3 years ago

Hello, any updates on this issue? :)

julianbrost commented 3 years ago

This issue shouldn't prevent you from using Icinga DB but is more about having a proper error than just crashing.

The actual problem should be that your config file is incomplete (missing a database section). This might be the case as the structure of the file changed resulting in the need to update the environment variables for the container. If you start the container as described in the Readme of this repo, that segfault shouldn't happen.

Archarachne commented 3 years ago

In the compose of this project all the environment variables seem to be provided. I tried defaults and altering env while compose is up having the same result.

  icingadb:
    environment:
      ICINGADB_MYSQL_HOST: icingadb-mysql
      ICINGADB_MYSQL_DATABASE: icingadb
      ICINGADB_MYSQL_USER: icingadb
      ICINGADB_MYSQL_PASSWORD: ${ICINGADB_MYSQL_PASSWORD:-icingadb}
      ICINGADB_REDIS_HOST: icingadb-redis
      # Icinga DB connects to Redis on port 6380 by default but we're using the Redis default port 6379 here.
      ICINGADB_REDIS_PORT: 6379

https://github.com/lippserd/docker-compose-icinga/blob/master/docker-compose.yml

lippserd commented 3 years ago

Give me some minutes, I'll push a fix.

lippserd commented 3 years ago

I updated the docker-compose repo.

tjapa commented 3 years ago

Hi, any updates?

julianbrost commented 2 years ago

Technically it's fixed now, i.e. no SIGSEGV anymore (implicitly by merging #44). I mean you won't get any useful behavior with an empty config anyways, but the new behavior isn't particularly useful either.

julianbrost commented 2 years ago

I created an issue over at the other project as that behavior primarily has to be changed there: https://github.com/Icinga/icingadb/issues/472