{"record":{"id":"4cf28b3ad37ac310","repo":"amir20/dozzle","slug":"cannot-self-update-stopping-dozzle-would-terminat","errorCode":null,"errorMessage":"cannot self-update: stopping Dozzle would terminate the update process","messagePattern":"cannot self-update: stopping Dozzle would terminate the update process","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/support/docker/docker_service.go","lineNumber":228,"sourceCode":"\t}\n\n\t// 4. Check if this is a swarm service\n\tserviceName := c.Labels[\"com.docker.swarm.service.name\"]\n\tif serviceName != \"\" {\n\t\tprogressCh <- container.UpdateProgress{Status: \"recreating\"}\n\t\tserviceID := c.Labels[\"com.docker.swarm.service.id\"]\n\t\tif err := d.client.ServiceUpdate(ctx, serviceID, imageName); err != nil {\n\t\t\tprogressCh <- container.UpdateProgress{Status: \"error\", Error: fmt.Sprintf(\"service update failed: %v\", err)}\n\t\t\treturn false, err\n\t\t}\n\t\tprogressCh <- container.UpdateProgress{Status: \"done\"}\n\t\treturn true, nil\n\t}\n\n\t// 5. Standalone container: check for self-update\n\tif strings.Contains(imageName, \"amir20/dozzle\") {\n\t\tprogressCh <- container.UpdateProgress{Status: \"error\", Error: \"Dozzle cannot update itself. Please restart manually.\"}\n\t\treturn false, fmt.Errorf(\"cannot self-update: stopping Dozzle would terminate the update process\")\n\t}\n\n\t// 6. Standalone container: stop -> remove -> create -> start\n\tprogressCh <- container.UpdateProgress{Status: \"recreating\"}\n\n\tcontainerName := strings.TrimPrefix(inspectResp.Name, \"/\")\n\n\t// Stop if running\n\tif c.State == \"running\" {\n\t\tif err := d.client.ContainerActions(ctx, container.Stop, c.ID); err != nil {\n\t\t\tprogressCh <- container.UpdateProgress{Status: \"error\", Error: fmt.Sprintf(\"stop failed: %v\", err)}\n\t\t\treturn false, err\n\t\t}\n\t}\n\n\t// Remove\n\tif err := d.client.ContainerRemove(ctx, c.ID); err != nil {\n\t\tprogressCh <- container.UpdateProgress{Status: \"error\", Error: fmt.Sprintf(\"remove failed: %v\", err)}","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/amir20/dozzle/blob/d9463cbe21874e44ab79db6fa63e746ca7d22928/internal/support/docker/docker_service.go#L210-L246","documentation":"`UpdateContainer` recreates a container by stopping, removing, and recreating it. If the image being updated is Dozzle itself (amir20/dozzle), stopping it would kill the process performing the update, so the operation is refused with this error and an error status is pushed to the progress channel.","triggerScenarios":"Calling the container-update API/action on a standalone (non-Swarm) Dozzle container whose image name contains 'amir20/dozzle'.","commonSituations":"Users clicking 'update' on Dozzle in the Dozzle UI; automation scripts iterating all containers and attempting self-update of the dozzle container.","solutions":["Update Dozzle via its deployment mechanism instead: pull the new image and recreate with docker compose / watchtower outside Dozzle","Run the update from the host: `docker pull amir20/dozzle:latest && docker compose up -d dozzle`","Exclude the dozzle container from automated bulk-update tooling"],"exampleFix":"// before\ncurl -X POST /api/hosts/local/containers/<dozzle_id>/actions/update\n// after\ndocker pull amir20/dozzle:latest && docker compose up -d dozzle","handlingStrategy":"validation","validationCode":"inspect=$(docker inspect --format '{{.Config.Image}}' <container_id>)\ncase \"$inspect\" in\n  *amir20/dozzle*) echo 'refusing: cannot update dozzle from within itself' >&2; exit 1;;\nesac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Exclude the dozzle container from bulk update automation","Update Dozzle via docker compose / the host, not via Dozzle's own update action"],"tags":["docker","containers","self-update"],"backgroundTag":"unsupported-operation","analyzedSha":"d9463cbe21874e44ab79db6fa63e746ca7d22928","analyzedAt":"2026-09-07T10:08:55.855Z","contentChangedAt":"2026-09-07T10:08:55.855Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}