Maintenance:cleanup-syslog issues, 2 errors in librenms.log

Those two errors occur every 24 hours.

[2025-12-02T03:30:00][CRITICAL] Exception: Exception Scheduled command [‘/usr/bin/php’ ‘artisan’ maintenance:cleanup-syslog] faile
d with exit code [1]. @ /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php:207
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/View/Components/Task.php(41): Illuminate\Console\Scheduling\Sched
uleRunCommand->Illuminate\Console\Scheduling{closure}()
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/View/Components/Factory.php(59): Illuminate\Console\View\Componen
ts\Task->render()
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php(191): Illuminate\Console\View\C
omponents\Factory->__call()
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php(162): Illuminate\Console\Schedu
ling\ScheduleRunCommand->runEvent()
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php(132): Illuminate\Console\Schedu
ling\ScheduleRunCommand->runSingleServerEvent()
#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Console\Scheduling\ScheduleRunC
ommand->handle()
#6 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Util.php(43): Illuminate\Container\BoundMethod::Illuminate\Cont
ainer{closure}()
#7 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(96): Illuminate\Container\Util::unwrapIfClosure
()
#8 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoun
dMethod()
#9 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(836): Illuminate\Container\BoundMethod::call()
#10 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\Container\Container->call()
#11 /opt/librenms/vendor/symfony/console/Command/Command.php(318): Illuminate\Console\Command->execute()
#12 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\Component\Console\Command\Command->run
()
#13 /opt/librenms/vendor/symfony/console/Application.php(1073): Illuminate\Console\Command->run()
#14 /opt/librenms/vendor/symfony/console/Application.php(356): Symfony\Component\Console\Application->doRunCommand()
#15 /opt/librenms/vendor/symfony/console/Application.php(195): Symfony\Component\Console\Application->doRun()
#16 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(197): Symfony\Component\Console\Application->run()
#17 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1235): Illuminate\Foundation\Console\Kernel->handle()
#18 /opt/librenms/artisan(16): Illuminate\Foundation\Application->handleCommand()
#19 {main}
/opt/librenms/discovery.php new 2025-12-02 03:30:02 - 0 devices discovered in 0.002 secs


[2025-12-02T03:55:00][CRITICAL] Exception: Exception Scheduled command [‘/usr/bin/php’ ‘artisan’ maintenance:fetch-rss] failed wit
h exit code [1]. @ /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php:207
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/View/Components/Task.php(41): Illuminate\Console\Scheduling\ScheduleRunCommand->Illuminate\Console\Scheduling{closure}()
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/View/Components/Factory.php(59): Illuminate\Console\View\Components\Task->render()
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php(191): Illuminate\Console\View\Components\Factory->__call()
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php(162): Illuminate\Console\Scheduling\ScheduleRunCommand->runEvent()
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php(132): Illuminate\Console\Scheduling\ScheduleRunCommand->runSingleServerEvent()
#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Console\Scheduling\ScheduleRunCommand->handle()
#6 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Util.php(43): Illuminate\Container\BoundMethod::Illuminate\Container{closure}()
#7 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(96): Illuminate\Container\Util::unwrapIfClosure()
#8 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()
#9 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(836): Illuminate\Container\BoundMethod::call()
#10 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\Container\Container->call()
#11 /opt/librenms/vendor/symfony/console/Command/Command.php(318): Illuminate\Console\Command->execute()
#12 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\Component\Console\Command\Command->run()
#13 /opt/librenms/vendor/symfony/console/Application.php(1073): Illuminate\Console\Command->run()
#14 /opt/librenms/vendor/symfony/console/Application.php(356): Symfony\Component\Console\Application->doRunCommand()
#15 /opt/librenms/vendor/symfony/console/Application.php(195): Symfony\Component\Console\Application->doRun()
#16 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(197): Symfony\Component\Console\Application->run()
#17 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1235): Illuminate\Foundation\Console\Kernel->handle()
#18 /opt/librenms/artisan(16): Illuminate\Foundation\Application->handleCommand()
#19 {main}
/opt/librenms/discovery.php new 2025-12-02 03:55:02 - 0 devices discovered in 0.002 secs


Syslog cleanup is still not working.

[librenms@toc-libremontst ~]$ ./validate.php

Component Version
LibreNMS 25.12.0-dev.33+4b8657019 (2025-12-01T17:29:57-05:00)
DB Schema 2025_11_26_170658_set_device_stats_timestamp_nullable (360)
PHP 8.2.29
Python 3.6.8
Database MariaDB 10.6.24-MariaDB
RRDTool 1.7.0
SNMP 5.8
===========================================

[OK] Composer Version: 2.9.2
[OK] Dependencies up-to-date.
[OK] Database Connected
[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] Active pollers found
[OK] Dispatcher Service not detected
[OK] Locks are functional
[OK] Python poller wrapper is polling
[OK] Redis is unavailable
[OK] rrd_dir is writable
[OK] rrdtool version ok

If you run these commands manually, what does it say?

[librenms@libremon ~]$ php ‘artisan’ maintenance:cleanup-syslog
Could not open input file: ‘artisan’

You need to be in the directory where LibreNMS is installed. Of you are and that file doesn’t exist, your install is broken. Validate it.

I am in the directory where LibreNMS is installed.
The artisan file is located in this directory.
I believe the problem is related to the command syntax.

[librenms@toc-libremontst ~]$ php artisan maintenance:cleanup-syslog
Cleared syslog entries older than 30 days (547696 rows)

[librenms@toc-libremontst ~]$ php ‘artisan’ maintenance:cleanup-syslog
Could not open input file: ‘artisan’

[librenms@toc-libremontst ~]$ php ‘artisan’ maintenance:cleanup-syslog
Cleared syslog entries older than 30 days (0 rows)

[librenms@toc-libremontst logs]$ /usr/bin/php ‘artisan’ maintenance:cleanup-syslog
Could not open input file: artisan
[librenms@toc-libremontst logs]$ php ‘artisan’ maintenance:cleanup-syslog
Could not open input file: artisan

This looks like a wrong quotes problem :slight_smile:

Could not open input file: ‘artisan’

if you want to use quotes in the cli, you need to use ' or ", not and

I have the same errors in my librenms.log. php artisan commands complete normally (see below). Currently doing cleanups via cron job as a workaround.

[2025-12-07T02:19:01][CRITICAL] Exception: Exception Scheduled command [‘/usr/bin/php8.3’ ‘artisan’ maintenance:cleanup-networks] failed with exit code [2]. @ /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php:207
[2025-12-07T03:30:01][CRITICAL] Exception: Exception Scheduled command [‘/usr/bin/php8.3’ ‘artisan’ maintenance:cleanup-syslog] failed with exit code [2]. @ /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php:207

librenms@libre:~$ php artisan maintenance:cleanup-syslog
Cleared syslog entries older than 10 days (20239 rows)

My related post:

maintenance:cleanup-syslog is does not emit exit code 2…

I wonder if it is a timeout or something. Or maybe an SQL error? To bad the error message doesn’t have anything more helpful.

As Tony mentioned above, you need to be in the directory where LibreNMS is installed.
Try running this command from cron:

php /opt/librenms/artisan maintenance:cleanup-syslog

I believe all /laravel/framework/ exceptions occurred because the path to the artisan file was missing.

For example:

[librenms@toc-libremontst Scheduling]$ pwd
/opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling

[librenms@toc-libremontst Scheduling]$ php artisan maintenance:cleanup-syslog
Could not open input file: artisan

[librenms@toc-libremontst Scheduling]$ php /opt/librenms/artisan maintenance:cleanup-syslog
Cleared syslog entries older than 30 days (2229 rows)

Using the full path to artisan should resolve the issue.

1 Like

My workaround in /etc/cron.d/librenms

# Daily maintenance script. DO NOT DISABLE!
# If you want to modify updates:
#  Switch to monthly stable release: https://docs.librenms.org/General/Releases/
#  Disable updates: https://docs.librenms.org/General/Updating/
19   0    * * *   librenms    /opt/librenms/daily.sh >> /dev/null 2>&1
25   0    * * *   librenms    /opt/librenms/lnms maintenance:cleanup-syslog >> /dev/null 2>&1
25   0    * * 0   librenms    /opt/librenms/lnms maintenance:cleanup-networks >> /dev/null 2>&1

Added symbolic link to /opt/librenms/artisan in ~/vendor/laravel/framework/src/Illuminate/Console/Scheduling.

I’ll check to see if borkage occurs tonight. I know next to zilch about PHP and Laravel to troubleshoot much beyond that.

librenms@libre:~/vendor/laravel/framework/src/Illuminate/Console/Scheduling$ ln -s /opt/librenms/artisan artisan
librenms@libre:~/vendor/laravel/framework/src/Illuminate/Console/Scheduling$ php artisan maintenance:cleanup-syslog
Cleared syslog entries older than 10 days (28516 rows)

Still fails. Hmm.

[2025-12-23T03:30:01][CRITICAL] Exception: Exception Scheduled command ['/usr/bin/php8.3' 'artisan' maintenance:cleanup-syslog] failed with exit code [2]. @ /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php:207
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/View/Components/Task.php(41): Illuminate\Console\Scheduling\ScheduleRunCommand->Illuminate\Console\Scheduling\{closure}()
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/View/Components/Factory.php(59): Illuminate\Console\View\Components\Task->render()
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php(191): Illuminate\Console\View\Components\Factory->__call()
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php(162): Illuminate\Console\Scheduling\ScheduleRunCommand->runEvent()
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php(132): Illuminate\Console\Scheduling\ScheduleRunCommand->runSingleServerEvent()
#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Console\Scheduling\ScheduleRunCommand->handle()
#6 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Util.php(43): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#7 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(96): Illuminate\Container\Util::unwrapIfClosure()
#8 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()
#9 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(836): Illuminate\Container\BoundMethod::call()
#10 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\Container\Container->call()
#11 /opt/librenms/vendor/symfony/console/Command/Command.php(318): Illuminate\Console\Command->execute()
#12 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\Component\Console\Command\Command->run()
#13 /opt/librenms/vendor/symfony/console/Application.php(1073): Illuminate\Console\Command->run()
#14 /opt/librenms/vendor/symfony/console/Application.php(356): Symfony\Component\Console\Application->doRunCommand()
#15 /opt/librenms/vendor/symfony/console/Application.php(195): Symfony\Component\Console\Application->doRun()
#16 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(197): Symfony\Component\Console\Application->run()
#17 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1235): Illuminate\Foundation\Console\Kernel->handle()
#18 /opt/librenms/artisan(16): Illuminate\Foundation\Application->handleCommand()
#19 {main}

My LibreNMS instance is from 2021, for whatever reason it stopped getting software updates in April 2025, after I finally got it updated back to latest I started getting this exact same error.

After a week of failing to fix it I created a completely fresh Ubuntu 24.04.3 LTS install and followed the install guide here to the letter Installing LibreNMS - LibreNMS Docs and it does exactly the same thing.

maintenance.log is never written to and librenms.log shows this;

[2025-12-31T03:24:00][CRITICAL] Exception: Exception Scheduled command ['/usr/bin/php8.3' 'artisan' maintenance:fetch-rss] failed with exit code [2]. @ /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php:207
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/View/Components/Task.php(41): Illuminate\Console\Scheduling\ScheduleRunCommand->Illuminate\Console\Scheduling\{closure}()
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/View/Components/Factory.php(59): Illuminate\Console\View\Components\Task->render()
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php(191): Illuminate\Console\View\Components\Factory->__call()
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php(162): Illuminate\Console\Scheduling\ScheduleRunCommand->runEvent()
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php(132): Illuminate\Console\Scheduling\ScheduleRunCommand->runSingleServerEvent()
#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Console\Scheduling\ScheduleRunCommand->handle()
#6 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Util.php(43): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#7 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(96): Illuminate\Container\Util::unwrapIfClosure()
#8 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()
#9 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(836): Illuminate\Container\BoundMethod::call()
#10 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\Container\Container->call()
#11 /opt/librenms/vendor/symfony/console/Command/Command.php(318): Illuminate\Console\Command->execute()
#12 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\Component\Console\Command\Command->run()
#13 /opt/librenms/vendor/symfony/console/Application.php(1073): Illuminate\Console\Command->run()
#14 /opt/librenms/vendor/symfony/console/Application.php(356): Symfony\Component\Console\Application->doRunCommand()
#15 /opt/librenms/vendor/symfony/console/Application.php(195): Symfony\Component\Console\Application->doRun()
#16 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(197): Symfony\Component\Console\Application->run()
#17 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1235): Illuminate\Foundation\Console\Kernel->handle()
#18 /opt/librenms/artisan(16): Illuminate\Foundation\Application->handleCommand()
#19 {main}  
/opt/librenms/discovery.php new 2025-12-31 03:25:01 - 0 devices discovered in 0.000 secs
[2025-12-31T03:25:03][ALERT] INFO: device:poll 192.168.0.54 (1) polled in 1.378s  
[2025-12-31T03:30:00][CRITICAL] Exception: Exception Scheduled command ['/usr/bin/php8.3' 'artisan' maintenance:cleanup-syslog] failed with exit code [2]. @ /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php:207
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/View/Components/Task.php(41): Illuminate\Console\Scheduling\ScheduleRunCommand->Illuminate\Console\Scheduling\{closure}()
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/View/Components/Factory.php(59): Illuminate\Console\View\Components\Task->render()
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php(191): Illuminate\Console\View\Components\Factory->__call()
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php(162): Illuminate\Console\Scheduling\ScheduleRunCommand->runEvent()
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php(132): Illuminate\Console\Scheduling\ScheduleRunCommand->runSingleServerEvent()
#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Console\Scheduling\ScheduleRunCommand->handle()
#6 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Util.php(43): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#7 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(96): Illuminate\Container\Util::unwrapIfClosure()
#8 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()
#9 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(836): Illuminate\Container\BoundMethod::call()
#10 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\Container\Container->call()
#11 /opt/librenms/vendor/symfony/console/Command/Command.php(318): Illuminate\Console\Command->execute()
#12 /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\Component\Console\Command\Command->run()
#13 /opt/librenms/vendor/symfony/console/Application.php(1073): Illuminate\Console\Command->run()
#14 /opt/librenms/vendor/symfony/console/Application.php(356): Symfony\Component\Console\Application->doRunCommand()
#15 /opt/librenms/vendor/symfony/console/Application.php(195): Symfony\Component\Console\Application->doRun()
#16 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(197): Symfony\Component\Console\Application->run()
#17 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1235): Illuminate\Foundation\Console\Kernel->handle()
#18 /opt/librenms/artisan(16): Illuminate\Foundation\Application->handleCommand()
#19 {main}  

Any suggestions?

Thanks.

Is this related to my finding here? MySQL-db "exploded" in size - #2 by ChrisK928

Yes, IMO. grep your logs/librenms.log for ‘cleanup-syslog’ and you should see the borkage. I put in a cron job to clean up syslog until it gets fixed.

librenms@libre:~$ cat logs/librenms.log | grep cleanup-syslog
[2026-01-04T03:30:00][CRITICAL] Exception: Exception Scheduled command ['/usr/bin/php8.3' 'artisan' maintenance:cleanup-syslog] failed with exit code [2]. @ /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php:207
[2026-01-05T03:30:00][CRITICAL] Exception: Exception Scheduled command ['/usr/bin/php8.3' 'artisan' maintenance:cleanup-syslog] failed with exit code [2]. @ /opt/librenms/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php:207

1 Like

Fixed in 26.1.0.