Skip to content

Original exception is swallowed when attach command's user has not correct permissions #1695

Closed

Description

@bedla

What happened in your environment?

Hi,
I have following command and when user I am using does not have correct permissions at Harbor, it returns 401.
Unfortunatelly I was only able to get this information during debugging session, not from console output.
Thank you
Ivos

Image

Code: 401
Message: unauthorized to access repository: personal-ivo_smid/gitlab-commithook-settings, action: push: unauthorized to access repository: personal-ivo_smid/gitlab-commithook-settings, action: push

and console output

What did you expect to happen?

No response

How can we reproduce it?

command to run (I assume that not all flags are necessary)

oras
attach
--artifact-type
application/vnd.cz.xxx.license-analyze-result.v1
--annotation-file
c:\Users\IVOMD~1\AppData\Local\Temp\oci-attacher18183237746840218121\annotations.json
--format
json
--disable-path-validation=true
harbor-aws.internal.xxx.tech/personal-ivo_smid/gitlab-commithook-settings:1.0-SNAPSHOT
c:\Users\IVOMD~1\AppData\Local\Temp\oci-attacher18183237746840218121\out-licence.json:application/json

console output is
Note: Once it happened, that I was able to get error message not panic.

panic: sync/atomic: compare and swap of inconsistently typed value into Value

goroutine 68 [running]:
sync/atomic.(*Value).CompareAndSwap(0xc000430150, {0x0, 0x0}, {0x1271e60, 0xc0004b43f0})
	C:/Users/IvoŠmíd/go/pkg/mod/golang.org/[email protected]/src/sync/atomic/value.go:174 +0x30a
oras.land/oras-go/v2/internal/syncutil.Go[...].func1.1()
	C:/Users/IvoŠmíd/go/pkg/mod/oras.land/oras-go/[email protected]/internal/syncutil/limit.go:86 +0x1ce
golang.org/x/sync/errgroup.(*Group).Go.func1()
	C:/Users/IvoŠmíd/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:79 +0xa9
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 38
	C:/Users/IvoŠmíd/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:76 +0xe8

Image

What is the version of your ORAS CLI?

$ docker run ghcr.io/oras-project/oras:main version
Version:        1.3.0-beta.2+unreleased
Go version:     go1.24.0
OS/Arch:        linux/amd64
Git commit:     6f04cf05b29fa8eb7dd0cc0b636d45fa716911d1
Git tree state: clean

What is your OS environment?

Docker

Are you willing to submit PRs to fix it?

  • Yes, I am willing to fix it.

Activity

  1. added
    bug
    triage
    on Apr 16, 2025
  2. bedla commented on Apr 18, 2025

    @bedla
    Author

    I found out that it is fixed in oras-project/oras-go#921
    Related issues are oras-project/oras-go#916 and oras-project/oras-go#908

    I assume that when latest oras-go will fix this.

  3. Wwwsylvia commented on Apr 23, 2025

    @Wwwsylvia
    Member

    @bedla Thanks for opening the issue. Yes, this has been fixed in oras-go, and we will update oras soon to include the fix. The fix is planned to be out with the next release v1.3.0-beta.3.

  4. added
    duplicate
    on Apr 23, 2025
  5. Wwwsylvia commented on Apr 23, 2025

    @Wwwsylvia
    Member

    Duplicate of #1659

  6. removed
    triage
    on Apr 23, 2025
  7. added this to the v1.3.0-Beta.3 milestone on Apr 23, 2025
  8. FeynmanZhou commented on Apr 23, 2025

    @FeynmanZhou
    Member

    @Wwwsylvia We could remove the triage label if the issue has been responded with clear plan.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugduplicate

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions