Repository navigation
fix: [OCISDEV-1714] keep the connection error of a metadata download - #822
Merged
Merged
Conversation
The function Download in pkg/storage/utils/metadata/cs3.go changed each error of InitiateFileDownload to errtypes.NotFound. InitiateFileDownload does not read the file. It only returns the download URL. So an error from this call is a connection error, for example Unavailable from a dead replica. A caller that gets NotFound continues as if the file does not exist: - The settings service skips the role assignment and returns an empty role list. The proxy then assigns the default role "User" and so removes the old role, for example Admin. - The jsoncs3 share manager resets a share cache to empty. Changes: - Return the error of InitiateFileDownload without a change. - Change a non-OK status of InitiateFileDownload to the matching typed error. - Add tests in pkg/storage/utils/metadata/cs3_download_test.go with a fake storage provider. For a missing file, the GET request gets HTTP 404, and that still gives NotFound. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
2403905
added a commit
to owncloud/ocis
that referenced
this pull request
Nov 19, 2026
…error Bump github.com/owncloud/reva/v2 to the commit of owncloud/reva#822. The new reva returns the connection error of a metadata download and no longer changes it to NotFound. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
1 task done
jvillafanez
approved these changes
Nov 20, 2026
2403905
added a commit
to owncloud/ocis
that referenced
this pull request
Nov 20, 2026
…error Bump github.com/owncloud/reva/v2 to the commit of owncloud/reva#822. The new reva returns the connection error of a metadata download and no longer changes it to NotFound. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2403905
added a commit
to owncloud/ocis
that referenced
this pull request
Nov 20, 2026
…error Bump github.com/owncloud/reva/v2 to c9ce52c985fc. This commit is the merge of owncloud/reva#822. The new reva returns the connection error of a metadata download and no longer changes it to NotFound. Signed-off-by: Roman Perekhod <[email protected]>
2403905
added a commit
to owncloud/ocis
that referenced
this pull request
Nov 20, 2026
…error Bump github.com/owncloud/reva/v2 to c9ce52c985fc. This commit is the merge of owncloud/reva#822. The new reva returns the connection error of a metadata download and no longer changes it to NotFound. Signed-off-by: Roman Perekhod <[email protected]>
2403905
added a commit
to owncloud/ocis
that referenced
this pull request
Nov 20, 2026
… it (#13535) * fix: [OCISDEV-1714] keep the role of a user when settings cannot read it The settings service could remove the role of a user without an error. An empty role list makes the proxy assign the default role "User". WriteRoleAssignment deletes the old assignments first, so an Admin becomes a User. Changes: - AssignRoleToUser in services/settings/pkg/service/v0/service.go fails closed. When ListRoleAssignments returns an error, the self-assignment returns an error and does not write. - CachedMDC.SimpleDownload in services/settings/pkg/store/metadata/cache.go drops the cached listing of a folder when a file in it is gone. Another pod can change the folder, and that pod does not clear the caches of this pod. - ListRoleAssignments in services/settings/pkg/store/metadata/assignments.go reads the account folder again after a stale listing. - ListRoleAssignmentsByRole skips an account folder that is gone. Before, it returned an empty list for all accounts. reva PR #820 fixes the cause in the metadata storage: each connection error of a download became NotFound. A reva bump follows after that PR is merged. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Roman Perekhod <[email protected]> * chore: [OCISDEV-1714] bump reva to the fix for the metadata download error Bump github.com/owncloud/reva/v2 to c9ce52c985fc. This commit is the merge of owncloud/reva#822. The new reva returns the connection error of a metadata download and no longer changes it to NotFound. Signed-off-by: Roman Perekhod <[email protected]> --------- Signed-off-by: Roman Perekhod <[email protected]> Co-authored-by: Claude Sonnet 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR is the
mainversion of #820 (stable-8.0).The function
Downloadinpkg/storage/utils/metadata/cs3.gochanged each error ofInitiateFileDownloadtoerrtypes.NotFound.InitiateFileDownloaddoes not read the file. It only returns the download URL. So an error from this call is a connection error, for exampleUnavailablefrom a dead replica. For a missing file, the GET request that comes next gets HTTP 404, and that givesNotFound.A caller that gets
NotFoundcontinues as if the file does not exist:ListRoleAssignmentsskips the assignment and returns an empty role list. The proxy then assigns the default role "User". An Admin becomes a User without an error.providercache,sharecacheandreceivedsharecachereset the cache to empty.Changes
InitiateFileDownloadwithout a change.InitiateFileDownloadto the matching typed error (errtypes.NewErrtypeFromStatus).pkg/storage/utils/metadata/cs3_download_test.gowith a fake storage provider.The cherry-pick from
stable-8.0had no conflict.Related issue
How has this been tested?
go test ./pkg/storage/utils/metadata/... ./pkg/share/manager/jsoncs3/...passes on this branch.🤖 Generated with Claude Code