File-upload unusable with no user quota (hard to debug)
Describe the bug
I run a NextCloud instance where all users have their quotas set to 0B and everything is in Group Folders. This means that file-upload fields in Forms are unusable, as a permissions error is thrown when trying to upload a file, and there seems to be nothing that can be done about it. Furthermore, the upload fails silently and users (form creators or form fillers) are very confused! Even the NotPermittedException error in the admin logs isn't as helpful as it might be (I just spent 15 minutes checking file permissions and scratching my head before I guessed that this might be the issue).
To Reproduce Set user quota to 0B; user can no longer use file-upload on Forms, and will not understand why.
Expected behavior Ideally, a way to use group folders for file-upload Forms. Or at least a notification or other indication that it's not going to work.
Nextcloud (please complete the following information):
- Nextcloud-Version: 31.0.8
- Forms-Version: 5.1.2
Browser log Server returns 500 errors.
Additional context
Admin log shows:
Level: Error
Application: no app in context
Message: NotPermittedException Could not create folder "/<user>/files/Forms/unsubmitted/<timestamp>/2 - Test Form/3 - file-upload"
@simonwiles this is not a real bug, but by design. The files of a form get uploaded to the owner's files. If this user has a quota of 0, the files can't be uploaded.
@susnux @Koc we could work around this by only allowing to add file questions if the owner has no quota or at least some reasonable space available. Or we move the file storage to the app data. What do you think?
Right now a user can successfully create a form, publish it (not knowing there is no way it can be successfully submitted), and then when folks try to fill it out and the backend returns 500 errors and the UI shows nothing 😟. Feels a bit like a bug.
Yes, but it's totally how it's designed right now... This doesn't mean that this can't be improved 👍🏻
we could work around this by only allowing to add file questions if the owner has no quota or at least some reasonable space available. Or we move the file storage to the app data. What do you think?
This will not work properly because quota is dynamic what happens if you change it right between those actions? But I think we should at least show a warning for the file type question if there is no quota at the moment of editing / creation.
App data is really bad, this has many drawbacks with potential security pitfalls which we saw in the past. The best is to stick with user storage as then all security and sharing problem are already covered and we do not risk any serve problem here.
So I think the best here is to fail gracefully if the form cannot be submitted due to insufficient storage and also show a warning for the forms owner if they have no or only small storage left and want to use the file type.
Is there no way to have the Forms app use Group Folder storage, so that the file questions would actually be usable?
Is there no way to have the Forms app use Group Folder storage, so that the file questions would actually be usable?
@simonwiles please see this comment/issue here: https://github.com/nextcloud/forms/issues/2684#issuecomment-3287879955
So I think the best here is to fail gracefully if the form cannot be submitted due to insufficient storage and also show a warning for the forms owner if they have no or only small storage left and want to use the file type.
@susnux What do you mean with "failing gracefully"? If the file question is required, you can't even submit the form because of a failing validation. Would it be possible to trigger a notification for the form owner when uploading files to an unsubmitted form fails?
And in addition the warning during form creation... 👍🏻
Is there no way to have the Forms app use Group Folder storage, so that the file questions would actually be usable?
@simonwiles please see this comment/issue here: #2684 (comment)
Thanks, I'll keep an eye on that issue then 👍 For now Forms is unusable for me :(
As an alternative you could post a link to an upload share in the Files app where people can upload the files. But this depends of course on what your form is about and who your users are.