{"record":{"id":"dc7306194c0056b4","repo":"amir20/dozzle","slug":"err-error","errorCode":null,"errorMessage":"err.Error()","messagePattern":"err\\.Error\\(\\)","errorType":"http","errorClass":null,"httpStatus":404,"severity":"error","filePath":"internal/web/actions.go","lineNumber":36,"sourceCode":"\tpermit := true\n\tif h.config.Authorization.Provider != NONE {\n\t\tuser := auth.UserFromContext(r.Context())\n\t\tif user.ContainerLabels.Exists() {\n\t\t\tuserLabels = user.ContainerLabels\n\t\t}\n\t\tpermit = user.Roles.Has(auth.Actions)\n\t}\n\n\tif !permit {\n\t\tlog.Warn().Msg(\"user is not permitted to perform actions on container\")\n\t\thttp.Error(w, http.StatusText(http.StatusForbidden), http.StatusForbidden)\n\t\treturn nil, false\n\t}\n\n\tcontainerService, err := h.hostService.FindContainer(hostKey(r), id, userLabels)\n\tif err != nil {\n\t\tlog.Error().Err(err).Msg(\"error while trying to find container\")\n\t\thttp.Error(w, err.Error(), http.StatusNotFound)\n\t\treturn nil, false\n\t}\n\n\treturn containerService, true\n}\n\nfunc (h *handler) containerActions(w http.ResponseWriter, r *http.Request) {\n\taction := chi.URLParam(r, \"action\")\n\n\tcontainerService, ok := h.findContainerWithActions(w, r)\n\tif !ok {\n\t\treturn\n\t}\n\n\tparsedAction, err := container.ParseContainerAction(action)\n\tif err != nil {\n\t\tlog.Error().Err(err).Msg(\"error while trying to parse action\")\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/amir20/dozzle/blob/d9463cbe21874e44ab79db6fa63e746ca7d22928/internal/web/actions.go#L18-L54","documentation":"After the action-permission check, FindContainer resolves the host/container; any failure (unknown host, unknown container id) is returned verbatim as the 404 response body via err.Error(). The client-visible message is the underlying lookup error.","triggerScenarios":"Action or update request against a container id that no longer exists, a wrong host id, or a container filtered out by the user's label filters.","commonSituations":"Container was recreated so its id changed; UI using a stale id; wrong host in URL; user's container filter excludes the target container.","solutions":["Refresh the container list and retry with the current container id","Verify the host id in the URL matches an available host","Check the user's label filters are not hiding the container","Inspect Dozzle logs ('error while trying to find container') for the underlying cause"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"const exists = containers.some(c => c.id === cid && c.host === hostId);\nif (!exists) throw new Error('container no longer available');","typeGuard":null,"tryCatchPattern":"const res = await fetch(actionUrl, {method: 'POST'});\nif (res.status === 404) {\n  await refreshContainers(); // id changed; reload list and retry with new id\n}","preventionTips":["Always refresh container ids after container recreation (docker compose up replaces ids)","Filter actions to containers visible to the current user's label filters","Include host id in URLs from live store state, not bookmarks"],"tags":["http","not-found","container-lookup"],"backgroundTag":"entity-not-found","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"}