After update librenms php error Uncaught Error: Call to undefined method Illuminate

Hello.

After update librenms

php error Uncaught Error: Call to undefined method Illuminate\Foundation\Application::usePublicPath() in /opt/librenms/bootstrap/app.php:1

Full log:


Supported PHP and Python version, switched back to master branch. OK
Updating to latest codebase OK
PHP Fatal error: Uncaught Error: Call to undefined method Illuminate\Foundation\Application::usePublicPath() in /opt/librenms/bootstrap/app.php:18
Stack trace:
#0 /opt/librenms/LibreNMS/Util/Laravel.php(42): require_once()
#1 /opt/librenms/includes/init.php(90): LibreNMS\Util\Laravel::bootCli()
#2 /opt/librenms/daily.php(42): require(‘…’)
#3 {main}
thrown in /opt/librenms/bootstrap/app.php on line 18
PHP Fatal error: Uncaught Error: Call to undefined method Illuminate\Foundation\Application::usePublicPath() in /opt/librenms/bootstrap/app.php:18
Stack trace:
#0 /opt/librenms/LibreNMS/Util/Laravel.php(42): require_once()
#1 /opt/librenms/includes/init.php(90): LibreNMS\Util\Laravel::bootCli()
#2 /opt/librenms/daily.php(42): require(‘…’)
#3 {main}
thrown in /opt/librenms/bootstrap/app.php on line 18
Updating Composer packages OK
Updated from 5b432ddc0 to 6474e1e0b OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK

Version info


./validate.php

Component Version
LibreNMS 22.9.0-3-g06c361c2b
DB Schema 2022_09_03_091314_update_ports_adsl_table_with_defaults (246)
PHP 8.1.2-1ubuntu2.18
Python 3.10.12
Database MariaDB 10.6.18-MariaDB-0ubuntu0.22.04.1
RRDTool 1.7.2
SNMP 5.9.1
But according to the output the update was successful and libre is running. Please help me to fix this error after the update.If you need more information, please write to me and I will provide it.

Thank you.

Please help me to solve this problem. Thank you.

Hi,

this looks to me as Laravel is not installed properly on your system. There seem to be at least some components missing which are tried to be imported and then fail.

How did you update excatly?

:nail_care:
et me describe the update process in more detail

Librenms was on the old Ubuntu18 + php7.4 server, in order to update it was moved to the new Ubuntu22 + php8.1 server, since the 8.1 PHP repositories were already removed on Ubuntu18.

That is why I configured the server according to your instructions Installing LibreNMS - LibreNMS Docs

After that, I did a clean install of Librenms and everything worked fine. The next step was to migrate the project, I also used your mana

And everything was transferred and worked. However, it was an old version of Librenms LibreNMS 22.9.0-3-g06c361c2b

The next step is to update it on a new server using your mana

I updated with the following commands, before the update I run

./validate.php

librenms@LibreNMSnew:~$ ./validate.php

Component Version
LibreNMS 22.9.0-3-g06c361c2b
DB Schema 2022_09_03_091314_update_ports_adsl_table_with_defaults (246)
PHP 8.1.2-1ubuntu2.18
Python 3.10.12
Database MariaDB 10.6.18-MariaDB-0ubuntu0.22.04.1
RRDTool 1.7.2
SNMP 5.9.1
====================================

[OK] Composer Version: 2.7.7
[OK] Dependencies up-to-date.
[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]
[FAIL] We have detected that your database schema may be wrong
Database: extra table (abilities)
Database: extra table (assigned_roles)
Database: extra table (custom_maps)
Database: extra table (custom_map_backgrounds)
Database: extra table (custom_map_edges)
Database: extra table (custom_map_nodes)
Database: extra table (permissions)
Database: extra table (roles)
Database: extra table (vendor_ouis)
[FIX]:
Run the following SQL statements to fix it
SQL Statements:
DROP TABLE abilities;
DROP TABLE assigned_roles;
DROP TABLE custom_maps;
DROP TABLE custom_map_backgrounds;
DROP TABLE custom_map_edges;
DROP TABLE custom_map_nodes;
DROP TABLE permissions;
DROP TABLE roles;
DROP TABLE vendor_ouis;
Attempt to fix this issue (y or n)?:n

Fixed errors with tables and launched the update

librenms@LibreNMSnew:~$ ./daily.sh
Supported PHP and Python version, switched back to master branch. OK
Updating to latest codebase OK
PHP Fatal error: Uncaught Error: Call to undefined method Illuminate\Foundation\Application::usePublicPath() in /opt/librenms/bootstrap/app.php:18
Stack trace:
#0 /opt/librenms/LibreNMS/Util/Laravel.php(42): require_once()
#1 /opt/librenms/includes/init.php(90): LibreNMS\Util\Laravel::bootCli()
#2 /opt/librenms/daily.php(42): require(‘…’)
#3 {main}
thrown in /opt/librenms/bootstrap/app.php on line 18
PHP Fatal error: Uncaught Error: Call to undefined method Illuminate\Foundation\Application::usePublicPath() in /opt/librenms/bootstrap/app.php:18
Stack trace:
#0 /opt/librenms/LibreNMS/Util/Laravel.php(42): require_once()
#1 /opt/librenms/includes/init.php(90): LibreNMS\Util\Laravel::bootCli()
#2 /opt/librenms/daily.php(42): require(‘…’)
#3 {main}
thrown in /opt/librenms/bootstrap/app.php on line 18
Updating Composer packages OK
Updated from 5b432ddc0 to 6474e1e0b OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK

According to this log, the update has passed. And even in the web interface of libre, the new version is shown and works.

However, there is still this error

PHP Fatal error: Uncaught Error: Call to undefined method Illuminate\Foundation\Application::usePublicPath() in /opt/librenms/bootstrap/app.php:18

And I suspect it’s critical, so please help me fix it.

Could you please try to restart php-fpm service?
On my system it is called “php8.1-fpm”.

Ah, yes, and just to be save: Doing a “chown -R librenms. /opt/librenms/” (or whatever the root dir of your installation ist)

by restarting php-fpm and running it again

    Make sure your daily.sh cron is running and run ./daily.sh manually to check for errors.

librenms@LibreNMSnew:~$ ./daily.sh
Upgrade to the latest version of the code OK
Composer package update was successful
Updated from 6474e1e0b to 5ab2f685b OK
SQL schema update OK
Updating submodules OK
Cleaning the database OK
Receiving notifications OK
Caching PeeringDB data OK
librenms@LibreNMSnew:~$

I don’t see the error anymore, thank you. Problem fixed.

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