You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Not enough free space" when uploading: Sometimes wrong freeSpace calculation #49201
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.
When Clicking "New Issue", there's no reporting template, didn't skip anything...
excerpt from file-upload.js:
var freeSpace = 0;
(...)
if (!self.fileList || upload.getTargetFolder() === self.fileList.getCurrentDirectory()) {
// Use global free space if there is no file list to check or the current directory is the target
freeSpace = $('input[name=free_space]').val()
} else if (upload.getTargetFolder().indexOf(self.fileList.getCurrentDirectory()) === 0) {
// Check subdirectory free space if file is uploaded there
// Retrieve the folder destination name
var targetSubdir = upload._targetFolder.split('/').pop()
freeSpace = parseInt(upload.uploader.fileList.getModelForFile(targetSubdir).get('quotaAvailableBytes'))
}
There's no else branch, so if the conditions aren't met, no freespace is assumed, which is wrong in most cases and prevents uploads unnecessarily.
Initializing freeSpace with -1 is a viable fix, because this will let the final word to the server, who knows it better anyway.
When Clicking "New Issue", there's no reporting template, didn't skip anything...
Are you on a mobile device? Sometimes GitHub doesn't use the correct Issue templates on mobile platforms.
so if the conditions aren't met, no freespace is assumed, which is wrong in most cases and prevents uploads unnecessarily.
Can you provide a specific example that triggers one of these scenarios in v28-v30?
I'm using an app [...]
What app?
P.S. This code has been in place since NC 22 (#24102). It's also gone from our master branch (upcoming v31), but if there is an actual bug we'd likely want to fix it for the still supported v28-v30 branches.
P.P.S. This appears to be a duplicate of your report in #27367
@solracsf When I created the issue, there was no selection as can be seen now on "New issue"; instead, I was directed to the blank issue directly.
@joshtrichards It's my own app which accepts files on some spot, not published. Seems that not too many people can trigger this bug.
Since the code will be gone soon, I'd have to recode that, to use the new stuff anyway. Can you give me an upfront hint where to look at?
Activity
joshtrichards commentedon Nov 11, 2024
I'm having difficulty following your report and, unfortunately, you completely skipped our reporting template.
OCis not a public API.If you're trying to report a bug, please provide reproduction steps/etc.
Note that v20 reached end-of-life years ago.
andreas-p commentedon Nov 11, 2024
When Clicking "New Issue", there's no reporting template, didn't skip anything...
excerpt from file-upload.js:
There's no
elsebranch, so if the conditions aren't met, no freespace is assumed, which is wrong in most cases and prevents uploads unnecessarily.Initializing freeSpace with -1 is a viable fix, because this will let the final word to the server, who knows it better anyway.
joshtrichards commentedon Nov 11, 2024
Are you on a mobile device? Sometimes GitHub doesn't use the correct Issue templates on mobile platforms.
Can you provide a specific example that triggers one of these scenarios in v28-v30?
What app?
P.S. This code has been in place since NC 22 (#24102). It's also gone from our master branch (upcoming v31), but if there is an actual bug we'd likely want to fix it for the still supported v28-v30 branches.
P.P.S. This appears to be a duplicate of your report in #27367
solracsf commentedon Nov 12, 2024
@joshtrichards Users now have a "Blank issue" option...
https://github.com/nextcloud/server/issues/new?template=Blank+issue
andreas-p commentedon Nov 13, 2024
@solracsf When I created the issue, there was no selection as can be seen now on "New issue"; instead, I was directed to the blank issue directly.
@joshtrichards It's my own app which accepts files on some spot, not published. Seems that not too many people can trigger this bug.
Since the code will be gone soon, I'd have to recode that, to use the new stuff anyway. Can you give me an upfront hint where to look at?