Upload Errors in Nextcloud Talk - Expected Filesize Mismatch When Uploading Videos

Nextcloud version (eg, 24.0.1): 28.0.8
Talk Server version (eg, 14.0.2): 18.0.8
Custom Signaling server configured: yes, running on a separate Debian server (version unknown)
Custom TURN server configured: yes, running on a separate Debian server
Custom STUN server configured: yes, running on a separate Debian server

In case mobile Nextcloud Talk apps are involved:
Talk iOS version (eg, 14.0.2): 20.1.1 (confirmed via logs)

The issue you are facing:
Users are experiencing upload errors or timeouts when uploading videos (e.g., .mov files) to Nextcloud Talk conversations. Logs show a mismatch between the expected file size and the actual size written to storage, suggesting a network issue or server-side problem. Additionally, there are thousands of files in the Talk folders (e.g., 2,621 files for one user), which might contribute to performance issues.

Is this the first time you’ve seen this error? (Y/N):No

Steps to replicate it:

  1. Open the Nextcloud Talk app on iOS (v20.1.1 confirmed).
  2. Start or join a conversation with another user.
  3. Upload a video file (e.g., a .mov file around 15–20MB) to the conversation.
  4. Observe an error or timeout, with logs reporting a filesize mismatch.

The output of your Nextcloud log in Admin > Logging or errors in nextcloud.log in /var/www/:

{"reqId":"hQ0BPvW1GBqGdMPeimhL","level":3,"time":"2025-02-20T02:01:43+00:00","remoteAddr":"X.X.X.X","user":"4D78EB84-F9C2-498F-87C7-181A4A382168","app":"no app in context","method":"PUT","url":"/remote.php/dav/files/4D78EB84-F9C2-498F-87C7-181A4A382168/Talk/IMG_6253.mov","message":"Expected filesize of 15025624 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 13041664 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.","userAgent":"Mozilla/5.0 (iOS) Nextcloud-Talk v20.1.1","version":"28.0.8.1","exception":{"Exception":"Sabre\\DAV\\Exception\\BadRequest","Message":"Expected filesize of 15025624 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 13041664 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side."}}

{"reqId":"eMyYyB087FzPz43gVVdq","level":3,"time":"2025-02-17T09:16:09+00:00","remoteAddr":"X.X.X.X","user":"D6D14D71-0964-485B-AA6F-198BB491CE67","app":"no app in context","method":"PUT","url":"/remote.php/dav/files/D6D14D71-0964-485B-AA6F-198BB491CE67/Talk/IMG_4329.mov","message":"Expected filesize of 20269665 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 589824 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.","userAgent":"Mozilla/5.0 (iOS) Nextcloud-Talk v20.1.1","version":"28.0.8.1","exception":{"Exception":"Sabre\\DAV\\Exception\\BadRequest","Message":"Expected filesize of 20269665 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 589824 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side."}}

Additional Information:
erver setup:

  • Hosted on Ubuntu 20.04.2 LTS with an SSD.
  • Storage: 133GB free out of 394GB:
    /dev/mapper/nc--data-data1       394G  261G  133G  67% /data
    
  • No quota issues:
    free: 142286405632 bytes 
    used: 1933104478 bytes
    total: 144219510110 bytes 
    relative: 1.34%
    quota: -3 (no quota)
    

Talk folder file counts:

  • User 4D78EB84-F9C2-498F-87C7-181A4A382168: 2,621 files total.

    • Files older than 200 days: 2,124
    • Breakdown by format (for files >200 days):
      find /data/nextcloud_data/4D78EB84-F9C2-498F-87C7-181A4A382168/files/Talk -type f -mtime +200 -name "*.*" | awk -F'.' '{print tolower($NF)}' | sort | uniq -c | sort -nr
      
      (Output not provided yet, but I can run it—likely many .mov files given the upload issue.)
  • User D6D14D71-0964-485B-AA6F-198BB491CE67: 942 files total.

Chunked upload config:

  • Max chunk size set to 1GB:
    "files.chunked_upload.max_size": 1097152000
    
  • Videos (15–20MB) are well below this, but I’ve considered lowering it to 10MB or 20MB for stability.

I’d appreciate any suggestions on troubleshooting or fixes—should I adjust chunk size, check the custom servers, or focus on network/storage?

Thanks for your help!

Are you able to upload similar files successfully by other means to this same Nextcloud instance? I.e. via the Web UI.

Also, I presume the Android Files client experiences the same problem for you?

What does your web infrastructure look like? Apache, Nginx, etc.? FPM or mod_php? Reverse Proxy?

Please check the error logs of your web server and, if in-use, also your reverse proxy during one of these upload attempts.

Also please note:

  • The chunk size parameter you’re trying to use is not applicable to v28.
  • v28 is end-of-life. It would be best to debug on a supported release.
  • 28.0.8 isn’t the latest maintenance release published for v28. It would at least be best to debug on the final maintenance release that was published for v28.