KCNA Container Orchestration Practice Question
A user runs 'kubectl exec -it pod1 -- /bin/sh' and gets the error: 'error: unable to upgrade connection: container not found ("app")'. The pod has one container named 'app'. What is the most likely cause?
⚠ Common exam trap
The CNCF exam often tests the distinction between errors caused by a missing binary inside the container versus errors caused by the container not being in a running state, leading candidates to incorrectly choose the missing shell option when the error message clearly references the container itself.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The pod is in a CrashLoopBackOff state
The error 'unable to upgrade connection: container not found ("app")' indicates that kubectl cannot find a running container named 'app' to attach to. When a pod is in CrashLoopBackOff state, the container repeatedly crashes and restarts, but during the backoff period the container is not running, so kubectl exec cannot locate it. This is the most likely cause because the error specifically mentions the container name, and a CrashLoopBackOff means the container is not in a running state.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The pod is running on a different node
Why it's wrong here
kubectl exec works across nodes; the location does not prevent connection.
- ✗
The container image does not have /bin/sh
Why it's wrong here
Missing shell would give a different error, typically 'executable file not found'.
- ✗
The container name is misspelled
Why it's wrong here
If the container name is wrong, the error would mention 'container not found' but the user says the container is named 'app'.
- ✓
The pod is in a CrashLoopBackOff state
Why this is correct
If the container is crashing repeatedly, it may not be running when exec attempts to connect, resulting in this error.
Go deeper
Related to this question
About these practice questions
One of 833 original KCNA practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This KCNA practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the KCNA exam.