Repository navigation
Handle storages not being available in webui and webdav - #9311
Conversation
There was a problem hiding this comment.
You will need to change all subclasses as well.
I'd prefer that you leave it as it was and use reloadCallback for now to avoid further regressions.
We can look into using your approach in OC 8.
There was a problem hiding this comment.
I checked the subclasses and the ones that need it do override reload() and reloadCallback() so the code you added won't have any effect there, which is fine.
We don't need that logic for the shared file list or mount point file list.
So you can ignore this comment.
Let's discuss the 404 case: does it make sense to automatically remove the local mount when getting a 404 ? I can imagine that in some cases if the remote apache config has an issue that any URL would give a 404 as a temporary error. In such cases we might not want to remove the share. Depending on the result of this, it might be acceptable to just show an error message.
|
|
For the 404 case: maybe there's a way to check whether the 404 is coming from ownCloud or from Apache. If it's from a running ownCloud, then it means the share is gone and should be removed. CC @schiesbn |
|
💣 Test Failed. 💣 |
|
In case of a 404 we could send a second request to check if the ownCloud is accessible and running, maybe query the status.php or use the testremote ajax call? If we get a 404 but the server is available we remove the mount, if not we keep it. |
|
Added additional checks to see why the remote share is unavailable, if it detects that the share is removed it now removes storage and throws an appropriate exception |
There was a problem hiding this comment.
Is this still reachable ? Is there a case where getShareInfo() will not throw an exception ? (just to clarify)
There was a problem hiding this comment.
It's unlikely but not impossible so I kept it in
|
@icewind1991 I hijacked your PR with a quickfix (for password testing). Hope it's ok 😄 |
|
I went through the test steps again and it works.
|
|
Ideally the storage mount should disappear when I browse its parent, but that's again #5036 and possibly unefficient so let's leave it for now. |
|
There is an issue with the sync client, steps:
Instead of just saying 404 not found, the sync client asks for authentication. Please double check what is returned to the sync client when uploading to an expired remote share. |
|
💣 Test Failed. 💣 |
|
💣 Test Failed. 💣 |
|
@icewind1991 failing unt test message: |
|
A new inspection was created. |
|
@PVince81 fixed WebDAV returning a 401 instead of a 404 when uploading something to an invalid share |
|
Another issue: I changed the password of the remote share and now the sync client says "Service not available". We probably need another error code for when the password has changed or when "Storage not available" is shown. @dragotin @ogoffart is there any good error code for the sync client for when an ext storage is temporarily not available ? 503 doesn't seem to be adequate. |
|
|
Also I found an annoying warning while testing, fix is here: #9362 |
|
What should the client do in that case? |
|
The problem at the moment is that the client seems to believe that the whole server is not available, the icon itself grays out. It also seems to stop syncing at this point but cannot confirm that. |
|
I see, this happens during the update phase. Currently for the client it's all of nothing. |
|
🚀 Test Passed. 🚀 |
|
Ok understood. I think the current behavior is not acceptable: that the client stops. |
|
Note: I'm ok with merging this first if needed, we can fix the status code separately, but I think it needs to be addressed for OC 7 CE. |
|
code looks good 👍 |
|
👍 merging this now. Will open a separate issue to handle the 503 issue. |
Handle storages not being available in webui and webdav
|
Please follow up here for the 503 issue: #9376 |
Adds
\OCP\Files\StorageNotAvailableExceptionwhich can be thrown by storage backends for when previously configured storage backends are (temporary) not available.This exception is handled by both the web ui (show an error message) and WebDAV (throw a 503)
For #9088
cc @PVince81 @DeepDiver1975 @schiesbn