Closed Enrico204 closed 3 years ago
If you think that the solution is correct (changing 400 Bad request
to a 5xx
error), I can prepare a pull request.
Also, I suggest to use 507 Insufficient Storage
error (RFC 4918, WebDAV). Even if we are not using WebDAV, we can use this code as it's standard, and it's clear enough to clients :-)
Note: I saw the current work on quota manager on master
branch, and I think that the error code when out of quota should be switched to 507 Insufficient storage
.
Currently, "413 Request entity is too large" (the currently used error code) seems to imply that the HTTP request is too large, which is not the case. I think that "Insufficient storage" will be more appropriate in this case.
I can include this in the pull request as well, if you agree :-)
507 Insufficient Storage
would definitely be more helpful to a user.
This should also be applied to Write errors that return ENOSPC
or EDQUOT
and explain which of the errors caused it in the end, but this will require some OS specific syscall
checks.
I created a pull request with a proposal for the change :-)
Feel free to add comments! I haven't written any test or documentation yet, I'll do it :-)
The pull request was merged, this change has been implemented :tada:
Output of
rest-server --version
rest-server 0.10.0 compiled with go1.15.2 on linux/amd64
How did you run rest-server exactly?
When executed with
--debug
, it says also (see below):What backend/server/service did you use to store the repository?
ZFS dataset
Expected behavior
On disk full,
rest-server
should reply something like HTTP status5xx
Actual behavior
Currently, rest-server replies
400 Bad request
Steps to reproduce the behavior
Create a partition / ZFS dataset / any store with low capacity. Backup a very big set of data. When the backend partition is full, restic client is saying:
In my case, the data I'm saving is 800 GB, the backend partition size is 750 GB.
Do you have any idea what may have caused this?
The backend storage capacity is full, however the error is mishandled (4xx is a client error, this is actually a "server" error)
Do you have an idea how to solve the issue?
rest-server
should reply with5xx
as "disk full" is a "server error" (it can't be solved by the client itself).Did rest-server help you today? Did it make you happy in any way?
Yes, I'm using it day-by-day to backup all my RPis and my laptop at home at full speed :-D