Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating 1.5.3 -> 1.6.1 results in Class "PEAR" not found error #9037

Closed
Yannik opened this issue Jun 24, 2023 · 14 comments
Closed

Updating 1.5.3 -> 1.6.1 results in Class "PEAR" not found error #9037

Yannik opened this issue Jun 24, 2023 · 14 comments

Comments

@Yannik
Copy link

Yannik commented Jun 24, 2023

I have recently tried to upgrade my roundcube instance from 1.5.3 to 1.6.1. Unfortunately, now a fatal Class "PEAR" not found error gets thrown and roundcube returns a blank page. Is is thrown in program/lib/Roundcube/bootstrap.php:103.

I have removed vendor and reinstalled the composer dependencies to make sure nothing is wrong with them.

composer update --no-dev output:

Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file
Package operations: 23 installs, 0 updates, 0 removals
  - Installing roundcube/plugin-installer (0.3.2): Extracting archive
  - Installing dasprid/enum (1.0.4): Extracting archive
  - Installing bacon/bacon-qr-code (2.0.8): Extracting archive
  - Installing symfony/deprecation-contracts (dev-main 7c3aff7): Extracting archive
  - Installing psr/http-message (dev-master 402d35b): Extracting archive
  - Installing psr/http-client (dev-master 0955afe): Extracting archive
  - Installing ralouphie/getallheaders (3.0.3): Extracting archive
  - Installing psr/http-factory (dev-master 6d70f40): Extracting archive
  - Installing guzzlehttp/psr7 (2.6.x-dev b635f27): Extracting archive
  - Installing guzzlehttp/promises (2.0.x-dev 4a94655): Extracting archive
  - Installing guzzlehttp/guzzle (7.7.x-dev fb7566c): Extracting archive
  - Installing masterminds/html5 (dev-master f47dcf3): Extracting archive
  - Installing pear/pear_exception (dev-master 76631ea): Extracting archive
  - Installing pear/auth_sasl (v1.1.0): Extracting archive
  - Installing pear/console_commandline (dev-master 611c5bf): Extracting archive
  - Installing pear/crypt_gpg (v1.6.7): Extracting archive
  - Installing pear/console_getopt (v1.4.3): Extracting archive
  - Installing pear/pear-core-minimal (v1.10.13): Extracting archive
  - Installing pear/mail_mime (1.10.11): Extracting archive
  - Installing pear/net_socket (v1.2.2): Extracting archive
  - Installing pear/net_sieve (1.4.6): Extracting archive
  - Installing pear/net_smtp (1.10.1): Extracting archive
  - Installing roundcube/rtf-html-php (v2.1): Extracting archive

composer.json:

{
    "name": "roundcube/roundcubemail",
    "description": "The Roundcube Webmail suite",
    "license": "GPL-3.0+",
    "repositories": [
        {
            "type": "composer",
            "url": "https://plugins.roundcube.net"
        }
    ],
    "require": {
        "php": ">=5.5.0",
        "pear/pear-core-minimal": "~1.10.1",
        "pear/auth_sasl": "~1.1.0",
        "pear/net_idna2": "~0.2.0",
        "pear/mail_mime": "~1.10.0",
        "pear/net_smtp": "~1.10.0",
        "pear/crypt_gpg": "~1.6.3",
        "pear/net_sieve": "~1.4.5",
        "roundcube/plugin-installer": "~0.3.0",
        "endroid/qr-code": "~1.6.5",
        "roundcube/rtf-html-php": "~2.1",
        "masterminds/html5": "~2.7.0",
        "guzzlehttp/guzzle": "^6.5.5"
    },
    "require-dev": {
        "phpunit/phpunit": "*"
    },
    "suggest": {
        "pear-pear.php.net/net_ldap2": "~2.2.0 required for connecting to LDAP address books",
        "kolab/Net_LDAP3": "dev-master required for connecting to LDAP address books"
    },
    "minimum-stability": "dev",
    "config": {
        "allow-plugins": {
            "roundcube/plugin-installer": true
        }
    }
}

PHP-Version: 8.2

I will gladly provide more debug information as required.

@alecpl
Copy link
Member

alecpl commented Jul 2, 2023

Strange. PEAR class is provided by pear-core-minimal package, that you have installed.

Your composer.json file does not look like file from 1.6.

ps. I just released 1.6.2.

@Yannik
Copy link
Author

Yannik commented Jul 2, 2023

@alecpl I was able to work around this by doing a fresh install of roundcube.

Not sure what was causing this issue. Maybe something with the opcache, I had a similar problem with the nextcloud onlyoffice plugin recently (ONLYOFFICE/onlyoffice-nextcloud#830).

@werk21
Copy link

werk21 commented Jul 2, 2023

At least we took the roundcube-x.x.x-complete-package.

@SerhiiZahuba
Copy link

I have the same error. I am trying to upgrade from 1.6.1 to 1.6.2.

./bin/installto.sh /opt/www/roundcubemail

PHP Fatal error: Uncaught Error: Class 'PEAR' not found in /opt/www/roundcubemail-1.6.2/program/lib/Roundcube/bootstrap.php:103
Stack trace:
#0 /opt/www/roundcubemail-1.6.2/program/include/iniset.php(78): require_once()
#1 /opt/www/roundcubemail-1.6.2/program/include/clisetup.php(25): require_once('/opt/www/roundc...')
#2 /opt/www/roundcubemail-1.6.2/bin/installto.sh(23): require_once('/opt/www/roundc...')
#3 {main}
thrown in /opt/www/roundcubemail-1.6.2/program/lib/Roundcube/bootstrap.php on line 103
Fatal error: Please check the Roundcube error log and/or server error logs for more information.

@alecpl
Copy link
Member

alecpl commented Jul 4, 2023

Are you using the "complete" package? It won't work with the package that does not include dependencies (/vendor folder).

@SerhiiZahuba
Copy link

sorry I downloaded the "complete" package and updated through it. Everything is OK. thank you

@Yannik
Copy link
Author

Yannik commented Jul 4, 2023

@alecpl Why should the "dependent" package and installing requirements using composer and bin/install-jsdeps.sh not work?

@alecpl
Copy link
Member

alecpl commented Jul 4, 2023

"dependent" package does not include any dependencies, but these scripts require at least PEAR. That's nothing new.

These scripts do not have a lot of dependencies, so maybe they could be made independent in future. It might be not that hard to do, but I don't plan to work on this.

@Yannik
Copy link
Author

Yannik commented Jul 4, 2023

@alecpl
Which scripts exactly do you mean by these scripts?

What I don't quite understand: Shouldn't the PEAR dependency be satisfied after composer install?

@alecpl
Copy link
Member

alecpl commented Jul 4, 2023

bin/installto.sh and bin/install-jsdeps.sh were mentioned here, but it will be the same for all scripts that include bootstrap.php file.

The script will work when you run them in a working Roundcube root directory, but they will not if you run them in a directory that contains only the extracted Roundcube "dependent" package. Dependencies are supposed to be in /vendor folder.

@Yannik
Copy link
Author

Yannik commented Jul 4, 2023

So it should work just fine after composer install?

@alecpl
Copy link
Member

alecpl commented Jul 4, 2023

It should.

@alecpl
Copy link
Member

alecpl commented Jul 15, 2023

Fixed.

@alecpl alecpl closed this as completed Jul 15, 2023
@Yannik
Copy link
Author

Yannik commented Jul 15, 2023

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants