Skip to content

[Bug]: PHP8 issue with phpseclib #32688

@gemini-git

Description

@gemini-git

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

During the installation of a new app I received an exception because of an undefined function in phpseclib. It looks like it is an incompatibility with PHP8.
The version of phpseclib (2.0.32) you are using is almost a year old. Please consider upgrading to the newest version 2.0.37 or better directly to 3.x.

Steps to reproduce

  1. Use PHP8
  2. Try to install an app
  3. You got an error and the exception message log

Expected behavior

PHP8 and nextcloud work without any exception.

Installation method

Manual installation

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.0

Web server

Nginx

Database engine version

PostgreSQL

Is this bug present after an update or on a fresh install?

No response

Are you using the Nextcloud Server Encryption module?

Encryption is Enabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

- accessibility: 1.10.0
  - calendar: 3.3.1
  - circles: 24.0.0
  - cloud_federation_api: 1.7.0
  - contacts: 4.1.1
  - contactsinteraction: 1.5.0
  - cospend: 1.4.6
  - dav: 1.22.0
  - encryption: 2.12.0
  - federatedfilesharing: 1.14.0
  - files: 1.19.0
  - files_rightclick: 1.3.0
  - files_sharing: 1.16.2
  - files_trashbin: 1.14.0
  - files_versions: 1.17.0
  - logreader: 2.9.0
  - lookup_server_connector: 1.12.0
  - nextcloud_announcements: 1.13.0
  - notifications: 2.12.0
  - oauth2: 1.12.0
  - password_policy: 1.14.0
  - provisioning_api: 1.14.0
  - settings: 1.6.0
  - theming: 1.15.0
  - twofactor_backupcodes: 1.13.0
  - twofactor_totp: 6.3.0
  - updatenotification: 1.14.0
  - viewer: 1.8.0
  - workflowengine: 2.6.0

Nextcloud Signing status

No response

Nextcloud Logs

{"reqId":"F2AP1sWXNNqasLJ4Axdw","level":3,"time":"2022-06-01T09:53:35+00:00","remoteAddr":"IP","user":"USERNAME","app":"index","method":"POST","url":"/settings/apps/enable","message":"Call to undefined function phpseclib\\Math\\phpinfo() in file '/var/www/html/cloud.example.com/3rdparty/phpseclib/phpseclib/phpseclib/Math/BigInteger.php' line 273","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36 OPR/87.0.4390.36","version":"24.0.1.1","exception":{"Exception":"Exception","Message":"Call to undefined function phpseclib\\Math\\phpinfo() in file '/var/www/html/cloud.example.com/3rdparty/phpseclib/phpseclib/phpseclib/Math/BigInteger.php' line 273","Code":0,"Trace":[{"file":"/var/www/html/cloud.example.com/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/cloud.example.com/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/html/cloud.example.com/lib/base.php","line":1023,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/html/cloud.example.com/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/html/cloud.example.com/lib/private/AppFramework/Http/Dispatcher.php","Line":165,"Previous":{"Exception":"Error","Message":"Call to undefined function phpseclib\\Math\\phpinfo()","Code":0,"Trace":[{"file":"/var/www/html/cloud.example.com/3rdparty/phpseclib/phpseclib/phpseclib/File/X509.php","line":1001,"function":"__construct","class":"phpseclib\\Math\\BigInteger","type":"->"},{"file":"/var/www/html/cloud.example.com/lib/private/Installer.php","line":234,"function":"__construct","class":"phpseclib\\File\\X509","type":"->"},{"file":"/var/www/html/cloud.example.com/apps/settings/lib/Controller/AppSettingsController.php","line":448,"function":"downloadApp","class":"OC\\Installer","type":"->"},{"file":"/var/www/html/cloud.example.com/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"enableApps","class":"OCA\\Settings\\Controller\\AppSettingsController","type":"->"},{"file":"/var/www/html/cloud.example.com/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/cloud.example.com/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/cloud.example.com/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/html/cloud.example.com/lib/base.php","line":1023,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/html/cloud.example.com/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/html/cloud.example.com/3rdparty/phpseclib/phpseclib/phpseclib/Math/BigInteger.php","Line":273},"CustomMessage":"--"}}

Additional info

nextcloud/3rdparty#881
nextcloud/3rdparty#1018
nextcloud/3rdparty#1020

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmapbugneeds info

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions