Skip to content

Fix container recreation by computing default labels from post-applied values#2414

Open
Marketen wants to merge 1 commit intodevelopfrom
marc/compute-defaults
Open

Fix container recreation by computing default labels from post-applied values#2414
Marketen wants to merge 1 commit intodevelopfrom
marc/compute-defaults

Conversation

@Marketen
Copy link
Contributor

@Marketen Marketen commented Mar 10, 2026

Problem:
Staker packages (consensus, execution, etc.) were unexpectedly restarted after installation. The ensureDockerNetworkConfigs daemon runs every 30 minutes and calls docker compose up on staker packages. On the first run after install, Docker Compose detected label changes and recreated the containers.

Root cause:
applyUserSettings() computed dappnode.dnp.default.* labels from the pre-applied service values (raw manifest env vars, un-normalized ports). But the compose file was written with post-applied values (populated env vars, TCP-normalized ports). When the daemon re-ran and recomputed labels from the now-modified compose, the label values changed — triggering Docker Compose to see a config diff and recreate containers.

Fix:
Compute default labels from the already-resolved output values (nextEnvironment, nextPorts, nextServiceVolumes) instead of the raw input. This makes labels match the compose content from the start, so the daemon recomputing them produces the same result — no diff, no restart.

@Marketen Marketen requested a review from a team as a code owner March 10, 2026 15:44
@github-actions github-actions bot temporarily deployed to commit March 10, 2026 15:44 Inactive
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 this pull request may close these issues.

1 participant