-
-
Notifications
You must be signed in to change notification settings - Fork 241
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
Invalidate the repo cache when hitting 404s #1373
Comments
The Incus daemon caches simplestreams data for up to an hour. So Can you confirm that you are past that 1h cache expiry in your case? |
Ah ! Thank you ! Yes, indeed, you're right. I was clearing the client cache hoping it would help… but could not find the server cache. IMHO, when hitting 404s, the cache should be invalidated. |
We discussed this internally and we agreed that it does make sense, that if we try to download an image file and we get a 404 back, we should invalidate the cache for that server. |
Given a vanilla incus setup and a local web server (e.g. Setup: # Add the remote
incus remote add myremote https://localhost --protocol simplestreams --accept-certificate
# Download and export 2 images
incus image copy images:alpine/edge local: --copy-aliases
incus image copy images:busybox/1.36.1 local: --copy-aliases
incus image export alpine/edge ./alpine-edge.img
incus image export busybox/1.36.1 ./busybox-1.36.1.img Reproducer: rm -rf images/ streams/
rm -rf ~/.cache/incus/*
sudo bash -c "rm -rf /var/cache/incus/*"
incus-simplestreams add ./alpine-edge.img ./alpine-edge.img.root
incus-simplestreams add ./busybox-1.36.1.img ./busybox-1.36.1.img.root
incus image delete alpinelinux/edge/default
incus image delete busybox/1.36.1/default
incus image copy myremote:alpinelinux/edge/default local: --copy-aliases --auto-update
incus-simplestreams remove e9
incus image copy myremote:busybox/1.36.1/default local: --copy-aliases --auto-update
sudo bash -c "find /var/cache/incus/"
sudo bash -c "jq '.products | keys' /var/cache/incus/7939af4c0f1ebe4049e933a07a667d0f58c0529cad7478808e6fabaec343492b/images.json" Without the fix from #1424 , the expected output is, that still both images from remote are present in the cache. With the fix, |
tl;dr :
but :
It looks like the incus daemon caches the index of the repository but doesn't know when to refresh it. When reading the logs of the nginx server serving the simplestreams repository, i can see the requests for the image, but not for the
images.json
index.You can see the sha1 mismatch (500dedd061a0 when listing, 1b46a0dfacf7eedb0bfef3f9a3877b54ed9185c8960de67e1b53d2e0e8d52f91 when fetching)
(I'm going to sleep, hence the very short issue, but feel free to request more info, i'll reply tomorrow :D )
The text was updated successfully, but these errors were encountered: