nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.39k stars 4.07k forks source link

[Bug]: S3 provider broken against GuzzleHttp #39407

Closed origintopleft closed 1 year ago

origintopleft commented 1 year ago

⚠️ This issue respects the following points: ⚠️

Bug description

When syncing to NextCloud 27.0.0, most files sync fine, but some files fail, with the client reporting HTTP 500 errors. This is printed in the logs when those files fail (I watched the logs and initiated a sync to see what the error is)

PHP Fatal error:  Declaration of Aws\\S3\\ObjectCopier::promise() must be compatible with GuzzleHttp\\Promise\\PromisorInterface::promise(): GuzzleHttp\\Promise\\PromiseInterface in /var/www/html/3rdparty/aws/aws-sdk-php/src/S3/ObjectCopier.php on line 82

My guess is either GuzzleHttp (or the object copier in the S3 support) recently had an ABI-breaking change and the other component has yet to update for it.

Steps to reproduce

  1. Have the S3 provider as your primary Nextcloud storage. (I'm using WasabiSys specifically, but I'm not sure this matters)
  2. Have files in your Nextcloud folder.
  3. Sync.

Expected behavior

Successful sync

Installation method

Community Docker image

Nextcloud Server version

27

Operating system

RHEL/CentOS

PHP engine version

PHP 8.2

Web server

Nginx

Database engine version

MariaDB

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

Upgraded to a MAJOR version (ex. 22 to 23)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

Configuration report

{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "objectstore": {
            "class": "\\OC\\Files\\ObjectStore\\S3",
            "arguments": {
                "bucket": "nextcloud.otl-hga.net",
                "region": "us-west-1",
                "hostname": "s3.us-west-1.wasabisys.com",
                "port": "443",
                "objectPrefix": "urn:oid:",
                "autocreate": false,
                "use_ssl": true,
                "use_path_style": true,
                "legacy_auth": false,
                "key": "***REMOVED SENSITIVE VALUE***",
                "secret": "***REMOVED SENSITIVE VALUE***"
            }
        },
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "nextcloud.otl-hga.net"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "27.0.0.8",
        "overwrite.cli.url": "https:\/\/nextcloud.otl-hga.net",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "overwriteprotocol": "https",
        "app_install_overwrite": [
            "admin_notifications"
        ],
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "loglevel": 2,
        "maintenance": false,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtpport": "587",
        "mail_smtpsecure": "ssl"
    }
}

List of activated Apps

Enabled:
  - activity: 2.19.0
  - admin_notifications: 1.0.2
  - bookmarks: 13.0.1
  - calendar: 4.4.3
  - circles: 27.0.0
  - cloud_federation_api: 1.10.0
  - comments: 1.17.0
  - contacts: 5.3.2
  - contactsinteraction: 1.8.0
  - cookbook: 0.10.2
  - dashboard: 7.7.0
  - dav: 1.27.0
  - deck: 1.10.0
  - federatedfilesharing: 1.17.0
  - federation: 1.17.0
  - files: 1.22.0
  - files_external: 1.19.0
  - files_fulltextsearch: 27.0.0
  - files_pdfviewer: 2.8.0
  - files_rightclick: 1.6.0
  - files_sharing: 1.19.0
  - files_trashbin: 1.17.0
  - files_versions: 1.20.0
  - firstrunwizard: 2.16.0
  - fulltextsearch: 27.0.0
  - fulltextsearch_elasticsearch: 27.0.0
  - logreader: 2.12.0
  - lookup_server_connector: 1.15.0
  - metadata: 0.19.0
  - nextcloud_announcements: 1.16.0
  - notifications: 2.15.0
  - oauth2: 1.15.0
  - password_policy: 1.17.0
  - photos: 2.3.0
  - previewgenerator: 5.3.0
  - privacy: 1.11.0
  - provisioning_api: 1.17.0
  - recommendations: 1.6.0
  - related_resources: 1.2.0
  - richdocuments: 8.1.0
  - richdocumentscode: 23.5.103
  - serverinfo: 1.17.0
  - settings: 1.9.0
  - sharebymail: 1.17.0
  - side_menu: 3.9.1
  - support: 1.10.0
  - survey_client: 1.15.0
  - systemtags: 1.17.0
  - tasks: 0.15.0
  - text: 3.8.0
  - theming: 2.2.0
  - twofactor_backupcodes: 1.16.0
  - updatenotification: 1.17.0
  - user_saml: 5.2.0
  - user_status: 1.7.0
  - viewer: 2.1.0
  - weather_status: 1.7.0
  - workflowengine: 2.9.0
Disabled:
  - admin_audit: 1.17.0
  - bruteforcesettings: 2.7.0
  - encryption: 2.15.0
  - externalpassword: 1.1.0 (installed 1.1.0)
  - suspicious_login: 5.0.0
  - twofactor_totp: 9.0.0
  - user_ldap: 1.17.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

The output of `docker compose logs --since 3h --no-color` is too long for a GitHub issue, so here's a pastebin: https://pastebin.com/BVXENjy5

Additional info

PHP engine version retrieved via docker compose exec nextcloud php --version. All other answers are based on host answers (Fedora 37, nginx as reverse proxy).

kesselb commented 1 year ago

Thanks for your report :+1:

https://github.com/nextcloud/3rdparty/blob/stable27/aws/aws-sdk-php/src/S3/ObjectCopier.php#L82 https://github.com/nextcloud/3rdparty/blob/stable27/guzzlehttp/promises/src/PromisorInterface.php#L15

The state in git looks okay to me.

It happens that apps ship their copy of guzzle accidentally.

find /path/to/nextcloud/installation -name "PromisorInterface.php" to find all files containing the function definition.

origintopleft commented 1 year ago

Aha! In my case, it was fulltextsearch-elasticsearch that had done it! Not sure why that was even installed, I don't have an elasticsearch instance on this network, but I'll go ahead and uninstall that (and let those devs know what happened.) Thank you!