lippserd / docker-compose-icinga

docker-compose Icinga stack
92 stars 85 forks source link

IncingaWeb won't start because of missing mysql schema #40

Closed dirkey closed 1 year ago

dirkey commented 1 year ago

If I deploy the docker-compose file, icinga web will be exit with error code 1. It seems there is the schema file missing:

icingaweb_1 | [Sun Jan 29 12:40:41.274446306 2023] [docker_entrypoint:debug] [pid 1] DOCKERE: Checking database resource "icingaweb-mysql" icingaweb_1 | [Sun Jan 29 12:40:41.320286678 2023] [docker_entrypoint:debug] [pid 1] DOCKERE: Importing schema into database resource "icingaweb-mysql" icingaweb_1 | ERROR: RuntimeException in /usr/share/icingaweb2/library/Icinga/Util/File.php:39 with message: SplFileObject::__construct(/usr/share/icingaweb2/etc/schema/mysql.schema.sql): failed to open stream: No such file or directory icingaweb_1 | [Sun Jan 29 12:40:41.365987191 2023] [docker_entrypoint:crit] [pid 1] DOCKERE: exit status 1

lippserd commented 1 year ago

Hi,

Thanks for the report. Will be fixed w/ this PR.

All the best, Eric

Belgeron commented 1 year ago

I have the same problem just with pgsql, the problem is a path mismatch.

/usr/share/icingaweb2/etc/schema/mysql.schema.sql <- wrong, must be /usr/share/icingaweb2/schema/mysql.schema.sql

The problem comes from the icingaweb2 Container File: /entrypoint-db-init/application/clicommands/DbCommand.php

Line 59: ->get('schema', 'path', Icinga::app()->getBaseDir('etc/schema')) . "/{$db->dbType}.schema.sql"

I copied the file our of the container, removed the etc/ from getBaseDir an it worked.

After that was fixed you will get another error with permission denied from apache /var/log/apache2/error.log.

dirkey commented 1 year ago

New incinga web image is working!