Failed to create rrd directory error

Hello, I upgraded today from version 23.1.1 to 23.11.0

Since then I am getting a strange error on all the devices in monitoring
Failed to create rrd directory: /opt/app/librenms-slsp/github/rrd//router1
The error appears every 5 minutes when the poller is running.

The thing is this looks to be cosmetic error only. All devices seem to be monitored correctly.I tried deleting and adding a device and everything worked flawlessly

We have a specific “installation” of librenms -
1 main server with databese, rrd and web
non default install path - /opt/app/librenms-slsp/github with a simlink to /opt/librenms

6 pollers runnig docker version of 23.11.0

On the pollers I see this errors:
ErrorException: mkdir(): No such file or directory in /opt/librenms/LibreNMS/Poller.php:247
Stack trace:
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(254): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap{closure}()
#2 /opt/librenms/app/Providers/ErrorReportingProvider.php(199): call_user_func()
#3 [internal function]: App\Providers\ErrorReportingProvider->handleError()
#4 /opt/librenms/LibreNMS/Poller.php(247): mkdir()
#5 /opt/librenms/LibreNMS/Poller.php(239): LibreNMS\Poller->initRrdDirectory()
#6 /opt/librenms/LibreNMS/Poller.php(92): LibreNMS\Poller->initDevice()
#7 /opt/librenms/app/Console/Commands/DevicePoll.php(44): LibreNMS\Poller->poll()
#8 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\Console\Commands\DevicePoll->handle()
#9 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container{closure}()
#10 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#11 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
#12 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call()
#13 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(208): Illuminate\Container\Container->call()
#14 /opt/librenms/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute()
#15 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(178): Symfony\Component\Console\Command\Command->run()
#16 /opt/librenms/vendor/symfony/console/Application.php(1081): Illuminate\Console\Command->run()
#17 /opt/librenms/vendor/symfony/console/Application.php(320): Symfony\Component\Console\Application->doRunCommand()
#18 /opt/librenms/vendor/symfony/console/Application.php(174): Symfony\Component\Console\Application->doRun()
#19 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\Component\Console\Application->run()
#20 /opt/librenms/app/Console/Kernel.php(66): Illuminate\Foundation\Console\Kernel->handle()
#21 /opt/librenms/lnms(39): App\Console\Kernel->handle()
#22 {main}

On the main server:
./validate.php

Component Version
LibreNMS 23.11.0 (2023-12-15T13:53:52+01:00)
DB Schema 2023_11_04_125846_packages_increase_name_column_length (273)
PHP 8.2.12
Python 3.6.8
Database MariaDB 10.3.39-MariaDB
RRDTool 1.7.0
SNMP 5.8
===========================================

[OK] Installed from package; no Composer required
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK] Database and column collations are correct
[OK] Database schema correct
[OK] MySQl and PHP time match
[OK] Distributed Polling setting is enabled globally
[OK] Connected to rrdcached
[OK] Active pollers found
[OK] Dispatcher Service is enabled
[OK] Locks are functional
[OK] Python wrapper cron entry is not present
[OK] Redis is functional
[WARN] IPv6 is disabled on your server, you will not be able to add IPv6 devices.
[OK] rrdtool version ok
[OK] Connected to rrdcached
[FAIL] Scheduler is not running
[FIX]:
sudo sh -c ‘sed “s#/opt/librenms#/opt/app/librenms-slsp/github#” /opt/app/librenms-slsp/github/dist/librenms-scheduler.service > /etc/systemd/system/librenms-scheduler.service’
sudo sh -c ‘sed “s#/opt/librenms#/opt/app/librenms-slsp/github#” /opt/app/librenms-slsp/github/dist/librenms-scheduler.timer > /etc/systemd/system/librenms-scheduler.timer’
sudo systemctl enable librenms-scheduler.timer
sudo systemctl start librenms-scheduler.timer
[WARN] Non-git install, updates are manual or from package

Have you tried just setting install_dir to your custom path rather than symlinking?

Hello thanks for the info, I changed the install_dir on the main server to the correct path. I didn’t find this parameter in documentation, so I used symlink instead.

But this didn’t help. I am still getting the same error in the application.

1 Like

Hello @MOJr

I assume, your problem is with the permissions in the filesystem.

Just in case, reconfigure them as they originally were after the original installation.

chown -R librenms:librenms /opt/librenms
chmod 771 /opt/librenms
setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
setfacl -R -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/

The first two lines are not strictly necessary, but applying them will not negatively affect you.

Likewise, I assume that when you installed, you created the “librenms” user as the official installation guides indicate.

The final two lines that I share with you are the ones that affect your RRD folders, where the error indicates that it cannot write.

I hope setting permissions is your solution.

Kind regards. :sunglasses:
.

Yes I installed it by the guide, only changing the directory. Everything was working before upgrade.
I already tried to reset the permission with no fix. I tried it just now again with also using -R for the first setfacl command without succes.

The file permission look like this:

# file: rrd/router1
# owner: librenms
# group: librenms
user::rwx
group::r-x
other::r-x
default:user::rwx
default:group::rwx
default:other::r-x

As I said before, the librenms seems to be working fine. When I delete the device the rrd folder is correctly deleted and when I add it back again it is created. All the graph data are populated. But in all the device logs I still get the messages.

2023-12-17 16:16:38		Failed to create rrd directory: /opt/app/librenms-slsp/github/rrd//router1/

I have almost same error as described:
ErrorException: mkdir(): Permission denied in /opt/librenms/LibreNMS/Poller.php:247
Stack trace:
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(254): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap{closure}()
#2 /opt/librenms/app/Providers/ErrorReportingProvider.php(199): call_user_func()
#3 [internal function]: App\Providers\ErrorReportingProvider->handleError()
#4 /opt/librenms/LibreNMS/Poller.php(247): mkdir()
#5 /opt/librenms/LibreNMS/Poller.php(239): LibreNMS\Poller->initRrdDirectory()
#6 /opt/librenms/LibreNMS/Poller.php(92): LibreNMS\Poller->initDevice()
#7 /opt/librenms/app/Console/Commands/DevicePoll.php(44): LibreNMS\Poller->poll()
#8 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\Console\Commands\DevicePoll->handle()
#9 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container{closure}()
#10 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#11 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
#12 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call()
#13 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(208): Illuminate\Container\Container->call()
#14 /opt/librenms/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute()
#15 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(178): Symfony\Component\Console\Command\Command->run()
#16 /opt/librenms/vendor/symfony/console/Application.php(1081): Illuminate\Console\Command->run()
#17 /opt/librenms/vendor/symfony/console/Application.php(320): Symfony\Component\Console\Application->doRunCommand()
#18 /opt/librenms/vendor/symfony/console/Application.php(174): Symfony\Component\Console\Application->doRun()
#19 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\Component\Console\Application->run()
#20 /opt/librenms/app/Console/Kernel.php(66): Illuminate\Foundation\Console\Kernel->handle()
#21 /opt/librenms/lnms(39): App\Console\Kernel->handle()
#22 {main}
using docker image [23.11.0]
reverted to docker image [23.9.1]
and that solved the issue with populating logs with messages like:
“Failed to create rrd directory: /opt/librenms/rrd/someipaddressofthedevice/”

Hello thanks, I can confirm that after reverting the docker image to 23.9.1 the issues stopped.

I created an github issue: Failed to create rrd directory error · Issue #411 · librenms/docker · GitHub

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.