{"record":{"id":"03498ef305661c6f","repo":"amir20/dozzle","slug":"update-failed-w","errorCode":null,"errorMessage":"update failed: %w","messagePattern":"update failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cloud/tools_actions.go","lineNumber":83,"sourceCode":"\n\tcs, err := deps.HostService.FindContainer(hostID, containerID, deps.Labels)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"container not found: %w\", err)\n\t}\n\n\tprogressCh := make(chan container.UpdateProgress)\n\tvar updated bool\n\tvar updateErr error\n\tdone := make(chan struct{})\n\tgo func() {\n\t\tupdated, updateErr = cs.Update(ctx, progressCh)\n\t\tclose(done)\n\t}()\n\tfor range progressCh {\n\t}\n\t<-done\n\tif updateErr != nil {\n\t\treturn nil, fmt.Errorf(\"update failed: %w\", updateErr)\n\t}\n\n\tmessage := fmt.Sprintf(\"Successfully updated container %s by pulling the latest image and recreating it.\", cs.Container.Name)\n\tif !updated {\n\t\tmessage = fmt.Sprintf(\"Container %s is already running the latest image. No update was needed.\", cs.Container.Name)\n\t}\n\n\treturn &pb.CallToolResponse{\n\t\tSuccess: true,\n\t\tResult: &pb.CallToolResponse_Action{Action: &pb.ActionResult{\n\t\t\tSuccess:     true,\n\t\t\tContainerId: cs.Container.ID,\n\t\t\tAction:      \"update\",\n\t\t\tMessage:     message,\n\t\t}},\n\t}, nil\n}\n","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/amir20/dozzle/blob/d9463cbe21874e44ab79db6fa63e746ca7d22928/internal/cloud/tools_actions.go#L65-L101","documentation":"executeUpdateContainer runs the update (pull latest image + recreate) asynchronously and drains a progress channel; when the update goroutine reports an error it is wrapped as \"update failed\". This means argument parsing and container lookup succeeded, but the actual Docker update operation errored.","triggerScenarios":"Image pull failure (registry unreachable, auth required), container cannot be stopped/recreated (dependency, volume, or network conflicts), Docker daemon errors during recreate, or the update implementation rejects the operation.","commonSituations":"Private registry without credentials on the host; no network access to the registry from the Docker host; container managed by compose/swarm fighting the manual recreate; port already bound by another container after recreation.","solutions":["Inspect the wrapped error (%w) for the root cause (pull vs stop vs recreate) and address it directly.","Verify registry access: `docker pull <image>` on the host; add registry credentials if authentication is the cause.","Ensure no external orchestrator (compose restart policy, swarm service) will recreate/conflict with the container during update."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-checks: registry reachable and image pullable\nconst pull = await runOnHost(host, `docker pull ${image}`);\nif (pull.code !== 0) throw new Error(\"image pull would fail: \" + pull.stderr);","typeGuard":null,"tryCatchPattern":"try {\n  return await callTool(\"update_container\", argsJSON);\n} catch (e) {\n  if (String(e).includes(\"update failed\")) {\n    // inspect wrapped cause: pull vs stop vs recreate; fix root cause, do not blind-retry\n  }\n  throw e;\n}","preventionTips":["Verify registry credentials exist on the Docker host before updating private images.","Ensure no orchestrator (compose/swarm) will fight a manual recreate.","Check disk space and port availability on the host before recreate."],"tags":["docker","cloud-tools","update"],"backgroundTag":"upstream-api-error","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"}