[Roundcube] Error when following the README instructions to install a new plugin via composer

Hello everyone!

I’m reproducing here an issue I posted on the github repo (Error when following the README instructions to install a new plugin via composer · Issue #160 · YunoHost-Apps/roundcube_ynh · GitHub) in case that someone from the community faced the same issue!

Describe the bug

When trying to install a new plugin via composer following the instructions given in the README, an error is encountered.

Context

  • Hardware: VPS bought online
  • YunoHost version: 11.0.10.2
  • I have access to my server: SSH and webadmin
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: Nope
  • Using, or trying to install package version/branch: N/A
  • If upgrading, current package version: N/A

Steps to reproduce

(Copy paste from the repo’s README)

Connect to your server as root using SSH:

$ ssh admin@1.2.3.4
$ sudo -i

Log in as the roundcube user - which owns the roundcube directory - and navigate in it:

# su -s /bin/bash - roundcube

$ cd /var/www/roundcube

Install the plugin you want using composer - note that you have to specify kitist/html5_notifier and not only html5_notifier:

$ roundcube@ynh:~$ COMPOSER_HOME=./.composer php composer.phar require "kitist/html5_notifier"

Expected behavior

No error :wink:

Logs

PHP Fatal error: Uncaught TypeError: json_decode() expects parameter 1 to be string, bool given in phar:///var/www/roundcube/composer.phar/src/Composer/Json/JsonFile.php:201
Stack trace:
#0 phar:///var/www/roundcube/composer.phar/src/Composer/Json/JsonFile.php(201): json_decode()
#1 phar:///var/www/roundcube/composer.phar/src/Composer/Factory.php(313): Composer\Json\JsonFile->validateSchema()
#2 phar:///var/www/roundcube/composer.phar/src/Composer/Factory.php(615): Composer\Factory->createComposer()
#3 phar:///var/www/roundcube/composer.phar/src/Composer/Console/Application.php(470): Composer\Factory::create()
#4 phar:///var/www/roundcube/composer.phar/src/Composer/Console/Application.php(412): Composer\Console\Application->getComposer()
#5 phar:///var/www/roundcube/composer.phar/src/Composer/Console/Application.php(353): Composer\Console\Application->hintCommonErrors()
#6 phar:///var/www/roundcube/composer.phar/vendor/symfony/console/Application.php(171): Composer\Console\Application->doRun()
#7 phar:///var/www/roundcube/com in phar:///var/www/roundcube/composer.phar/src/Composer/Json/JsonFile.php on line 201

Fatal error: Uncaught TypeError: json_decode() expects parameter 1 to be string, bool given in phar:///var/www/roundcube/composer.phar/src/Composer/Json/JsonFile.php:201
Stack trace:
#0 phar:///var/www/roundcube/composer.phar/src/Composer/Json/JsonFile.php(201): json_decode()
#1 phar:///var/www/roundcube/composer.phar/src/Composer/Factory.php(313): Composer\Json\JsonFile->validateSchema()
#2 phar:///var/www/roundcube/composer.phar/src/Composer/Factory.php(615): Composer\Factory->createComposer()
#3 phar:///var/www/roundcube/composer.phar/src/Composer/Console/Application.php(470): Composer\Factory::create()
#4 phar:///var/www/roundcube/composer.phar/src/Composer/Console/Application.php(412): Composer\Console\Application->getComposer()
#5 phar:///var/www/roundcube/composer.phar/src/Composer/Console/Application.php(353): Composer\Console\Application->hintCommonErrors()
#6 phar:///var/www/roundcube/composer.phar/vendor/symfony/console/Application.php(171): Composer\Console\Application->doRun()
#7 phar:///var/www/roundcube/com in phar:///var/www/roundcube/composer.phar/src/Composer/Json/JsonFile.php on line 201

*** Additional info
The app setting for PHP version is 7.4, php7.4-json is installed.

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