amir20/dozzle · error
err.Error()
Error message
err.Error()
What it means
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.
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
Defensive patterns
Strategy: fallback
Validate before calling
const exists = containers.some(c => c.id === cid && c.host === hostId);
if (!exists) throw new Error('container no longer available'); Try / catch
const res = await fetch(actionUrl, {method: 'POST'});
if (res.status === 404) {
await refreshContainers(); // id changed; reload list and retry with new id
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: Container was recreated so its id changed; UI using a stale id; wrong host in URL; user's container filter excludes the target container.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
- Unable to find avatar
- Failed to save alert
- Preview failed
- cloud search failed
- Failed to save destination
AI-assisted analysis of amir20/dozzle@d9463cbe21 (2026-09-07).
Data as JSON: /api/errors/dc7306194c0056b4.
Report an issue: GitHub.
Appendix: source
Thrown at internal/web/actions.go:36
permit := true
if h.config.Authorization.Provider != NONE {
user := auth.UserFromContext(r.Context())
if user.ContainerLabels.Exists() {
userLabels = user.ContainerLabels
}
permit = user.Roles.Has(auth.Actions)
}
if !permit {
log.Warn().Msg("user is not permitted to perform actions on container")
http.Error(w, http.StatusText(http.StatusForbidden), http.StatusForbidden)
return nil, false
}
containerService, err := h.hostService.FindContainer(hostKey(r), id, userLabels)
if err != nil {
log.Error().Err(err).Msg("error while trying to find container")
http.Error(w, err.Error(), http.StatusNotFound)
return nil, false
}
return containerService, true
}
func (h *handler) containerActions(w http.ResponseWriter, r *http.Request) {
action := chi.URLParam(r, "action")
containerService, ok := h.findContainerWithActions(w, r)
if !ok {
return
}
parsedAction, err := container.ParseContainerAction(action)
if err != nil {
log.Error().Err(err).Msg("error while trying to parse action")
http.Error(w, err.Error(), http.StatusBadRequest)View on GitHub (pinned to d9463cbe21)