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

getBestRunMirror fails behind proxy #2087

Closed
AidanDelaney opened this issue Mar 4, 2024 · 0 comments · Fixed by #2088
Closed

getBestRunMirror fails behind proxy #2087

AidanDelaney opened this issue Mar 4, 2024 · 0 comments · Fixed by #2088
Labels
status/ready Issue ready to be worked on. type/bug Issue that reports an unexpected behaviour.

Comments

@AidanDelaney
Copy link
Member

Summary

Often, when running behind a proxy, there are no accessible run images.

In previous pack releases this manifests as a failure to download the run image. In pack 0.33.2 this causes a panic.

$ pack build example --builder paketobuildpacks/builder-jammy-full --pull-policy never
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/buildpacks/pack/pkg/client.getBestRunMirror({0x101175cf0, 0xf}, {0x140004c5300, 0x36}, {0x101e6f1e0, 0x0, 0x102571460?}, {0x0?, 0x50?, 0x140001e6000?}, ...)
	github.com/buildpacks/pack/pkg/client/common.go:123 +0x2c0
github.com/buildpacks/pack/pkg/client.(*Client).resolveRunImage(0x140001fee70, {0x0?, 0x140004beb40?}, {0x101175cf0?, 0x1014e6700?}, {0x101175cf0?, 0x0?}, {{0x140004c5300, 0x36}, {0x101e6f1e0, ...}}, ...)
	github.com/buildpacks/pack/pkg/client/common.go:42 +0xb8
github.com/buildpacks/pack/pkg/client.(*Client).Build(_, {_, _}, {{0x0, 0x0}, {0x16f763783, 0x7}, {0x16f763795, 0x23}, {0x0, ...}, ...})
	github.com/buildpacks/pack/pkg/client/build.go:343 +0x604
github.com/buildpacks/pack/internal/commands.Build.func1(0x14000153200, {0x1400012c640?, 0x0?, 0x0?})
	github.com/buildpacks/pack/internal/commands/build.go:157 +0xd00
github.com/buildpacks/pack/internal/commands.Build.logError.func3(0x14000492700?, {0x1400012c640?, 0x4?, 0x1011685f1?})
	github.com/buildpacks/pack/internal/commands/commands.go:58 +0x48
github.com/spf13/cobra.(*Command).execute(0x14000153200, {0x1400012c5f0, 0x5, 0x5})
	github.com/spf13/cobra@v1.8.0/command.go:983 +0x840
github.com/spf13/cobra.(*Command).ExecuteC(0x14000152f00)
	github.com/spf13/cobra@v1.8.0/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/cobra@v1.8.0/command.go:1039
github.com/spf13/cobra.(*Command).ExecuteContext(0x101617c78?, {0x10160fbe8?, 0x1400012c000?})
	github.com/spf13/cobra@v1.8.0/command.go:1032 +0x48
main.main()
	github.com/buildpacks/pack/cmd/pack/main.go:26 +0xd8

Reproduction

Steps
  1. Run pack on a system with no Internet access
  2. pack build example --builder paketobuildpacks/builder-jammy-full --pull-policy never
  3. Note the above panic
Current behavior

It panics

Expected behavior

I would expect the previous behaviour where pack fails to access the run image


Environment

pack info
pack report
Pack:
  Version:  0.33.2+git-f2cffc4.build-5562
  OS/Arch:  darwin/arm64

Default Lifecycle Version:  0.18.5

Supported Platform APIs:  0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.10, 0.11, 0.12
Config:
  experimental: true
docker info

Not necessary here

@AidanDelaney AidanDelaney added status/triage Issue or PR that requires contributor attention. type/bug Issue that reports an unexpected behaviour. labels Mar 4, 2024
@jjbustamante jjbustamante added status/ready Issue ready to be worked on. and removed status/triage Issue or PR that requires contributor attention. labels Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/ready Issue ready to be worked on. type/bug Issue that reports an unexpected behaviour.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants