Composer error

Hello,

I have librenms running almost fine since 2 years, but since few days
When running validate.php as cli:

librenms@librenms:~$ ./validate.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’, ‘{’, ‘[’

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

Component Version
LibreNMS 1.64.1-2-g90d4ef7
DB Schema Not Connected (0)
PHP 7.4.2
Python 3.5.2
MySQL ?
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3
====================================

[FAIL] No composer available, please install composer
[FIX]:
https://getcomposer.org/

composer binary is available.
/opt/librenms/vendor/composer/installed.json is empty

librenms@librenms:~$ uname -a
Linux librenms 4.4.0-165-generic #193-Ubuntu SMP Tue Sep 17 17:42:52 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

librenms@librenms:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.6 LTS"

librenms@librenms:~$ composer
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version @package_branch_alias_version@ (1.0.0-beta2) 2016-03-27 16:00:34

librenms@librenms:~$ php -v
PHP 7.4.2 (cli) (built: Feb  5 2020 16:50:21) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.2, Copyright (c), by Zend Technologies

I also have the unpolled devices error. not sure it is related or a bug from the last update (saw few posts about it)

thanks for help

run ./scripts/composer_wrapper.php install --no-dev

hi,

thanks for replying.

same error:

librenms@librenms:~$ ./scripts/composer_wrapper.php install --no-dev


  [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', '{', '['

thanks to another post: Poller thinks it is broken after 1.64 update, but it isn't

I have found the way to fix it:

  • remove vendor folder

  • ./scripts/composer_wrapper.php install --no-dev

now validate is happy

librenms@librenms:~$ ./validate.php
====================================
Component | Version
--------- | -------
LibreNMS  | 1.64.1-3-gb6875b7
DB Schema | 2020_04_06_001048_the_great_index_rename (165)
PHP       | 7.4.2
Python    | 3.5.2
MySQL     | 10.0.38-MariaDB-0ubuntu0.16.04.1
RRDTool   | 1.5.5
SNMP      | NET-SNMP 5.7.3
====================================

[OK]    Composer Version: 1.10.6
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[OK]    Database schema correct