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

ValueError base and exponent overflow #5765

Closed
sebaschi opened this issue Dec 17, 2024 · 6 comments
Closed

ValueError base and exponent overflow #5765

sebaschi opened this issue Dec 17, 2024 · 6 comments
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval.

Comments

@sebaschi
Copy link

Steps to reproduce

  1. Make tar.xz compressed archive of 1.4 GB Folder resulting in ca 900 MB archive
  2. Move it to a folder synced with nextcloud (on a SFTP External Storage)
  3. Force Sync

Expected behavior

Sync Archive Succeeds

Actual behavior

Sync fails with server error.

Other information

Host OS

PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm

running in VM on Proxmox VE 8.3.1

Output of sudo docker info

Client: Docker Engine - Community
 Version:    27.4.0
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.19.2
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.31.0
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 14
  Running: 10
  Paused: 0
  Stopped: 4
 Images: 15
 Server Version: 27.4.0
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 88bf19b2105c8b17560993bee28a01ddc2f97182
 runc version: v1.2.2-0-g7cb3632
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.1.0-28-amd64
 Operating System: Debian GNU/Linux 12 (bookworm)
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 15.62GiB
 Name: debianvm-nc
 ID: 1f655ade-28d9-4477-8f42-884a3007ba4e
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Docker run command or docker-compose file that you used

Other valuable info

{"reqId":"cP7kvDbK7ZGWEnwft4ZI","level":3,"time":"2024-12-17T09:56:17+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"admin","app":"webdav","method":"PUT","url":"/remote.php/dav/uploads/admin/1488160469/00001","message":"base and exponent overflow","userAgent":"Mozilla/5.0 (Linux) mirall/3.14.2daily (Nextcloud, fedora-6.12.1-200.fc41.x86_64 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"30.0.4.1","exception":{"Exception":"ValueError","Message":"base and exponent overflow","Code":0,"Trace":[{"file":"/var/www/html/3rdparty/phpseclib/phpseclib/phpseclib/Math/BigInteger.php","line":3040,"function":"gmp_pow","args":[{"__class__":"GMP"},256]},{"file":"/var/www/html/3rdparty/phpseclib/phpseclib/phpseclib/Net/SSH2.php","line":1846,"function":"bitwise_leftShift","class":"phpseclib\\Math\\BigInteger","type":"->","args":[256]},{"file":"/var/www/html/3rdparty/phpseclib/phpseclib/phpseclib/Net/SSH2.php","line":1435,"function":"_key_exchange","class":"phpseclib\\Net\\SSH2","type":"->","args":[]},{"file":"/var/www/html/3rdparty/phpseclib/phpseclib/phpseclib/Net/SSH2.php","line":5217,"function":"_connect","class":"phpseclib\\Net\\SSH2","type":"->","args":[]},{"file":"/var/www/html/apps/files_external/lib/Lib/Storage/SFTP.php","line":110,"function":"getServerPublicHostKey","class":"phpseclib\\Net\\SSH2","type":"->","args":[]},{"file":"/var/www/html/apps/files_external/lib/Lib/Storage/SFTP.php","line":331,"function":"getConnection","class":"OCA\\Files_External\\Lib\\Storage\\SFTP","type":"->","args":[]},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php","line":209,"function":"file_exists","class":"OCA\\Files_External\\Lib\\Storage\\SFTP","type":"->","args":["archive/Download/downloads_2024_10_29.tar.xz"]},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php","line":209,"function":"file_exists","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->","args":["archive/Download/downloads_2024_10_29.tar.xz"]},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Availability.php","line":225,"function":"file_exists","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->","args":["archive/Download/downloads_2024_10_29.tar.xz"]},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php","line":209,"function":"file_exists","class":"OC\\Files\\Storage\\Wrapper\\Availability","type":"->","args":["archive/Download/downloads_2024_10_29.tar.xz"]},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php","line":209,"function":"file_exists","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->","args":["archive/Download/downloads_2024_10_29.tar.xz"]},{"file":"/var/www/html/lib/private/Files/View.php","line":1136,"function":"file_exists","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->","args":["archive/Download/downloads_2024_10_29.tar.xz"]},{"file":"/var/www/html/lib/private/Files/View.php","line":492,"function":"basicOperation","class":"OC\\Files\\View","type":"->","args":["file_exists","/bx11-storage/archive/Download/downloads_2024_10_29.tar.xz"]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Directory.php","line":255,"function":"file_exists","class":"OC\\Files\\View","type":"->","args":["/bx11-storage/archive/Download/downloads_2024_10_29.tar.xz"]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php","line":129,"function":"childExists","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["downloads_2024_10_29.tar.xz"]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/QuotaPlugin.php","line":148,"function":"nodeExists","class":"Sabre\\DAV\\Tree","type":"->","args":["files/admin/bx11-storage/archive/Download/downloads_2024_10_29.tar.xz"]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/QuotaPlugin.php","line":79,"function":"getPathForDestination","class":"OCA\\DAV\\Connector\\Sabre\\QuotaPlugin","type":"->","args":["files/admin/bx11-storage/archive/Download/downloads_2024_10_29.tar.xz"]},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"beforeCreateFile","class":"OCA\\DAV\\Connector\\Sabre\\QuotaPlugin","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***",{"__class__":"OCA\\DAV\\Upload\\UploadFolder"},false]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":1094,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["beforeCreateFile",["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***",{"__class__":"OCA\\DAV\\Upload\\UploadFolder"},false]]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["method:PUT",[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Server.php","line":43,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/apps/dav/lib/Server.php","line":371,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/appinfo/v2/remote.php","line":19,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/remote.php","line":146,"args":["/var/www/html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/3rdparty/phpseclib/phpseclib/phpseclib/Math/BigInteger.php","Line":3040,"message":"base and exponent overflow","exception":[],"CustomMessage":"base and exponent overflow"},"id":"67614ba4da882"}
@sebaschi sebaschi added the 0. Needs triage Pending approval or rejection. This issue is pending approval. label Dec 17, 2024
@szaimen
Copy link
Collaborator

szaimen commented Dec 17, 2024

Hi, please report this to https://github.com/nextcloud/server/issues

@szaimen szaimen closed this as completed Dec 17, 2024
@chefexperte
Copy link

I think this is a problem with the current nextcloud aio Docker image. It uses PHP 8.3. 14 which introduced arbitrary limits for some reason: php/php-src#16870

So just pushing a new version for Docker with a newer PHP version should fix that.

It's quite annoying because I can't upload anything to my external storage because of this. :(

@szaimen
Copy link
Collaborator

szaimen commented Dec 29, 2024

Hi, thanks for coming back to me. I suppose this should then be solved with the next php update? See #5790

@chefexperte
Copy link

From my understanding that should solve the problem, yes.

Is there a simple way I can test this on my server? Like changing only the Docker layer that sets the PHP version?

@chefexperte
Copy link

chefexperte commented Jan 1, 2025

I was on vacation for a few days, and only came back now. Nextcloud in the app worked fine, but desktop sync and the browser version both don't work at all, because of this error.

Files and Images apps both show nothing/error messages and I get tons of logs with "ValueError base and exponent overflow".

I have no idea why there aren't more people complaining, makes me think this is a me problem? Can someone take a look at this example of a log entry and tell me whether this could be caused by just the PHP version error I mentioned? I'd love to use my Nextcloud again, especially because I kind of depend on it for university etc.

Raw entry
{
  "reqId": "DbGmDlu8JbhZKosWUPJs",
  "level": 3,
  "time": "2025-01-01T17:41:24+00:00",
  "remoteAddr": "[REMOVED]",
  "user": "[REMOVED]",
  "app": "webdav",
  "method": "PROPFIND",
  "url": "/remote.php/dav/files/aaron/",
  "message": "base and exponent overflow",
  "userAgent": "Mozilla/5.0 (Linux) mirall/3.14.2daily (Nextcloud, fedora-6.11.10-300.fc41.x86_64 ClientArchitecture: x86_64 OsArchitecture: x86_64)",
  "version": "30.0.4.1",
  "exception": {
    "Exception": "ValueError",
    "Message": "base and exponent overflow",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/html/3rdparty/phpseclib/phpseclib/phpseclib/Math/BigInteger.php",
        "line": 3040,
        "function": "gmp_pow",
        "args": [
          {
            "__class__": "GMP"
          },
          256
        ]
      },
      {
        "file": "/var/www/html/3rdparty/phpseclib/phpseclib/phpseclib/Net/SSH2.php",
        "line": 1846,
        "function": "bitwise_leftShift",
        "class": "phpseclib\\Math\\BigInteger",
        "type": "->",
        "args": [
          256
        ]
      },
      {
        "file": "/var/www/html/3rdparty/phpseclib/phpseclib/phpseclib/Net/SSH2.php",
        "line": 1435,
        "function": "_key_exchange",
        "class": "phpseclib\\Net\\SSH2",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/3rdparty/phpseclib/phpseclib/phpseclib/Net/SSH2.php",
        "line": 5217,
        "function": "_connect",
        "class": "phpseclib\\Net\\SSH2",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/apps/files_external/lib/Lib/Storage/SFTP.php",
        "line": 110,
        "function": "getServerPublicHostKey",
        "class": "phpseclib\\Net\\SSH2",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/apps/files_external/lib/Lib/Storage/SFTP.php",
        "line": 541,
        "function": "getConnection",
        "class": "OCA\\Files_External\\Lib\\Storage\\SFTP",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php",
        "line": 581,
        "function": "getMetaData",
        "class": "OCA\\Files_External\\Lib\\Storage\\SFTP",
        "type": "->",
        "args": [
          ""
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Availability.php",
        "line": 429,
        "function": "getMetaData",
        "class": "OC\\Files\\Storage\\Wrapper\\Wrapper",
        "type": "->",
        "args": [
          ""
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php",
        "line": 581,
        "function": "getMetaData",
        "class": "OC\\Files\\Storage\\Wrapper\\Availability",
        "type": "->",
        "args": [
          ""
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Cache/Scanner.php",
        "line": 97,
        "function": "getMetaData",
        "class": "OC\\Files\\Storage\\Wrapper\\Wrapper",
        "type": "->",
        "args": [
          ""
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Cache/Scanner.php",
        "line": 134,
        "function": "getData",
        "class": "OC\\Files\\Cache\\Scanner",
        "type": "->",
        "args": [
          ""
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/View.php",
        "line": 1478,
        "function": "scanFile",
        "class": "OC\\Files\\Cache\\Scanner",
        "type": "->",
        "args": [
          ""
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Node/Folder.php",
        "line": 81,
        "function": "getDirectoryContent",
        "class": "OC\\Files\\View",
        "type": "->",
        "args": [
          "/aaron/files/",
          "",
          {
            "__class__": "OC\\Files\\Node\\LazyUserFolder"
          }
        ]
      },
      {
        "file": "/var/www/html/lib/private/Share20/DefaultShareProvider.php",
        "line": 647,
        "function": "getDirectoryListing",
        "class": "OC\\Files\\Node\\Folder",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/lib/private/Share20/Manager.php",
        "line": 1121,
        "function": "getSharesInFolder",
        "class": "OC\\Share20\\DefaultShareProvider",
        "type": "->",
        "args": [
          "aaron",
          {
            "__class__": "OC\\Files\\Node\\Folder"
          },
          true
        ]
      },
      {
        "function": "OC\\Share20\\{closure}",
        "class": "OC\\Share20\\Manager",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/html/lib/private/Share20/Manager.php",
        "line": 1120,
        "function": "array_reduce",
        "args": [
          [
            "*** sensitive parameters replaced ***",
            {
              "__class__": "OCA\\FederatedFileSharing\\FederatedShareProvider"
            },
            {
              "__class__": "OCA\\ShareByMail\\ShareByMailProvider"
            },
            {
              "__class__": "OCA\\Circles\\ShareByCircleProvider"
            },
            {
              "__class__": "OCA\\Talk\\Share\\RoomShareProvider"
            },
            "And 1 more entries, set log level to debug to see all entries"
          ],
          {
            "__class__": "Closure"
          },
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/html/apps/dav/lib/Connector/Sabre/SharesPlugin.php",
        "line": 121,
        "function": "getSharesInFolder",
        "class": "OC\\Share20\\Manager",
        "type": "->",
        "args": [
          "aaron",
          {
            "__class__": "OC\\Files\\Node\\Folder"
          },
          true
        ]
      },
      {
        "file": "/var/www/html/apps/dav/lib/Connector/Sabre/SharesPlugin.php",
        "line": 185,
        "function": "getSharesFolder",
        "class": "OCA\\DAV\\Connector\\Sabre\\SharesPlugin",
        "type": "->",
        "args": [
          {
            "__class__": "OC\\Files\\Node\\Folder"
          }
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line": 89,
        "function": "handleGetProperties",
        "class": "OCA\\DAV\\Connector\\Sabre\\SharesPlugin",
        "type": "->",
        "args": [
          {
            "__class__": "Sabre\\DAV\\PropFind"
          },
          {
            "__class__": "OCA\\DAV\\Files\\FilesHome"
          }
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 1052,
        "function": "emit",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          "propFind",
          [
            {
              "__class__": "Sabre\\DAV\\PropFind"
            },
            {
              "__class__": "OCA\\DAV\\Files\\FilesHome"
            }
          ]
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 984,
        "function": "getPropertiesByNode",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          {
            "__class__": "Sabre\\DAV\\PropFind"
          },
          {
            "__class__": "OCA\\DAV\\Files\\FilesHome"
          }
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 1662,
        "function": "getPropertiesIteratorForPath",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          "files/aaron",
          [
            "{DAV:}resourcetype",
            "{DAV:}getlastmodified",
            "{DAV:}getcontentlength",
            "{DAV:}getetag",
            "{http://owncloud.org/ns}size",
            "And 10 more entries, set log level to debug to see all entries"
          ],
          1
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 1647,
        "function": "writeMultiStatus",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          {
            "__class__": "Sabre\\Xml\\Writer",
            "elementMap": "*** sensitive parameters replaced ***",
            "contextUri": "/remote.php/dav/",
            "namespaceMap": {
              "DAV:": "d",
              "http://sabredav.org/ns": "s",
              "http://owncloud.org/ns": "oc",
              "http://nextcloud.org/ns": "nc"
            },
            "classMap": "*** sensitive parameters replaced ***"
          },
          {
            "__class__": "Generator"
          },
          false
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
        "line": 346,
        "function": "generateMultiStatus",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          {
            "__class__": "Generator"
          },
          false
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line": 89,
        "function": "httpPropFind",
        "class": "Sabre\\DAV\\CorePlugin",
        "type": "->",
        "args": [
          {
            "__class__": "Sabre\\HTTP\\Request"
          },
          {
            "__class__": "Sabre\\HTTP\\Response"
          }
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 472,
        "function": "emit",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          "method:PROPFIND",
          [
            {
              "__class__": "Sabre\\HTTP\\Request"
            },
            {
              "__class__": "Sabre\\HTTP\\Response"
            }
          ]
        ]
      },
      {
        "file": "/var/www/html/apps/dav/lib/Connector/Sabre/Server.php",
        "line": 43,
        "function": "invokeMethod",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          {
            "__class__": "Sabre\\HTTP\\Request"
          },
          {
            "__class__": "Sabre\\HTTP\\Response"
          }
        ]
      },
      {
        "file": "/var/www/html/apps/dav/lib/Server.php",
        "line": 371,
        "function": "start",
        "class": "OCA\\DAV\\Connector\\Sabre\\Server",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/apps/dav/appinfo/v2/remote.php",
        "line": 19,
        "function": "exec",
        "class": "OCA\\DAV\\Server",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/remote.php",
        "line": 146,
        "args": [
          "/var/www/html/apps/dav/appinfo/v2/remote.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/html/3rdparty/phpseclib/phpseclib/phpseclib/Math/BigInteger.php",
    "Line": 3040,
    "message": "base and exponent overflow",
    "exception": [],
    "CustomMessage": "base and exponent overflow"
  },
  "id": "677580e0c1178"
}

EDIT: I changed my Nextcloud aio version to one earlier (nextcloud/all-in-one:20241125_091756) which has a lower PHP version, now I have AIO 10.0.0; Nextcloud itself shows it is still 30.0.4. AIO showed me it would perform an update after changing to the lower version, I don't know what it did. But for now everything works without errors.

@szaimen
Copy link
Collaborator

szaimen commented Jan 7, 2025

The PR #5790 is now released with v10.3.0 Beta. Testing and feedback is welcome! See https://github.com/nextcloud/all-in-one#how-to-switch-the-channel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval.
Projects
None yet
Development

No branches or pull requests

3 participants