nextcloud / server

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

[Bug]: timeout not set in S3Client #46303

Closed FedericoHeichou closed 1 week ago

FedericoHeichou commented 2 weeks ago

⚠️ This issue respects the following points: ⚠️

Bug description

The timeout is not set in the S3Client options.

https://github.com/nextcloud/server/blob/03d71e859cc28adcb774f60f4955b7ce0b41f716/lib/private/Files/ObjectStore/S3ConnectionTrait.php#L92-L103

If my s3 is unreachable and I run occ file:scan, it sets a lock on the file and hangs forever.

Changing the options like this works

'http' => ['verify' => $this->getCertificateBundlePath(), 'connect_timeout' => 10, 'timeout' => 10],

But it does not log anything in the file:scan and it is not marked as an error (maybe this is normal).

Steps to reproduce

  1. Setup a external storage with type Amazon S3
  2. Simulate a network problem
  3. Do occ files:scan

Expected behavior

There should be a (configurable) timeout and should raise a error.

Installation method

None

Nextcloud Server version

28

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

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

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

solracsf commented 1 week ago

PR at https://github.com/nextcloud/server/pull/46317