nextcloud / nextcloud/server

Not enough free space" when uploading: Sometimes wrong freeSpace calculation

Open
#49,201 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Somewhere between 20.0.1 and 20.0.9, the calculation of freespace when uploading was changed.

I'm using an app that uploads to not-yet-existing directories, relying on NC creating them implicitely which works fine, unless freeSpace is not calculated (and thus 0) which happens in this case.

Previously, file-upload.js OC.FileUpload.add() would just use the global freeSpace from $('#free_space').val(). Now, freeSpace is initialized as 0, and calculated for some data scenarios. If those scenarios are not met, it will remain 0, failing the upload with "Not enough free space".

freeSpace should be initialized to the global freeSpace as before, and then recalculated for specific situations to make sure freeSpace is valid in all situations.

Issue is still present in NC30.

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 in file-upload.js at OC.FileUpload.add() and inspect how freeSpace is initialized and how the global value from $('#free_space').val() is used. Reproduce an upload to a not-yet-existing directory, then verify that the upload no longer reports “Not enough free space” when the specific recalculation scenarios are not met.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.