You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
update-module: KeyError crash in 95cleanup_images when PREV_IMAGE_URL is unset #8180
Install a module from a floating tag, for example add-module ghcr.io/danb35/automx:latest
Without ever updating that module instance, run update-module ghcr.io/danb35/automx:latest automx1, using the same image URL that is already installed and without the --force option
Expected behavior
The update is skipped with the warning "The module URL ... is already installed", and the task completes successfully.
Actual behavior
The module update-module task aborts at step 95cleanup_images with KeyError: 'PREV_IMAGE_URL'. As a result, the cluster update-module task reports the instance as failed.
Journal excerpt (module id automx1):
task/module/automx1/f3ca9040-b007-4b63-89c2-31944811759d: update-module/95cleanup_images is starting
Removing None (differs from ghcr.io/danb35/automx:latest)
Traceback (most recent call last):
File "/usr/local/agent/actions/update-module/95cleanup_images", line 32, in <module>
agent.run_helper('podman', 'image', 'rm', os.environ[image_old])
~~~~~~~~~~^^^^^^^^^^^
KeyError: 'PREV_IMAGE_URL'
task/module/automx1/f3ca9040-b007-4b63-89c2-31944811759d: action "update-module" status is "aborted" (1) at step 95cleanup_images
Components
NS8 core, update-module action. Found with the module ghcr.io/danb35/automx, but any module can be affected.
See also
Found while updating the ghcr.io/danb35/automx module on a real node.
Thanks for the detailed report. The reproduction steps were missing one condition: the crash happens only when the requested image URL is the same one already installed, and --force isn't used.
Steps to reproduce
Install a module from a floating tag, e.g. add-module ghcr.io/danb35/automx:latest
Without ever updating that instance, run update-module ghcr.io/danb35/automx:latest automx1 (without --force)
Expected: the update is skipped with the "already installed" warning and the task succeeds.
Actual:update-module/95cleanup_images aborts with KeyError: 'PREV_IMAGE_URL', and the cluster update-module task fails.
@danb35 may I edit the issue description to include these corrected steps?
Activity
DavidePrincipi commentedon Oct 6, 2026
Thanks for the detailed report. The reproduction steps were missing one condition: the crash happens only when the requested image URL is the same one already installed, and
--forceisn't used.Steps to reproduce
add-module ghcr.io/danb35/automx:latestupdate-module ghcr.io/danb35/automx:latest automx1(without--force)Expected: the update is skipped with the "already installed" warning and the task succeeds.
Actual:
update-module/95cleanup_imagesaborts withKeyError: 'PREV_IMAGE_URL', and the clusterupdate-moduletask fails.@danb35 may I edit the issue description to include these corrected steps?
danb35 commentedon Oct 6, 2026
No objection from me.
DavidePrincipi commentedon Oct 8, 2026
In Testing core 3.23.1-dev.1
Test case 1
Test the bug is not reproducible:
update-core ghcr.io/nethserver/core:3.23.1-dev.1add-module ghcr.io/nethserver/dokuwiki:latest 1update-module ghcr.io/nethserver/dokuwiki:latest dokuwiki1The task completes successfully with the "already installed" warning.
Update a module to a stable version and check that the previous image is still removed.
@danb35 would you mind testing it?
DavidePrincipi commentedon Oct 12, 2026
VERIFIED
DavidePrincipi commentedon Oct 15, 2026
Released https://github.com/NethServer/ns8-core/releases/tag/3.23.1