-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix removing remote shares when the remote server is unreachable #25332
Fix removing remote shares when the remote server is unreachable #25332
Conversation
🤖 beep boop beep 🤖 Here are the logs for the failed build: Status of 1696: failureintegration-federation_features
Show full log
|
Master is Nextcloud 22 now. |
/backport to stable21 |
/backport to stable20 |
/backport to stable19 |
e8cd226
to
cfee9a2
Compare
Help needed I have rebased on latest master and added a few more test scenarios. I tested the change suggested by @kesselb for However, although it is possible to delete the file using the Files app the last integration test does not pass even with that change. The problem is that it expects a 204 state when deleting the file, but it gets 404 instead. I guess that it makes sense that the file can not be found if the remote server is unreachable, but I do not know if that is just a side effect of the fix or if it is the right return code 🤷 In any case, I do not know either if there is a better way to fix this or if that fix is the proper one. Hence the help needed :-) |
cfee9a2
to
877f75f
Compare
877f75f
to
38d6ff1
Compare
38d6ff1
to
ef106f4
Compare
the tests reported as failing in the previous iteration were:
I've rebased this branch locally and ran all the new integration tests, they all passed for me. Now pushed the rebased branch, let's see if they are now all green also on CI... |
so, the tests pass for me locally even on stable22 (with a local backport) this is going to be tricky as it seems to be related to the env on which it is running |
the exception from CI:
we see this happening as soon as user0 logs in. Seeing the exception reminded me of the "availability" wrapper which buffers availability checks. Basically, if it sees that a remote was not available it stores that information for about 10 minutes. So the next checks will use the cached result for that time. And maybe depending on the environment and test order and speed, the availability caching might behave differently, which can explain why a failure can sometimes happen in different parts of the code. |
got confirmation in chat that this is fine |
Let's review and merge then! 🚀 |
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
The federated server needs to be stopped during the tests, so it is now stopped in the FederationContext for each scenario instead of just once in the run.sh script. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Technically, saying that a storage has no updates when it's not available is correct. This makes it possible to retrieve the cache entry for the mount point and also to list and remove unavailable federated shares. Signed-off-by: Vincent Petry <[email protected]>
Signed-off-by: Vincent Petry <[email protected]>
40c5f68
to
c687592
Compare
rebased to make this more up to date |
Hmmm, I've compared the behavior on master with this PR and now when a storage is not available, it is still possible to explore its folder tree. But any write operation will fail with StorageNotAvailableException. This feels like a big improvement because it makes it possible to still view the cache tree instead of feeling like being locked out. |
Signed-off-by: Vincent Petry <[email protected]> Co-authored-by: Carl Schwan <[email protected]>
The backport to stable20 failed. Please do this backport manually. |
This comment has been minimized.
This comment has been minimized.
/backport to stable22 |
Fixes #14797
To delete a file through DAV the file info of the file is first got, but if its storage is not available an exception is thrown and the deletion is aborted. If a file is a received federated share and the remote server is down the storage is not available, and therefore it is not possible to delete the file.
A received remote share can be deleted using the RemoteController, even if the remote instance is down. However, that OCS endpoint does not seem to be called from any UI element. Moreover, in order to use that endpoint the id of the remote share is needed, and in some cases it is not currently possible to list the remote shares when one of the remote instances is down (because in those cases
getFileInfo
throws an uncaught exception).I have added integration tests for the issue, but I do not know how to fix it in the storage, so I would need someone else to take over. Sorry and thanks a lot! @rullzer @icewind1991
Pending:
How to test
Expected result
The file is deleted
Actual result
The file can not be deleted