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

Panic creating kubebuilder-envtest cache directory #1845

Closed
hanlins opened this issue Mar 24, 2022 · 2 comments
Closed

Panic creating kubebuilder-envtest cache directory #1845

hanlins opened this issue Mar 24, 2022 · 2 comments

Comments

@hanlins
Copy link
Member

hanlins commented Mar 24, 2022

Encountered following error:

$ kubectl -n infra logs -f eks-provider-db6d54fd5-gzx7t
panic: mkdir /.cache: permission denied

goroutine 1 [running]:
sigs.k8s.io/controller-runtime/pkg/internal/testing/addr.init.0()
	/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/testing/addr/manager.go:51 +0xda

controller-runtime version: v0.9.6
golang version: go1.17.7

The issue is related to the init function that sets up kubebuilder-envtest caching directory, see code.

The UserCacheDir is supposed to return the cache directory location. In the pod setup, HOME is set to / and XDG_CACHE_HOME is not set so UserCacheDir ends up returning //.cache without emitting error. However, the process doesn't have permission to create directory under that location and thus it paniced.

One walkaround is to manually set XDG_CACHE_HOME to /tmp in deployment spec. It would be great if we have logic that fall back to using /tmp on permission issues.

@skitt
Copy link
Member

skitt commented Apr 5, 2022

This is a duplicate of #1799.

@hanlins hanlins closed this as completed Apr 23, 2022
@georgettica
Copy link

I had this issue and was thinking it was something else. thank you for creating the duplicate! I didn't find it with my google-foo skills.

I will mention on the duplicate issue that note

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 a pull request may close this issue.

3 participants