amir20/dozzle · error
failed to list pods in namespace
Error message
failed to list pods in namespace %s: %w
What it means
ListContainers queries pods across each of the client's configured namespaces and wraps any per-namespace list failure with the namespace name. Commonly caused by RBAC denial (pods not listable), a bad label selector, or an unreachable API server for that namespace.
Solutions
- Check RBAC rules allow listing pods in the given namespace (ClusterRole with pods list/get/watch).
- Verify the label selector values are valid Kubernetes label values (no invalid characters).
- Confirm the namespace exists and the API server is reachable from the Dozzle pod.
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at internal/k8s/client.go:472 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of amir20/dozzle@d9463cbe21 (2026-09-07).
Data as JSON: /api/errors/91a18760f9e36856.
Report an issue: GitHub.
Appendix: source
Thrown at internal/k8s/client.go:472
func (k *K8sClient) ListContainers(ctx context.Context, labels container.ContainerLabels) ([]container.Container, error) {
podLabels, metadataLabels := splitK8sFilters(labels)
selector := ""
if podLabels.Exists() {
for key, values := range podLabels {
for _, value := range values {
if selector != "" {
selector += ","
}
selector += fmt.Sprintf("%s=%s", key, value)
}
}
log.Debug().Str("selector", selector).Msg("Listing containers with labels")
}
containerList := lop.Map(k.namespace, func(namespace string, index int) lo.Tuple2[[]container.Container, error] {
pods, err := k.Clientset.CoreV1().Pods(namespace).List(ctx, metav1.ListOptions{LabelSelector: selector})
if err != nil {
return lo.T2[[]container.Container, error](nil, fmt.Errorf("failed to list pods in namespace %s: %w", namespace, err))
}
var containers []container.Container
for _, pod := range pods.Items {
for _, c := range k.podToContainers(ctx, &pod) {
if metadataLabels.Exists() && !matchesContainerLabels(c.Labels, metadataLabels) {
continue
}
containers = append(containers, c)
}
}
return lo.T2[[]container.Container, error](containers, nil)
})
var containers []container.Container
var lastError error
success := false
for _, t2 := range containerList {
items, err := t2.Unpack()View on GitHub (pinned to d9463cbe21)