Skip to content

If a file download fails with 503, don't abort the whole sync #5088

Closed

Description

@guruz

The failing file will fail with 503 Service Unavailable, the 2 other concurrently syncing files will get Operation Cancelled.

We could actually continue to sync the other 2 files.

HOWEVER what would this mean if all other files (more than the 3 currently syncing) lead to a 503? We'd probably not want to get an endless 503 sync..

Activity

  1. added this to the 2.3.0 milestone on Jul 28, 2016
  2. dragotin commented on Jul 28, 2016

    @dragotin
    Contributor

    Where does the 503 come from?

    The definition of 503 is: If the 503 is returned to a PROPFIND on root, it means that the server is in maintenance, and the whole sync goes offline.

    If the 503 is returned on any operation on an individual file or (more imnportant) folder, it means that the folder is not available current, and is IGNORED. That behavior is important for external storages that can go away because of their own problems. The server will return 503 for them in that case, to avoid the client remove all their contents in the dir.

  3. guruz commented on Jul 28, 2016

    @guruz
    ContributorAuthor

    @dragotin See bug subject, file download :-)

  4. removed this from the 2.3.0 milestone on Aug 24, 2016
  5. guruz commented on Sep 26, 2016

    @guruz
    ContributorAuthor

    Related #5187

  6. moscicki commented on Nov 14, 2018

    @moscicki
    Contributor

    Yes, we also see this and it affects our production services. One GET 503 will block the entire synchronization for all unrelated files as well.

  7. guruz commented on Nov 16, 2018

    @guruz
    ContributorAuthor

    @moscicki (semi-related) How long are your files usually 503?

  8. added this to the 2.6.0 milestone on Nov 16, 2018
  9. ckamm commented on Nov 21, 2018

    @ckamm
    Contributor

    Mmh, looks like the client needs more careful backoff then. The other ask for 503s was "please give the server some breathing room when you see it" (for the overload or maintenance case). I guess we could keep going after the first and only abort when a certain number of errors have accumulated.

    @moscicki If I understand you correctly you're using 503s on a resource level and they can be persistent? Is this related to the overloading with "503 storage unavailable"?

  10. guruz commented on Nov 21, 2018

    @guruz
    ContributorAuthor

    I guess we could keep going after the first and only abort when a certain number of errors have accumulated.

    But what's the number?
    Indeed maybe it would be better for @moscicki to mark the whole directory as "503 storage unavailable" as this won't abort the sync?

  11. moscicki commented on Nov 21, 2018

    @moscicki
    Contributor
  12. guruz commented on Nov 22, 2018

    @guruz
    ContributorAuthor

    @butonic @DeepDiver1975 @PVince81 @ogoffart Didn't we somewhere say we could support sending a Retry-After header (optional) on 503 GET in case we think the file will come back up soon and should not abort the whole sync?

  13. 20 remaining items

  14. HanaGemela commented on Aug 6, 2019

    @HanaGemela
    Contributor

    @ckamm Great, now I see the error message only once.

    Still some issues here:

    1. Sometimes the error is e:http:response_header as already described above
    2. When syncing a folder that is unavailable, the rest of the files are not synced
    3. When the folder becomes available, the client doesn't recover - folder is still shown as unavailable. I believe this is a server issue though
  15. removed
    ReadyToTest
    on Aug 6, 2019
  16. ckamm commented on Aug 7, 2019

    @ckamm
    Contributor

    @HanaGemela

    1. "Undefined variable: http_response_header" is an error message the server sends. I don't know why it's intermittent.
    2. A 503 during discovery should mean "ignore that folder" and the sync should continue with other files. A 503 during propagation is normally a normal error where other files will be synced after. The exception is if the 503 reply contains ">Sabre\DAV\Exception\ServiceUnavailable<" because then we assume maintenance mode has been switched on and abort the sync.
  17. HanaGemela commented on Aug 7, 2019

    @HanaGemela
    Contributor

    @ckamm then it's broken, the sync should continue but it doesn't

  18. ckamm commented on Aug 7, 2019

    @ckamm
    Contributor

    @HanaGemela How do you set up the 503 reply for your tests? I need it to reproduce your specific case.

  19. HanaGemela commented on Aug 7, 2019

    @HanaGemela
    Contributor

    @ckamm Start two servers:

    docker run -e OWNCLOUD_SHARING_FEDERATION_ALLOW_HTTP_FALLBACK=true -p 8080:8080 owncloud/server
    docker run -e OWNCLOUD_SHARING_FEDERATION_ALLOW_HTTP_FALLBACK=true -p 8081:8080 owncloud/server

    Then:

    1. User1 shares a folder with User2 from another server (federated share)
    2. Turn off the first server 
    3. Check the account of User2
  20. ckamm commented on Aug 12, 2019

    @ckamm
    Contributor

    Thanks, that helped. An unavilable federated share gets reported as:

    <?xml version="1.0" encoding="utf-8"?>
    <d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
      <s:exception>Sabre\DAV\Exception\ServiceUnavailable</s:exception>
      <s:message>Storage is temporarily not available</s:message>
    </d:error>
    

    but the error handling code assumes this ServiceUnavailable means maintenance mode and considers it a fatal error.

  21. ckamm commented on Aug 12, 2019

    @ckamm
    Contributor

    @HanaGemela I've added a PR for an unreliable workaround in 2.6.0 - a reliable fix will need to be deferred to 2.6.1. (it currently relies on the s:message string, which is a user-facing translatable string; a correct solution would trigger a follow-up request to status.php to check for maintenance mode)

  22. added
    ReadyToTest
    and removed on Aug 22, 2019
  23. HanaGemela commented on Sep 6, 2019

    @HanaGemela
    Contributor

    Works as expected on 2.6.0rc1 (build 12411), mac 10.14.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

DiscussionReadyToTesttype:bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions