Skip to content
RAG infrastructure on Kubernetes · Chapter 19 of 20 Appendix B: Error catalog

Appendix B: Error catalog

What this appendix is for: You have an error message or strange behaviour and are looking for a place to start. Each entry tells you how the problem shows up, how to narrow it down, what the cause was and how it was fixed. Every entry really happened in the author’s lab – in drills, diagnosis tasks, challenges, during setup or during the inventory for Appendix C. The messages are the ones from the lab; the lab is German, so some log lines are too. The days in parentheses lead to the full solution.

One rule applies to almost every entry: The status says little, the numbers and the log say more. Many faults in this course showed up with 200 – the cause was in the tally sheet, in the answer service’s log or in a pod’s events.

Overview

No. Message (excerpt) Cause Day
B1 open /etc/rancher/k3s/k3s.yaml: permission denied own kubeconfig missing 0
B2 getent hosts rag2 prints nothing after a reboot cloud-init rewrites /etc/hosts 10
B3 HTTP 413 or 400: the input length exceeds the context length text longer than context and batch 2
B4 must be less than or equal to cpu limit of 1 request larger than limit 3
B5 embedding takes 13.5 instead of 1.8 s CPU limit throttles 3
B6 reranker OOMKilled while warming up, later 422 batches too large 8
B7 0/2 nodes are available: 1 Insufficient cpu node fully booked by requests 9
B8 language model OOMKilled after 15 prompts prompt cache may grow to 8192 MiB 10
B9 error: lost connection to pod port-forward bound to a deleted pod 4
B10 helper pod curl shows Completed sleep 3600 has run out 7
B11 writes 500 … deactivation timed out after 30s, pod Pending node failed, volume bound to the node 11
B12 curl exit 52, log says HTTP Error 404: Not Found collection deleted 12
B13 keine Karte bester 0.056 for every question sign moved, model does not match 13
B14 delete pod takes 31.8 s process 1 does not catch SIGTERM 9
B15 504, log says Zeitüberschreitung nach 15.0 s LLM_TIMEOUT shorter than the answer time 9, 16
B16 Must provide an API key… · Global manage access is required key missing or read key only 14
B17 URLError … [Errno 111] Connection refused from a job manifest without the label for the fence 14
B18 Prometheus: pg-1 down … connect: connection refused pg-zaun blocks port 9187 15
B19 answer verworfen, but no alert counter only appears with the event 15
B20 wrong answer with "sammlung": "wissen", no alert sign not moved back after a test 16

Site and resources

B1 – kubectl may not read the kubeconfig

  • Message: error: error loading config file "/etc/rancher/k3s/k3s.yaml": open /etc/rancher/k3s/k3s.yaml: permission denied – although ~/.kube/config already exists.
  • Narrowing it down: With k3s, kubectl is a link to k3s, which reads root’s file when KUBECONFIG is not set.
  • Cause: KUBECONFIG is not set.
  • Fix: export KUBECONFIG=~/.kube/config in ~/.bashrc. Do not loosen the permissions of k3s.yaml: whoever can read the file is administrator of the cluster. (Day 0)

B2 – rag1 no longer knows rag2 after a reboot

  • Message: getent hosts rag2 prints nothing on rag1 (exit code 2). k3s keeps running, both nodes Ready.
  • Narrowing it down: The first line of /etc/hosts reads # Your system has configured 'manage_etc_hosts' as True.; the two lines from Day 0 are gone. uptime -s shows the reboot when rag1 was enlarged (Day 10). The setting is not in /etc/cloud/cloud.cfg – it comes from the VM’s user data (/var/lib/cloud/instance/user-data.txt).
  • Cause: cloud-init rewrites /etc/hosts from a template at every boot. k3s does not notice because it works with IP addresses (node-ip, server: https://<ip>:6443).
  • Fix: add the two lines to /etc/cloud/templates/hosts.debian.tmpl below 127.0.0.1 localhost (back it up as .orig first) and, without a reboot, run sudo cloud-init single --name update_etc_hosts --frequency always. Afterwards /etc/hosts contains 10:172.16.0.182 rag1 and 11:172.16.0.83 rag2, and getent hosts rag2 on rag1 answers 172.16.0.83 rag2. Fixed this way on both VMs in the lab on 3 Dec 2026; the full procedure is in Day 0, Step 7a. What counts is the first line of /etc/hosts, not cloud.cfg. (Day 0, Day 10)

B3 – Text too long for the embedding model

  • Message: with truncate: false, HTTP 413 (bge-m3) or HTTP 400 (nomic-embed-text): {"error":"the input length exceeds the context length"}. Without truncate: false you get 200 – and the text is silently cut off after 2048 tokens.
  • Narrowing it down: prompt_eval_count in the answer is exactly 2048.
  • Cause: The text fits neither the context nor one processing batch. num_ctx 8192 alone did not help; only together with num_batch 8192 did 200 come back – after 60 seconds and with 1.6 GB of memory.
  • Fix: split documents into cards well below the context (Day 6). (Day 2)

B4 – Request larger than limit

  • Message: The Deployment "embed" is invalid: spec.template.spec.containers[0].resources.requests: Invalid value: "2": must be less than or equal to cpu limit of 1.
  • Narrowing it down: The API server rejects the manifest; nothing changes on the running pod.
  • Cause: limits.cpu: 1 with requests.cpu: 2.
  • Fix: request at most as large as the limit – or no CPU limit at all (see B5). (Day 3)

B5 – CPU limit throttles the embedding

  • Message: none. Embedding four cards takes 13.53 instead of 1.74 seconds.
  • Narrowing it down: kubectl -n rag exec deploy/embed -- cat /sys/fs/cgroup/cpu.stat → nr_periods 626, nr_throttled 531: throttled in 85 % of periods. kubectl top shows 979m – right at the limit.
  • Cause: limits.cpu: 1. The model could use more cores but is not allowed to.
  • Fix: remove the CPU limit, keep the request as a commitment; 2.35 seconds afterwards. (Day 3)

B6 – Reranker dies while warming up

  • Message: Reason: OOMKilled (bge-reranker-v2-m3 with 4 GiB, mmarco-mMiniLMv2 with 1 GiB); later, with 50 candidates, batch size 50 > maximum allowed batch size 32 (422).
  • Narrowing it down: kubectl -n rag describe pod -l app=rerank shows Last State: Terminated, Reason: OOMKilled and the number of restarts.
  • Cause: The default max-batch-tokens 16384 needs more memory while warming up than the limit allows; the number of texts per request is capped at 32.
  • Fix: smaller model with 2 GiB, --max-batch-tokens=2048, --max-client-batch-size=64. (Day 8)

B7 – Pod stays Pending: Insufficient cpu

  • Message: 0/2 nodes are available: 1 Insufficient cpu, 1 node(s) didn't match Pod's node affinity/selector.
  • Narrowing it down: kubectl describe node rag1, section Allocated resources: the pods’ requests fill the node, even while the CPU has little to do.
  • Cause: The reranker asks for a whole core on rag1; the commitments for embedding and language model leave no room.
  • Fix: lower the reranker’s request to 250m – or switch it off while it is not needed (--replicas=0). (Day 9)

B8 – Language model OOMKilled under load

  • Message: The llm pod ends with OOMKilled; the answer service writes a traceback with URLError (Errno 111), individual load questions end as abbruch.
  • Narrowing it down: kubectl -n rag logs deployment/llm | grep 'size limit' → prompt cache is enabled, size limit: 8192 MiB – with a limit of 3 GiB.
  • Cause: The prompt cache grows with every new prompt; after 15 prompts it held about 1085 MiB, the pod 2997 MiB.
  • Fix: LLAMA_ARG_CACHE_RAM set to "256"; afterwards size limit: 256 MiB and 2198 MiB in the pod. (Day 10)

Qdrant and data

B9 – Port-forward breaks

  • Message: in the second terminal error: lost connection to pod, together with failed to find sandbox … in store: not found.
  • Narrowing it down: kubectl -n rag get pods – qdrant-0 has restarted.
  • Cause: port-forward is bound to one specific pod, even when you name the service.
  • Fix: restart the port-forward; from Day 9 work from the helper pod via qdrant.rag. (Day 4)

B10 – Helper pod has finished

  • Message: commands through kubectl -n rag exec curl stop working.
  • Narrowing it down: kubectl -n rag get pods shows curl 0/1 Completed 0 73m.
  • Cause: The pod ran sleep 3600 – after an hour its only process is done.
  • Fix: delete the pod and recreate it with sleep infinity. (Day 7)

B11 – Writes fail, pod stays Pending when rag2 fails

  • Message: the first write request returns 500 after 36 seconds: Some replica of shard 0 failed to apply operation and deactivation timed out after 30s … Please retry; the second succeeds in 0.01 s. A deleted qdrant-0 stays Pending: 1 node(s) didn't match PersistentVolume's node affinity, 1 node(s) had untolerated taint(s).
  • Narrowing it down: curl …:6333/cluster – one peer is missing. kubectl describe pv <name> shows Node Affinity … hostname in [rag2].
  • Cause: Qdrant only deactivates the copy on the failed peer after 30 seconds. A local-path volume lives on exactly one node; the pod cannot start anywhere else.
  • Fix: retry writes after an error; protection against node failure comes from copies (replication_factor 2) and pods on both nodes, not from the volume. qdrant-0 starts by itself once rag2 is back. (Day 11)

B12 – Empty answer after deleting a collection

  • Message: curl ends with exit 52 (Empty reply from server); the answer service’s log says urllib.error.HTTPError: HTTP Error 404: Not Found.
  • Narrowing it down: curl …:6333/collections/wissen → Not found – on both peers.
  • Cause: A DELETE removes a collection on all peers; copies do not protect against operator errors. The answer service does not catch Qdrant’s error.
  • Fix: upload the snapshot (…/snapshots/upload?priority=snapshot&wait=true); correct again after 28 seconds in the lab. Everything after the snapshot is lost (RPO). (Day 12)

B13 – After moving the sign nothing finds a card

  • Message: every answer 200, text “Dazu steht nichts im Handbuch.” (“The handbook says nothing about this.”); the log says keine Karte bester 0.056.
  • Narrowing it down: The best score is far below any normal value; the sign points to wissen-qwen3, the answer service embeds with bge-m3.
  • Cause: Question and cards come from different models; the vectors are not comparable.
  • Fix: model and threshold as metadata on the collection; the answer service reads them behind the sign (antwort.py v4). Only then move the sign. (Day 13; the same picture with wrong metadata on Day 15)

Answer service

B14 – Pod takes 31.8 seconds to shut down

  • Message: time kubectl -n rag delete pod <name> → 31.8 seconds.
  • Narrowing it down: kubectl -n rag exec deployment/antwort -- grep -E '^(SigIgn|SigCgt)' /proc/1/status → SigCgt: 0000000100000002 – the bit for SIGTERM is missing.
  • Cause: Python as process 1 ignores SIGTERM; Kubernetes waits for the grace period and sends SIGKILL.
  • Fix: a signal handler in the service (SigCgt …4002); 2.0 seconds afterwards. (Day 9)

B15 – 504 with “Zeitüberschreitung”

  • Message: 504, body {"fehler": "keine Antwort in 15.0 s"}; the log says Zeitüberschreitung nach 15.0 s <frage> (timeout after 15.0 s).
  • Narrowing it down: zeitueberschreitung rises in the tally sheet; the mean of llm_antwort drops because the long answers are missing. kubectl diff -f ~/kurs/15/antwort.yaml shows LLM_TIMEOUT "15".
  • Cause: The timeout is shorter than the language model’s answer time (95th percentile 9.4 s reading plus 15.2 s writing, Day 15). On Day 9 it was set to 5 s on purpose; on Day 16 a colleague had “tightened” it.
  • Fix: apply the target state with LLM_TIMEOUT "60"; alert rule AuskunftZeitueberschreitung. (Day 9, Day 16)

Security and observing

B16 – 401 and 403 from Qdrant

  • Message: without a key Must provide an API key or an Authorization bearer token; with the read key when writing {"status":{"error":"Forbidden: Global manage access is required"}}.
  • Narrowing it down: Which file is behind -K? lesen.conf may search, not create or delete.
  • Cause: Since Day 14 Qdrant runs with apiKey and readOnlyApiKey.
  • Fix: -K /schluessel/lesen.conf for reading, -K /schluessel/voll.conf for writing; services get the key from the secret qdrant-schluessel. (Day 14)

B17 – Job no longer reaches Qdrant

  • Message: the test bench log says urllib.error.URLError: <urlopen error [Errno 111] Connection refused>.
  • Narrowing it down: kubectl -n rag get pods -L qdrant-zugang – the column is empty for the job.
  • Cause: The manifest is from Day 13; since Day 14 qdrant-zaun only lets pods with qdrant-zugang=ja through. Under k3s the fence answers with “refused”, not with a timeout.
  • Fix: use the manifest from Day 14 (label and key). (Day 14)

B18 – Prometheus cannot reach PostgreSQL

  • Message: target pg-1 down: Get "http://10.42.1.3:9187/metrics": dial tcp 10.42.1.3:9187: connect: connection refused.
  • Narrowing it down: The other four targets are up; kubectl get networkpolicy -n rag shows pg-zaun.
  • Cause: pg-zaun only allows 5432 and the operator; the exporter listens on 9187.
  • Fix: a fourth rule in pg-zaun: pods with app=prometheus may reach 9187; up after about 20 seconds. (Day 15)

B19 – The silent alert

  • Message: An answer is verworfen (discarded), the rule AuskunftVerwirft stays inactive.
  • Narrowing it down: The time series antwort_fragen_total{ergebnis="verworfen"} only starts with the event – at 1. Values 1, 1, 1 give an increase of 0.
  • Cause: A counter that only appears with the first event has no increase.
  • Fix: create all results at 0 at startup; afterwards 0 → 1 → firing. (Day 15)

B20 – Wrong answer without an alert

  • Message: “Lade den neuen VPN-Client von dem Self-Service-Portal herunter.” (“Download the new VPN client from the self-service portal.”) – status 200, no rule active, the test bench reports MRR 0.78 as always.
  • Narrowing it down: The best scores have moved to the right as a whole (0.6–0.8 instead of 0.42–0.6); every source carries "sammlung": "wissen"; curl …:6333/aliases → auskunft points to wissen.
  • Cause: After a test of the way back, the sign stayed on the old collection, which lacks the new card. The test bench queries wissen-qwen3 directly and does not see the sign. After moving it back, a third, previously hidden cause appeared (shortened domain list).
  • Fix: sign back (umhaengen-qwen3.json), answer service to the target state, measure after every repair; counter-checks through the answer service instead of against the database. (Day 16)

Passed the exam? With a free account it counts towards your belt. Sign up for free

Contents

More