nextcloud / nextcloud/server

[Bug]: Cannot upload file that exactly fits the storage quota

Open
#60,319 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 34-feedback bug feature: dav
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
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:

  1. Create a user with some bytes of quota (e.g: 10B)
  2. As new user, Upload a file that fits the 10B ❌

Donwload:

  1. As user, upload 8bytes file
  2. As admin, reduce the user quota to 8B
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.