Undefined index: name In PackageManifest.php line 122

Hello expert,
yesterday i installed VM on my qnap fine adding some devices.
Today i did a simple apt-update and apt ugprade.
Now ubuntu is running 18.04.5 LTS but web page is not available.

[email protected]:~$ ./validate.php

In PackageManifest.php line 122:

Undefined index: name

====================================

Component Version
LibreNMS 1.63-57-g0040f38d1
DB Schema Not Connected (0)
PHP 7.2.24-0ubuntu0.18.04.7
Python 3.6.9
MySQL ?
RRDTool 1.7.0
SNMP NET-SNMP 5.7.3

====================================

[OK] Composer Version: 2.0.7
[OK] Dependencies up-to-date.

mysqld service is up and runinng

[email protected]:~$ systemctl status
● librenms
State: degraded
Jobs: 0 queued
Failed: 3 units
Since: Wed 2020-11-18 09:47:40 UTC; 42min ago
CGroup: /
├─user.slice
│ └─user-1001.slice
│ ├─session-2.scope
│ │ ├─ 1780 sshd: librenms [priv]
│ │ ├─ 1848 sshd: [email protected]/0
│ │ ├─ 1850 -bash
│ │ ├─14147 systemctl status
│ │ └─14148 (pager) status
│ └─[email protected]
│ └─init.scope
│ ├─1786 /lib/systemd/systemd --user
│ └─1787 (sd-pam)
├─init.scope
│ └─1 /sbin/init nosplash
└─system.slice
├─syslog-ng.service
│ ├─ 394 /usr/sbin/syslog-ng -F
│ ├─14145 /bin/sh -c /opt/librenms/syslog.php
│ └─14146 php /opt/librenms/syslog.php
├─systemd-networkd.service
│ └─275 /lib/systemd/systemd-networkd
├─systemd-udevd.service
│ └─255 /lib/systemd/systemd-udevd
├─cron.service
│ └─392 /usr/sbin/cron -f
├─nginx.service
│ ├─475 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
│ └─477 nginx: worker process
├─mariadb.service
│ └─1430 /usr/sbin/mysqld
├─networkd-dispatcher.service
│ └─432 /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers
├─accounts-daemon.service
│ └─393 /usr/lib/accountsservice/accounts-daemon
├─snmpd.service
│ └─436 /usr/sbin/snmpd -Lsd -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux mteTrigger mteTriggerConf -f
├─systemd-journald.service
│ └─237 /lib/systemd/systemd-journald
├─unattended-upgrades.service
│ └─19006 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
├─ssh.service
│ └─434 /usr/sbin/sshd -D
├─rrdcached.service
│ └─401 /usr/bin/rrdcached -w 1800 -z 1800 -f 3600 -s librenms -U librenms -G librenms -B -R -j /var/tmp -l unix:/var/run/rrdcached/rrdcached.sock -t 4 -F -b /opt/librenms/rrd/
├─qemu-guest-agent.service
│ └─454 /usr/sbin/qemu-ga --daemonize -m virtio-serial -p /dev/virtio-ports/org.qemu.guest_agent.0
├─rpcbind.service
│ └─296 /sbin/rpcbind -f -w
├─lvm2-lvmetad.service
│ └─254 /sbin/lvmetad -f
├─systemd-resolved.service
│ └─303 /lib/systemd/systemd-resolved
├─php7.2-fpm.service
│ ├─385 php-fpm: master process (/etc/php/7.2/fpm/php-fpm.conf)
│ ├─481 php-fpm: pool www
│ └─482 php-fpm: pool www
├─dbus.service
│ └─397 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
├─system-getty.slice
│ └─[email protected]
│ └─474 /sbin/agetty -o -p – \u --noclear tty1 linux
└─systemd-logind.service
└─396 /lib/systemd/systemd-logind

any suggestion?

Thanks
Marcello

i find many entries on file librenms.log

[2020-11-18 10:03:33] production.ERROR: Undefined index: name {“exception”:"[object] (ErrorException(code: 0): Undefined index: name at /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php:122)
[stacktrace]
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(122): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, ‘Undefined index…’, ‘/opt/librenms/v…’, 122, Array)
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Support/Collection.php(1197): Illuminate\Foundation\PackageManifest->Illuminate\Foundation\{closure}(Array, ‘packages’)
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(123): Illuminate\Support\Collection->mapWithKeys(Object(Closure))
#3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(97): Illuminate\Foundation\PackageManifest->build()
#4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(80): Illuminate\Foundation\PackageManifest->getManifest()
#5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterFacades.php(26): Illuminate\Foundation\PackageManifest->aliases()
#6 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(210): Illuminate\Foundation\Bootstrap\RegisterFacades->bootstrap(Object(App\Application))
#7 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(322): Illuminate\Foundation\Application->bootstrapWith(Array)
#8 /opt/librenms/LibreNMS/Util/Laravel.php(46): Illuminate\Foundation\Console\Kernel->bootstrap()
#9 /opt/librenms/includes/init.php(92): LibreNMS\Util\Laravel::bootCli()
#10 /opt/librenms/syslog.php(16): require(’/opt/librenms/i…’)

Looks like you upgrade the DB as well. You need to confirm librenms can talk to the DB. correct username and password in config.php

i’m using the default

Database config

$config[‘db_host’] = ‘localhost’;
$config[‘db_user’] = ‘librenms’;
$config[‘db_pass’] = ‘D42nf23rewD’;
$config[‘db_name’] = ‘librenms’;

Today i re-deployed VM, configured fine then started the daily upgrade.
Now i’m again in the same condition.

I’m also having the same issues. Both before and after apt update && apt dist-upgrade

[email protected]:~$ ./validate.php 

In PackageManifest.php line 122:
                         
  Undefined index: name  
                         

====================================
Component | Version
--------- | -------
LibreNMS  | 1.63-57-g0040f38d1
DB Schema | Not Connected (0)
PHP       | 7.2.24-0ubuntu0.18.04.7
Python    | 3.6.9
MySQL     | ?
RRDTool   | 1.7.0
SNMP      | NET-SNMP 5.7.3
====================================

[OK]    Composer Version: 2.0.7
[OK]    Dependencies up-to-date.

This started off with issues connecting to the UI, with a HTTP ERROR 500 and log messages

logs/librenms.log:106618969:#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(788): ReflectionClass->__construct('files')
logs/librenms.log:106619014:[2020-11-18 17:01:21] production.ERROR: Uncaught ReflectionException: Class files does not exist in /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php:788
logs/librenms.log:106619016:#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(788): ReflectionClass->__construct('files')
logs/librenms.log:106619022:#6 /opt/librenms/vendor/laravel/framework/src/Illumi {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalErrorException(code: 1): Uncaught ReflectionException: Class files does not exist in /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php:788
logs/librenms.log:106619024:#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Container/Container.php(788): ReflectionClass->__construct('files')

in addition to the Undefined index: name messages listed in previous posts.

Workaround for now:
This worked for me while I await the real answer.

2 Likes

I confirm that workaround works!

Try this, it is worked for me, in following file:

vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php

Find this line and comment it

$packages = json_decode($this->files->get($path), true);

Add two new lines after above commented line

$installed = json_decode($this->files->get($path), true);
$packages = $installed['packages'] ?? $installed;

Thanks

4 Likes

Looks like this is causing VM installs to break? It is set to update to broken by default? How is this okay?

Brand new install from the OVA.

Setup everything works fine on first day, devices are discovered looks amazing. Come back to check the next day and:

nginix 500 error and in the logs. Same issue as original poster. Here is the validate output:

[email protected]:~$ ./validate.php

In PackageManifest.php line 122:

  Undefined index: name


====================================
Component | Version
--------- | -------
LibreNMS  | 1.63-57-g0040f38d1
DB Schema | Not Connected (0)
PHP       | 7.2.24-0ubuntu0.18.04.4
Python    | 3.6.9
MySQL     | ?
RRDTool   | 1.7.0
SNMP      | NET-SNMP 5.7.3
====================================

[OK]    Composer Version: 2.0.8
[OK]    Dependencies up-to-date.
[email protected]:~$

So I was able to resolve this with the amazingly hacky workaround many others have suggested. (and in this thread thanks @Matthew_Carpenter )

I deployed the Ubuntu VM image yesterday and it stopped working today.

Performed the steps that monsterciattolo suggested plus the following commands to fix a pip error that was still appearing in ./validate.php

sudo apt install python3-pip
pip3 install -r /opt/librenms/requirements.txt

It works,I follwing this fix my issue