[Bug]: Cannot upload file that exactly fits the storage quota
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
1️⃣ ❌ Cannot upload content that exactly fits the quota
curl -XPUT 'http://nextcloud.local/remote.php/dav/files/demo/lorem.txt' -d "1234567890" -u demo:demo -v
< HTTP/2 413
...
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
<s:exception>OCA\DAV\Connector\Sabre\Exception\EntityTooLarge</s:exception>
<s:message>Insufficient space</s:message>
</d:error>
2️⃣ ❌ Cannot download the existing file if the storage is completely full.
When trying to download the file after the storage quota get completely used. (e.g: 10B/10B), the download request fails with 503 status error.
curl 'http://nextcloud.local/remote.php/dav/files/demo/lorem.txt' -u demo:demo -v
< HTTP/2 503
...
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
<s:exception>Sabre\DAV\Exception\ServiceUnavailable</s:exception>
<s:message>Could not open file: lorem.txt (345), file does seem to exist</s:message>
</d:error>
👉 NOTE: the above actions work in NC33 (Nextcloud Hub 26 Winter (33.0.2))
Steps to reproduce
Upload:
- Create a user with some bytes of quota (e.g: 10B)
- As new user, Upload a file that fits the 10B ❌
Donwload:
- As user, upload 8bytes file
- As admin, reduce the user quota to 8B
- As user, try to download that file ❌
Expected behavior
Should be able to download existing files.
Nextcloud Server version
34 (master): Nextcloud Hub 26 Spring (34.0.0 beta 4)
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?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing both cases through the WebDAV upload and download requests described in the issue, then trace the server's quota checks and file-opening path. Done means a file whose size exactly matches the quota can be uploaded and existing files remain downloadable after the quota is fully consumed or reduced to their size.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100