Android Talk upload results in 0 B files when using S3 primary storage on Nextcloud 31.0.9 (and 31.0.10) — works fine on 30.0.16

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 31.0.9 (also reproduced on 31.0.10)
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 22.04 LTS
  • Web server and version (e.g, Apache 2.4.25):
    • Apache 2.4
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • HAProxy 2.6 (acting as SSL termination + load balancer)
  • PHP version (e.g, 8.3):
    • 8.2.29
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • After upgrading from 30.0.16 → 31.0.9
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Manual archive install (bare metal)
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

When using Android Talk v22.0.2 on Nextcloud 31.x configured with Amazon S3 as primary storage, all uploads (images, PDFs, etc.) appear as 0 B files and can’t open even though the upload completes.

The exact same configuration works perfectly on Nextcloud 30.0.16, and also when using a local data directory (/var/www/html/nextcloud/data).
→ This regression occurs only when S3 is the primary storage.

Steps

  1. Configure Nextcloud 31.0.9 (or 31.0.10) with S3 as primary storage

  2. Connect Android Talk 22.0.2 to the server

  3. Send any photo or PDF via Talk

  4. Upload finishes but file shows 0 B in Talk and Web UI

  5. Same operation via Web UI or iOS Talk → OK

Log entries

dirty table reads: SELECT fileid FROM *PREFIX*filecache
OC\Image::fixOrientation(): No image loaded
userAgent: Mozilla/5.0 (Android) Nextcloud-Talk v22.0.2

The output of your Apache/nginx/system log in /var/log/____:

No Apache errors; S3 PUT requests return 200 OK.

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

'objectstore' => [
  'class' => 'OC\\Files\\ObjectStore\\S3',
  'arguments' => [
      'bucket' => '******',
      'key' => '******',
      'secret' => '******',
      'autocreate' => true,
      'region' => 'ap-northeast-1',
      'use_ssl' => false,
      'use_path_style' => true,
      'timeout' => 120,
      'uploadPartSize' => 524288000,
  ],
],
'part_file_in_storage' => false,
'tempdirectory' => '/var/www/html/nextcloud/data/tmp',

look at existing bug reports [Bug]: Expected filesize of ... bytes but read with S3 storage and special characters · Issue #55665 · nextcloud/server · GitHub looks similar to your problem

1 Like

Hey!

Yeah, this looks like an issue with how Nextcloud 31 handles S3 uploads — works fine on 30.0.16, so it’s likely a regression. I’d check the logs for any S3 write errors or upload truncation. Probably worth reporting on GitHub so the devs can patch it.

1 Like

Thanks for your comment :innocent:
I uploaded the image from the Android Talk app.
The upload succeeded on S3 — the object exists and has the correct size.
However, the file appears as 0 B in both the Web UI and the database.

Database result:

SELECT fileid, path, size, storage FROM oc_filecache WHERE fileid = 4896600;
+---------+------------------------------------+------+---------+
| fileid  | path                               | size | storage |
+---------+------------------------------------+------+---------+
| 4896600 | files/Talk/2025-11-06 10-32-17.jpg |    0 |      14 |
+---------+------------------------------------+------+---------+

S3 result:

aws s3 ls s3://test-bucket/ --recursive | grep "urn:oid:4896600"
2025-11-06 10:32:29    2183851 urn:oid:4896600

So the object is correctly stored in S3 (2,183,851 bytes), but Nextcloud reports it as 0 B.
It looks like a metadata inconsistency between S3 and the database, but I could be wrong.