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

Application crashes with panic when lacking permissions for repository in OCI registry #7

Closed
shurshun opened this issue Jul 17, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@shurshun
Copy link
Contributor

The application experiences a panic and crashes when it doesn't have the necessary permissions to access a repository in the OCI registry.
However, the login to the registry occurs without any issues, as the role being used has the "ecr:GetAuthorizationToken" permission.

# hpkl login -l AWS -p $(aws ecr get-login-password) 123456789123.dkr.ecr.eu-central-1.amazonaws.com
# hpkl resolve
2024-07-17T16:55:50.759Z	info	Resolving	{"name": "core.oci", "as": {"uri":"package://123456789123.dkr.ecr.eu-central-1.amazonaws.com/pkl/test-core@1.0.3","checksums":null,"name":"core.oci","project_file_uri":""}, "proto": "oci"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x68 pc=0x24d19c1]

goroutine 1 [running]:
hpkl.io/hpkl/pkg/app.(*Resolver).Resolve(0xc0009daae0, 0xc0009db0e0)
	/home/runner/work/hpkl/hpkl/pkg/app/resolver.go:131 +0x481
hpkl.io/hpkl/cmd.Resolve(0xc00092f300)
	/home/runner/work/hpkl/hpkl/cmd/resolve.go:94 +0x65
hpkl.io/hpkl/cmd.NewResolveCmd.func1(0xc000759600?, {0x4e08100?, 0x4?, 0x2d03876?})
	/home/runner/work/hpkl/hpkl/cmd/resolve.go:35 +0x3d
github.com/spf13/cobra.(*Command).execute(0xc00074bb08, {0x4e08100, 0x0, 0x0})
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:983 +0xaca
github.com/spf13/cobra.(*Command).ExecuteC(0x4d81a40)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039
hpkl.io/hpkl/cmd.Execute()
	/home/runner/work/hpkl/hpkl/cmd/root.go:34 +0x1a
main.main()
	/home/runner/work/hpkl/hpkl/main.go:9 +0xf
@germanosin germanosin self-assigned this Jul 26, 2024
@germanosin germanosin added the bug Something isn't working label Jul 26, 2024
germanosin added a commit that referenced this issue Jul 26, 2024
* fixed remote cycled dependencies

* fixed issue #7 and added password from stdin

---------

Co-authored-by: German Osin <germanosin@MacBookAlma.local>
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