Hi everyone,
I have some trouble getting LibreNMS and mariadb to work on Synology Docker following this tutorial:
Synology SNMP Network Monitoring with LibreNMS Docker - Jason Loong | Tech Enthusiast, Photographer & Drummer
At the moment I get to setup: docker exec librenms setup_database
I receive an error message:
Could not connect to database, check logs/librenms.log
This is the librenms log file:
[2023-04-07T20:07:35.154979+02:00] local.ERROR: PDOException: SQLSTATE[HY000] [1045] Access denied for user âlibrenmsâ@â172.17.0.13â (using password: YES) in /opt/librenms/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:40
Stack trace:
[2023-04-07T22:37:47.122224+02:00] production.ERROR: PDOException: SQLSTATE[HY000] [1045] Access denied for user âlibrenmsâ@â172.17.0.13â (using password: YES) in /opt/librenms/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:40
Stack trace:
#0 /opt/librenms/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(40): PDO->__construct()
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(67): Doctrine\DBAL\Driver\PDOConnection->__construct()
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(46): Illuminate\Database\Connectors\Connector->createPdoConnection()
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection()
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(184): Illuminate\Database\Connectors\MySqlConnector->connect()
#5 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors{closure}()
#6 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(1064): call_user_func()
#7 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(1100): Illuminate\Database\Connection->getPdo()
#8 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(442): Illuminate\Database\Connection->getReadPdo()
#9 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(368): Illuminate\Database\Connection->getPdoForSelect()
#10 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(705): Illuminate\Database\Connection->Illuminate\Database{closure}()
#11 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(672): Illuminate\Database\Connection->runQueryCallback()
#12 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(376): Illuminate\Database\Connection->run()
#13 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2414): Illuminate\Database\Connection->select()
#14 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2402): Illuminate\Database\Query\Builder->runSelect()
#15 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2936): Illuminate\Database\Query\Builder->Illuminate\Database\Query{closure}()
#16 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2403): Illuminate\Database\Query\Builder->onceWithColumns()
#17 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(625): Illuminate\Database\Query\Builder->get()
#18 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(609): Illuminate\Database\Eloquent\Builder->getModels()
#19 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php(294): Illuminate\Database\Eloquent\Builder->get()
#20 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(474): Illuminate\Database\Eloquent\Builder->first()
#21 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(508): Illuminate\Database\Eloquent\Builder->firstOrNew()
#22 /opt/librenms/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php(23): Illuminate\Database\Eloquent\Builder->updateOrCreate()
#23 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(2132): Illuminate\Database\Eloquent\Model->forwardCallTo()
#24 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(2144): Illuminate\Database\Eloquent\Model->__call()
#25 /opt/librenms/LibreNMS/Config.php(262): Illuminate\Database\Eloquent\Model::__callStatic()
#26 /opt/librenms/LibreNMS/Config.php(460): LibreNMS\Config::persist()
#27 /opt/librenms/LibreNMS/Config.php(61): LibreNMS\Config::processConfig()
#28 /opt/librenms/app/Providers/ConfigServiceProvider.php(27): LibreNMS\Config::load()
#29 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\Providers\ConfigServiceProvider->boot()
#30 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\Container\BoundMethod::Illuminate\Container{closure}()
#31 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#32 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
#33 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(653): Illuminate\Container\BoundMethod::call()
#34 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(924): Illuminate\Container\Container->call()
#35 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(905): Illuminate\Foundation\Application->bootProvider()
#36 [internal function]: Illuminate\Foundation\Application->Illuminate\Foundation{closure}()
#37 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(906): array_walk()
#38 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\Foundation\Application->boot()
#39 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(237): Illuminate\Foundation\Bootstrap\BootProviders->bootstrap()
#40 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(310): Illuminate\Foundation\Application->bootstrapWith()
#41 /opt/librenms/LibreNMS/Util/Laravel.php(44): Illuminate\Foundation\Console\Kernel->bootstrap()
#42 /opt/librenms/includes/init.php(88): LibreNMS\Util\Laravel::bootCli()
#43 /opt/librenms/includes/sql-schema/update.php(30): require(ââŚâ)
#44 {main}
My mariadb container is on IP 172.17.0.12
My LibreNMS container IP 172.17.0.13
My Synology NAS IP 192.168.1.202
I donât use the firewall on the Synology NAS.
This is the mariadb docker setup I use:
docker run -d --name=mariadb
-p 3306:3306
-e PUID=1027
-e PGID=100
-e TZ=Europe/Brussels
-e MYSQL_ROOT_PASSWORD=SomeSecretPassword
-v /volume1/docker/mariadb:/etc/mysql/conf.d
âsql-mode=ââ
ârestart always
mariadb:latest
Using this two additional line give errors:
--innodb_file_per_table=1 \
--lower_case_table_names=0 \
I guess these enviroment settings schould defined as â-eâ be but not tested yet:
-e innodb_file_per_table=1 \
-e lower_case_table_names=0 \
This is my LibreNMS Docket setting:
docker run -d --name librenms
-p 8668:80
-e DB_HOST=libredb
-e DB_NAME=librenms
-e DB_USER=librenms
-e DB_PASS=SomeSecretPassword
-e APP_KEY=base64: PUT YOUR GENERATED APP KEY HERE
-e BASE_URL=http://192.168.1.202:8668
-e TZ=Europe/Brussels
âlink mariadb:libredb
-v /volume1/docker/librenms/logs:/opt/librenms/logs
-v /volume1/docker/librenms/rrd:/opt/librenms/rrd
-v /volume1/docker/librenms/custom.config.php:/opt/librenms/conf.d/custom.config.php:ro
ârestart always
jarischaefer/docker-librenms:latest
Any further advice is welcome.