openwrt / openwrt/asu

build.py: podman imagebuilder out of sync

Open
#853 33 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
450
Forks
111
PR merge metrics
No merged PRs in 30d

Description

cc: @lorand-horvath

ASU build has been generating these errors on x86/64 snapshot for a day or so, several similar errors being reported on the forum.

Received incorrect version r26608-b2a84c86e3 (requested r26620-6b03050192)

Since the "janitor: drop" commit the metadata updates rapidly, and both
https://sysupgrade.openwrt.org/json/v1/snapshots/targets/x86/64/generic.json
and
https://downloads.openwrt.org/snapshots/targets/x86/64/profiles.json
contain the correct 26620 version_code, so it seems that the previous source of this issue has been resolved.

This time it appears to me to be the podman image is out of sync, behind the current downloads imagebuilder. I couldn't find anything in update.py that would invalidate or update the podman.images collection.

But in build.py we know something is wrong. Just a wild, untested idea, when this specific error is detected, maybe just delete the podman image, so the next try does a fresh podman.images.pull? (At least I'm assuming that's how pull works.) In build.py:

    log.info(f"Pulling {image}...")
    pm_image = podman.images.pull(image)        <<< Save the returned image...
    log.info(f"Pulling {image}... done")

...

    if "version_code" in req:
        if version_code != req.get("version_code"):
            pm_image.remove(force=True)          <<< Remove it before reporting error, or maybe 'reload'???
            report_error(

Refs:
https://podman-py.readthedocs.io/en/stable/podman.domain.images_manager.html#podman.domain.images_manager.ImagesManager.pull
https://podman-py.readthedocs.io/en/stable/podman.domain.images.html#podman.domain.images.Image.remove

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with build.py around the podman.images.pull call and the version_code mismatch check, then inspect update.py for image invalidation or refresh behavior. Verify the podman-py pull and Image.remove behavior against the reported x86/64 snapshot mismatch. Done means the imagebuilder no longer uses a stale image when the requested version differs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.