Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while using file as artifact with rekor-cli upload. #2138

Open
rajeev-0 opened this issue Jun 4, 2024 · 4 comments
Open

Error while using file as artifact with rekor-cli upload. #2138

rajeev-0 opened this issue Jun 4, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@rajeev-0
Copy link

rajeev-0 commented Jun 4, 2024

Description
I want to use rekor-cli version 1.3.6 for uploading artifact and signature using below command.
$ rekor-cli upload --artifact payload.json --signature payload.json.sig --public-key pubkey.pem --pki-format x509
But I am getting invalid argument error.
invalid argument "payload.json" for "--artifact" flag: URL must be for http or https scheme.

In help section it states it could be a file.
--artifact fileOrURL path or URL to artifact file

Version
rekor-cli: Rekor CLI

GitVersion: v1.3.6
GitCommit: a678856
GitTreeState: clean
BuildDate: 2024-04-02T04:16:36Z
GoVersion: go1.21.8
Compiler: gc
Platform: linux/amd64

@rajeev-0 rajeev-0 added the bug Something isn't working label Jun 4, 2024
@bobcallaway
Copy link
Member

bobcallaway commented Jun 4, 2024

Can you try prepending ./ to payload.json as a workaround?

@bobcallaway
Copy link
Member

also, that error message is (incorrectly) printed if the argument to --artifact doesn't exist, so can you please also verify the filename?

@rajeev-0
Copy link
Author

rajeev-0 commented Jun 5, 2024

prepending ./ also doesn't work, Just got added to error message.
$ rekor-cli upload --artifact ./payload.json --signature payload.json.sig --public-key pubkey.pem --pki-format x509
Error: invalid argument "./payload.json" for "--artifact" flag: './payload.json' is not a valid url

And I also confirmed that file payload.json exists.
$ cat payload.json
{"critical":{"identity":{"docker-reference":"cr.example.com/ranjan.rajeev/test-container/hello-world"},"image":{"docker-manifest-digest":"sha256:8d3b740ac4f8c8d84d71b67e18127cd380d6e224956f2daa5d99f28a9fad155a"},"type":"cosign container image signature"},"optional":null}

@bobcallaway
Copy link
Member

prepending ./ also doesn't work, Just got added to error message. $ rekor-cli upload --artifact ./payload.json --signature payload.json.sig --public-key pubkey.pem --pki-format x509 Error: invalid argument "./payload.json" for "--artifact" flag: './payload.json' is not a valid url

And I also confirmed that file payload.json exists. $ cat payload.json {"critical":{"identity":{"docker-reference":"cr.example.com/ranjan.rajeev/test-container/hello-world"},"image":{"docker-manifest-digest":"sha256:8d3b740ac4f8c8d84d71b67e18127cd380d6e224956f2daa5d99f28a9fad155a"},"type":"cosign container image signature"},"optional":null}

I'm only able to recreate this error if the file doesn't exist in the current working directory. Can you confirm that is the case for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants