{"record":{"id":"77a8f1ea5de5ecfb","repo":"amir20/dozzle","slug":"container-s-not-found-in-pod-s","errorCode":null,"errorMessage":"container %s not found in pod %s","messagePattern":"container (.+?) not found in pod (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/k8s/client.go","lineNumber":539,"sourceCode":"\t}\n}\n\nfunc (k *K8sClient) FindContainer(ctx context.Context, id string) (container.Container, error) {\n\tlog.Debug().Str(\"id\", id).Msg(\"Finding container\")\n\tnamespace, podName, containerName := parsePodContainerID(id)\n\n\tpod, err := k.Clientset.CoreV1().Pods(namespace).Get(ctx, podName, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn container.Container{}, err\n\t}\n\n\tfor _, c := range k.podToContainers(ctx, pod) {\n\t\tif c.ID == id {\n\t\t\treturn c, nil\n\t\t}\n\t}\n\n\treturn container.Container{}, fmt.Errorf(\"container %s not found in pod %s\", containerName, podName)\n}\n\nfunc (k *K8sClient) ContainerLogs(ctx context.Context, id string, since time.Time, stdType container.StdType) (io.ReadCloser, error) {\n\tnamespace, podName, containerName := parsePodContainerID(id)\n\n\tvar lines int64 = 500\n\topts := &corev1.PodLogOptions{\n\t\tContainer:  containerName,\n\t\tFollow:     true,\n\t\tPrevious:   false,\n\t\tTimestamps: true,\n\t\tSinceTime:  &metav1.Time{Time: since},\n\t\tTailLines:  &lines,\n\t}\n\n\treturn k.Clientset.CoreV1().Pods(namespace).GetLogs(podName, opts).Stream(ctx)\n}\n","sourceCodeStart":521,"sourceCodeEnd":557,"githubUrl":"https://github.com/amir20/dozzle/blob/d9463cbe21874e44ab79db6fa63e746ca7d22928/internal/k8s/client.go#L521-L557","documentation":"FindContainer decoded the container id into namespace/pod/container, fetched the pod successfully, but none of the pod's container statuses produced a matching ID. This typically means the pod was restarted/rescheduled (id stale) or the requested container name is not (or no longer) part of the pod.","triggerScenarios":"Thrown at internal/k8s/client.go:539 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Refresh the container list; the pod likely restarted and container IDs changed.","Verify the requested container name exists in the pod spec.","Handle this as a 404-style error in the UI and prompt the user to reselect the container."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}