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

Unable to warm twice #2892

Closed
mxbossard opened this issue Dec 4, 2023 · 2 comments
Closed

Unable to warm twice #2892

mxbossard opened this issue Dec 4, 2023 · 2 comments
Labels
area/caching For all bugs related to cache issues feat/warmer kind/bug Something isn't working priority/p0 Highest priority. Break user flow. We are actively looking at delivering it.

Comments

@mxbossard
Copy link
Contributor

Hi, I am using the new warmer 1.19.0.

Actual behavior
When I try to warm an image twice, the warmer exit with a failure the second time.

Expected behavior
I expect the warmer tell me the image is already in cache and do not fail.

To Reproduce
/kaniko/warmer -i alpine:latest -v trace
/kaniko/warmer -i alpine:latest -v trace

Additional Information
Logs :
DEBU[0000] /cache
DEBU[0000] [xxx/yyy/alpine:3.14.2]
INFO[0000] Retrieving image manifest xxx/yyy/alpine:3.14.2
INFO[0000] Retrieving image xxx/yyy/alpine:3.14.2 from registry xxx
INFO[0000] Found sha256:69704ef328d05a9f806b6b8502915e6a0a4faa4d72018dc42343f511490daf8a in local cache
INFO[0000] Found manifest at /cache/sha256:69704ef328d05a9f806b6b8502915e6a0a4faa4d72018dc42343f511490daf8a.json
WARN[0000] Error while trying to warm image: xxx/yyy/alpine:3.14.2

The error do not indicate the root cause.
I suspect the problem is the new way the image is not anymore stored in RAM but in a temp file.

  • The log line "Found sha256:..." indicate that the cache key was found in local cache by LocalSource func (cache.go line 196)
  • The log line "Found manifest at ..." indicate that the manifest was found in local cache by cachedImageFromPath func (cache.go line 247)
  • So AlreadyCachedErr{} should be raised in warmer.go line 163 and swallowed line 99 to stop the process cleanly. But this case is badly managed and the error AlreadyCachedErr{} is returned.

Triage Notes for the Maintainers

Description Yes/No
Please check if this a new feature you are proposing
Please check if the build works in docker but not in kaniko
Please check if this error is seen when you use --cache flag
Please check if your dockerfile is a multistage dockerfile
@aaron-prindle aaron-prindle added area/caching For all bugs related to cache issues feat/warmer priority/p0 Highest priority. Break user flow. We are actively looking at delivering it. kind/bug Something isn't working labels Dec 4, 2023
@aaron-prindle
Copy link
Collaborator

Issue related to recent PR here: #2763

mxbossard added a commit to mxbossard/kaniko that referenced this issue Dec 5, 2023
aaron-prindle pushed a commit that referenced this issue Dec 15, 2023
* Add an integration test to reproduce #2892

* Fix go compilation

* Fix docker run cmd

* Fixing entrypoint

* Test warmer with cache in a volume.

* Add missing comma

* Fix imports

* Fix dir

* Add logs

* fix

* Use test framework to log

* Fix warmer failing if image already in cache.

* Fix format.
@aaron-prindle
Copy link
Collaborator

Fixed with #2893, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/caching For all bugs related to cache issues feat/warmer kind/bug Something isn't working priority/p0 Highest priority. Break user flow. We are actively looking at delivering it.
Projects
None yet
Development

No branches or pull requests

2 participants