In an effort to minimize thread crap, and keep unique issues in unique threads, I present to you another issue with the WebUI dropping after an update.
In our case, we have the following output when trying to run composer_wrapper.php
[Composer\Repository\InvalidRepositoryException]
Invalid repository data in /opt/librenms/vendor/composer/installed.json, packages could not be loaded: [Seld\JsonLint\ParsingException] "/opt/librenms/vendor/composer/installed.json" does not contain valid JSON
Parse error on line 1:
^
Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
[Composer\Repository\InvalidRepositoryException]
Invalid repository data in /opt/librenms/vendor/composer/installed.json, packages could not be loaded: [Seld\JsonLint\ParsingException] "/opt/librenms/vendor/composer/installed.json" does not contain valid JSON
Parse error on line 1:
^
Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
Did you have the same issue? Re-installing everything seems to be akin to using a pile driver when all I need is a pin hammer, especially when 1) everything had been installed from the initial deployment and 2) something specific to the last update broke it.
LibreNMS\ComposerHelper::preInstall
Loading composer repositories with package information
Installing dependencies from lock file
Nothing to install or update
Generating autoload files
LibreNMS\ComposerHelper::postInstall
Illuminate\Foundation\ComposerScripts::postInstall
php artisan optimize
PHP Notice: date_default_timezone_set(): Timezone ID ‘’ is invalid in /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php on line 49
Generating optimized class loader
The compiled services file has been removed.
The following additional packages will be installed:
libsnmp30 mariadb-client-10.0 mariadb-client-core-10.0 mariadb-common mariadb-server-10.0 mariadb-server-core-10.0 php7.0-common php7.0-json php7.0-opcache php7.0-readline snmptrapd
Suggested packages:
mailx mariadb-test tinyca
The following NEW packages will be installed
php7.0-mbstring
The following packages will be upgraded:
libsnmp30 mariadb-client mariadb-client-10.0 mariadb-client-core-10.0 mariadb-common mariadb-server mariadb-server-10.0 mariadb-server-core-10.0 php7.0-cli php7.0-common php7.0-curl php7.0-fpm php7.0-gd php7.0-json php7.0-mcrypt
php7.0-mysql php7.0-opcache php7.0-readline php7.0-snmp php7.0-xml php7.0-zip snmp snmpd snmptrapd
…and re-ran the script with the same result.
Also, FWIW, after the above…
====================================
Component | Version
--------- | -------
LibreNMS | 1.39-31-g0020479
DB Schema | ?
PHP | 7.0.28-0ubuntu0.16.04.1
MySQL | ?
RRDTool | 1.5.5
SNMP | NET-SNMP 5.7.3
====================================
[FAIL] No composer available, please install composer
[FIX] https://getcomposer.org/
Fortunately I took a snapshot prior to installing/upgrading the other packages referenced here. I’ll more than likely revert. But in either case, needless to say it’s still an issue.
One additional piece to note, in this instance, said json file is empty. I’ve seen other references to that, but not necessarily specific to Libre.
As for the suggestion of whacking the /vendor directory, what is the thought behind that? Given the error, could the file be (re)moved? I appreciate it might cascade to other issues, hence the suggestion, and I’m all for the suggestions, but I’d like to understand the reasoning behind them.
More importantly, what happened/changed in this latest update that seems to have caused all these issues for a few folks.
Ran this command “./composer_wrapper.php install --no-dev” and got this below. My instance has been running fine until today.
Problem 1
- Installation request for erusev/parsedown 1.7.1 → satisfiable by erusev/parsedown[1.7.1].
- erusev/parsedown 1.7.1 requires ext-mbstring * → the requested PHP extension mbstring is missing from your system.
Problem 2
- Installation request for laravel/framework v5.4.36 → satisfiable by laravel/framework[v5.4.36].
- laravel/framework v5.4.36 requires ext-mbstring * → the requested PHP extension mbstring is missing from your system.
Problem 3
- laravel/framework v5.4.36 requires ext-mbstring * → the requested PHP extension mbstring is missing from your system.
- oriceon/toastr-5-laravel dev-master requires illuminate/session >=5.0.0 → satisfiable by laravel/framework[v5.4.36].
- Installation request for oriceon/toastr-5-laravel dev-master → satisfiable by oriceon/toastr-5-laravel[dev-master].
To enable extensions, verify that they are enabled in your .ini files:
Ok. So instead of removing all under /vendor… I moved the installed.json file and then re-ran the composer_wrapper script and was met with similar results as mentioned above…
LibreNMS\ComposerHelper::preInstall
Loading composer repositories with package information
Installing dependencies from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for erusev/parsedown 1.7.1 -> satisfiable by erusev/parsedown[1.7.1].
…etc…
Ran apt install php-mbstring…
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-87 linux-headers-4.4.0-87-generic linux-image-4.4.0-87-generic linux-image-extra-4.4.0-87-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
php7.0-cli php7.0-common php7.0-curl php7.0-fpm php7.0-gd php7.0-json php7.0-mbstring php7.0-mcrypt php7.0-mysql php7.0-opcache php7.0-readline php7.0-snmp php7.0-xml php7.0-zip
The following NEW packages will be installed
php-mbstring php7.0-mbstring
The following packages will be upgraded:
php7.0-cli php7.0-common php7.0-curl php7.0-fpm php7.0-gd php7.0-json php7.0-mcrypt php7.0-mysql php7.0-opcache php7.0-readline php7.0-snmp php7.0-xml php7.0-zip
13 to upgrade, 2 to newly install, 0 to remove and 153 not to upgrade.
…etc…
Re-ran the composer_wrapper script once more…
LibreNMS\ComposerHelper::preInstall
Loading composer repositories with package information
Installing dependencies from lock file
Package operations: 59 installs, 0 updates, 0 removals
- Installing amenadiel/jpgraph (3.6.14): Downloading (100%)
- Installing dapphp/radius (2.5.2): Downloading (100%)
- Installing doctrine/inflector (v1.1.0): Downloading (100%)
- Installing doctrine/instantiator (1.0.5): Downloading (100%)
...
Generating autoload files
> LibreNMS\ComposerHelper::postInstall
Application key [base64:FnnK71DYRzwUsK6lvSCSTVXhGVvpC5tNsitm0kTkVKs=] set successfully.
> Illuminate\Foundation\ComposerScripts::postInstall
> php artisan optimize
Generating optimized class loader
The compiled services file has been removed.
…then restarted php and all became well once again.
So…why?! What happened to the update that caused the json file to be empty to begin with? And why are the dependencies not apparently updating?
The password in the .env file was set wrong. My password has an $ in some part, everything after this character was not there, everything before was there.
[Composer\Repository\InvalidRepositoryException]
Invalid repository data in /opt/librenms/vendor/composer/installed.json, pa
ckages could not be loaded: [Seld\JsonLint\ParsingException] “/opt/librenms
/vendor/composer/installed.json” does not contain valid JSON
Parse error on line 1:
[$\\\▒▒6{▒\▒
^
Expected one of: ‘STRING’, ‘NUMBER’, ‘NULL’, ‘TRUE’, ‘FALSE’, ‘{’, ‘[’
Also If I run
php artisan key:generate --force
It just tells me to run ./scripts/composer_wrapper.php install --no-dev and I get the same error as above.