Skip to content

fix: [OCISDEV-1714] keep the connection error of a metadata download - #822

Merged
2403905 merged 1 commit into
mainfrom
fix/OCISDEV-1714
Nov 20, 2026
Merged

2403905 merged 1 commit into
mainfrom
fix/OCISDEV-1714

Conversation

@2403905

@2403905 2403905 commented Nov 19, 2026

Copy link
Copy Markdown

Description

This PR is the main version of #820 (stable-8.0).

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. For a missing file, the GET request that comes next gets HTTP 404, and that gives NotFound.

A caller that gets NotFound continues as if the file does not exist:

  • ocis settings: ListRoleAssignments skips the assignment and returns an empty role list. The proxy then assigns the default role "User". An Admin becomes a User without an error.
  • jsoncs3: providercache, sharecache and receivedsharecache reset the cache to empty.

Changes

  • Return the error of InitiateFileDownload without a change.
  • Change a non-OK status of InitiateFileDownload to the matching typed error (errtypes.NewErrtypeFromStatus).
  • Add tests in pkg/storage/utils/metadata/cs3_download_test.go with a fake storage provider.

The cherry-pick from stable-8.0 had 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

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]>
@2403905
2403905 requested a review from a team as a code owner November 19, 2026 15:14
@kw-security

kw-security commented Nov 19, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 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]>
@2403905
2403905 merged commit c9ce52c into main Nov 20, 2026
14 checks passed
@2403905
2403905 deleted the fix/OCISDEV-1714 branch November 20, 2026 13:58
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants