Closed uktricky closed 2 years ago
MariaDB Server version: 10.4.12-MariaDB-1:10.4.12+maria~bionic mariadb.org binary distribution
For reference everything installed fine on release :1.69
Try connecting from the LibreNMS container to the database container using the command line.
docker exec -it librenms bash
echo $DB_HOST
, echo $DB_USER
and echo $DB_PASS
. Make sure the values are correctmysql --host=$DB_HOST -u $DB_USER -p
and enter the passwordThis should help determine whether there is a communication problem between the containers or a misconfiguration.
So created a new Standalone DB and Standalone LibreNMS as per below... Still Database create error No connection errors / issues ... v1.69 works perfectly
** Volumes for persistent data mkdir /volume1/docker/xxmariadb mkdir /volume1/docker/xxlibrenms mkdir /volume1/docker/xxlibrenms/logs mkdir /volume1/docker/xxlibrenms/rrd mkdir /volume1/docker/xxlibrenms/weathermap mkdir /volume1/docker/xxlibrenms/weathermap/configs mkdir /volume1/docker/xxlibrenms/weathermap/output touch /volume1/docker/xxlibrenms/custom.config.php
** Docker MariaDB Installation docker run \ -d \ --net RT-Network \ --ip 10.1.3.16 \ -h WLC-MARIADB2 \ -e TZ=Europe/London \ -e MYSQL_ROOT_PASSWORD=password2020 \ -p 3306:3306 \ -v /volume1/docker/xxmariadb:/var/lib/mysql \ --name xxmariadb \ --restart unless-stopped \ mariadb:latest --sql-mode=''
docker exec -it xxmariadb mysql -u root -p
Hi, I have the same issue using mysql database.
`root@29b06f567386:/opt/librenms# mysql --host=$DB_HOST -u $DB_USER -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 34 Server version: 8.0.23 MySQL Community Server - GPL
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> ^DBye root@29b06f567386:/opt/librenms# ` This shows that there is no issue to connect to the database. One thing I noticed when creating and deleting the librenms database is that it is working just fine manually but the time it takes to do it is far more then 60 secs.
My question now, can you please make the timeout as a variable that we can give with the enviroment variables? This parameter is available in official librenms it seems.
Many thanks for all your work
I did some more testing and I did a manual delete of the librenms database directly on the mysql container and even the delete took 1 minute and 24 secs. This is over the 60 seconds timeout coming from librenms. Here is some more info
`root@mysql:/# mysql -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 224 Server version: 8.0.23 MySQL Community Server - GPL
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | librenms | | mysql | | performance_schema | | sys | +--------------------+ 5 rows in set (0.50 sec)
mysql> drop database librenms; Query OK, 135 rows affected (1 min 24.73 sec) `
I just grepped through some source files and have not conducted an in-depth analysis yet. Unfortunately, I do not see an easy way to fix this without sacrificing Laravel's database migrations. As far as I can tell, Laravel's classes (e.g. Illuminate\Database\Schema\MySqlSchemaState
) do not pass a timeout argument and the default in Symfony's Process.php
is 60 seconds.
Perhaps I can help fix this upstream (in Laravel), but it will probably take time to 1) fix in Laravel 2) wait until LibreNMS uses that Laravel version 3) create a new image.
OK thanks will stick at 1.69 for now
@uktricky This should be fixed, see https://github.com/laravel/framework/pull/36126
Using docker run \
when I run the "docker exec librenms setup_database" I get: In Process.php line 1201:
The process "mysql --host="${:LARAVEL_LOAD_HOST}" --port="${:LARAVEL_LOAD_P ORT}" --user="${:LARAVEL_LOAD_USER}" --password="${:LARAVEL_LOAD_PASSWORD}" --database="${:LARAVEL_LOAD_DATABASE}" < "${:LARAVEL_LOAD_PATH}"" exceeded the timeout of 60 seconds.
running mariadb in a different docker session on same network zabbix also in same docker without issues against the database
I previously had librenms running for months but messed up a distributed poller setup so dropped the database (librenms) and the associated user etc. removed the docker and even the image recreated the database/user and permissions then ran the above installation
But getting the database error?!