Skip to content

collaboration: GetFile fails with 500 right after a PutFile while the file is in postprocessing #4106

In review

Description

@pbleser-oc

With asynchronous uploads enabled, a WOPI GetFile that comes in shortly after a PutFile can fail with HTTP 500. The new file version is still in postprocessing, so the download from the data gateway answers 425 Too Early, and GetFile in the collaboration service turns every download status other than 200 into a 500.

This makes the WOPI validator test EditFlows/BasicEdit fail now and then in the CI (step wopiValidatorTests-EditFlows of test-wopi-validator-builtin-posix), e.g. in https://ci.opencloud.rocks/repos/3/pipeline/5700:

GetFile, response code: 500 InternalServerError
  Response body does not match expected content. Expected stream length: 74, actual stream length: 22

The collaboration service logs:

"message":"GetFile: downloading the file failed", "HttpCode":425

Users can hit the same when an office app opens or reloads a document right after someone else saved it.

Proposed fix: when the download answers 425, retry it a few times with a short, bounded backoff before giving up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions