Troubleshooting, 50 production problems and 50 interview questions
Hour overview
This optional hour is for when things break in production, and for when you are preparing to talk about Podman in an interview. It collects the errors you will meet most often, the commands that show what is happening, two failures to walk through, fifty production problems with their likely causes and fixes, and fifty interview questions with short answers.
Time allocation. Error catalogue 10, diagnostic toolkit 10, walk-throughs 10, fifty production problems 14, fifty interview questions 16.
Prerequisite. Hours 1 to 7, or equivalent experience. The walk-throughs use the sample service from podman-app.
Objectives. By the end of the hour you can:
- match an error message to its most likely cause and first check
- choose the diagnostic command that answers a specific question, and read its output in order
- work from a symptom to a fix in two real failures
- name the cause and the fix for each of the fifty production problems
- answer the fifty interview questions at the level expected for an engineer who runs Podman
Modules
Error catalogue
Podman error text changes between releases. Use this table as a guide, read the full message, and then check the cause it points to.
| Symptom | Likely cause | First check |
|---|---|---|
| short-name resolution error, no prompt possible | a short image name in a script with no terminal | use the full name, such as docker.io/library/alpine |
cannot find UID/GID for user, newuidmap errors | no subordinate range, or uidmap missing | grep "^$USER:" /etc/subuid /etc/subgid |
address already in use | another process holds the host port | ss -ltnp |
permission denied on a bind mount | ownership in the user namespace, or an SELinux label | podman unshare cat /proc/self/uid_map, then :Z on a dedicated folder |
permission denied binding port 80 | rootless low-port restriction | publish a higher host port |
Cannot connect to Podman (Windows, macOS) | the machine is stopped | podman machine list, then podman machine start |
| exit code 137 | SIGKILL: out of memory, or stop timeout | podman inspect for OOMKilled and the memory setting |
read-only file system | a :ro mount or --read-only, on a path the app writes | give the path a volume or --tmpfs |
bad address on a container name | the containers are on different networks | podman network inspect on each |
no such container | a typo, or the container was removed | podman ps -a |
Diagnostic toolkit
Choose the command that answers your question, and read the output in this order: status, exit code, logs, configuration, then the host.
podman info
podman ps -a
podman logs --tail 100 NAME
podman inspect NAME
podman top NAME
podman container diff NAME
podman events --since 10m
podman system df
podman --log-level=debug run --rm docker.io/library/alpine:3.20 true
ss -ltnp
journalctl --user -u web.service -n 50 --no-pager
getenforce
infoshows the rootless state, the runtime, the network helper and the storage driver.ps -ashows stopped containers, where a crash appears.logs --tailshows what the application wrote. Start there.inspectshows the configuration you actually ran, the exit code,OOMKilled, the mounts and the health state.toplists the processes inside the container.container difflists files changed compared with the image.eventsshows recent starts, stops and kills.system dfshows whether the disk is full.--log-level=debugshows what Podman does, step by step. Filter the output before you read it.ss -ltnpshows which process listens on each port.journalctl --usershows the logs of a Quadlet service.getenforceshows whether SELinux is enforcing.
Expected: each command answers one question. Use events to find out what happened just before a failure, and diff to find files the container wrote.
Walk through two failures
Failure A: the service does not start after a change. A developer changed the port to 8000, and the service fails to start.
1. Symptom: podman run -d -p 127.0.0.1:8000:8000 localhost/podman-app:dev fails with address already in use.
2. Check the port: ss -ltnp | grep 8000 shows another process on it.
3. Decide: change the host port to 8020, or stop the other process if you own it.
4. Verify: run again with -p 127.0.0.1:8020:8000, then curl -s http://127.0.0.1:8020/health should print {"status": "ok"}.
Failure B: the service restarts without a clear error. The service runs, then stops with exit code 137 about every minute.
1. Symptom: podman ps -a shows Exited and podman inspect --format '{{.State.ExitCode}}' NAME prints 137.
2. Check the cause: podman inspect --format '{{.State.OOMKilled}}' NAME prints true if the kernel killed it for memory.
3. Check the limit: podman inspect --format '{{.HostConfig.Memory}}' NAME shows the configured memory in bytes. Zero means no limit.
4. Fix: raise the limit if the workload really needs more, or fix the memory growth in the application. Check with podman stats --no-stream NAME after the change.
OOMKilled often means a stop timeout ended with SIGKILL. Check the stop time and the signal handling in the application (hour 3, module 5).Fifty production problems
Each row is a symptom seen in production, its likely cause, and the fix. Check the cause before you apply the fix.
Build
| # | Symptom | Likely cause | Fix |
|---|---|---|---|
| 1 | COPY fails with no such file | build run from the wrong folder, or the file is excluded | build from the folder with the file, and check .containerignore |
| 2 | old code in the image after an edit | the copied file path is different from the one edited | check the path in COPY, then rebuild with --no-cache |
| 3 | every build is slow | an expensive step sits below a step that changes every time | move the rarely changing step up |
| 4 | base image pull fails | the tag was removed or the registry is unreachable | pin a digest, and mirror the base image you depend on |
| 5 | image is hundreds of megabytes too large | build tools stay in the final image | multi-stage build, slim base, clean package caches in the same RUN |
| 6 | a secret is found in image history | copied into a layer and deleted later | rebuild, rotate the secret, and use a build-time secret mount |
| 7 | the container runs as root | no USER in the Containerfile | add a numeric USER |
| 8 | exec format error at run time | image built for another CPU architecture | build or pull the matching --platform |
| 9 | the health check never runs | the OCI image format drops HEALTHCHECK | set the health check at run time, or build with --format docker |
| 10 | arguments appended to the wrong command | mixed ENTRYPOINT and CMD | choose one clear entry point, and document the arguments |
Runtime
| # | Symptom | Likely cause | Fix |
|---|---|---|---|
| 11 | container exits at once | the foreground process ended | read logs and the exit code, then fix the command |
| 12 | exit code 137 | out of memory, or a stop timeout | check OOMKilled, raise the limit or the stop time |
| 13 | stop always takes the full timeout | shell form, so sh ignores SIGTERM as PID 1 | use the exec form of CMD |
| 14 | no restart after reboot | no systemd unit | run the service with Quadlet and enable lingering |
| 15 | crash loop | a configuration error repeated at each start | read the first error in the logs, fix the configuration |
| 16 | health status unhealthy | the check command is missing, or the route is wrong | run healthcheck run by hand, fix the command or the route |
| 17 | disk full | unused images, stopped containers, large volumes | system df, then targeted prune after review |
| 18 | slow start after deploy | the image is pulled on start | pre-pull, use a smaller image, keep a local copy |
| 19 | wrong time in logs | the image defaults to UTC | set TZ and check the timezone data in the image |
| 20 | logs fill the disk | no log rotation for the log driver | configure rotation for the driver in use |
Networking
| # | Symptom | Likely cause | Fix |
|---|---|---|---|
| 21 | container name does not resolve | the containers are on the default network | put them on a user-defined network |
| 22 | address already in use | another process holds the port | ss -ltnp, then choose another port |
| 23 | published port unreachable from another machine | bound to 127.0.0.1 | intended, or publish on the right address and open the firewall |
| 24 | connection refused inside the network | the service listens on loopback only | listen on 0.0.0.0 inside the container |
| 25 | permission denied on port 80 | rootless low-port restriction | publish a higher port, or change the threshold deliberately |
| 26 | outbound traffic is slow | the rootless helper is slirp4netns on 4.x | check podman info, and plan the move to Podman 5.x |
| 27 | external names do not resolve | host DNS or VPN settings | test with nslookup in a container, then check the host resolver |
| 28 | two stacks clash on a port | the same host port in two projects | give each project its own port |
| 29 | the application logs the wrong client address | the helper translates addresses | use the proxy headers, and document the helper |
| 30 | containers in a pod cannot reach each other by name | containers in a pod share localhost | use 127.0.0.1 |
Storage, logs and registries
| # | Symptom | Likely cause | Fix |
|---|---|---|---|
| 31 | permission denied on a bind mount | the ID mapping, or an SELinux label | check uid_map, then keep-id or unshare chown, and :Z on a dedicated folder |
| 32 | data missing after a prune | an unused volume was removed | restore from the last export, and record an owner for every volume |
| 33 | read-only file system | a :ro mount or --read-only on a written path | give that path a volume or --tmpfs |
| 34 | SELinux denial on a mount | the folder has the wrong label | :Z on a dedicated folder, never on a system path |
| 35 | volume import fails | the target volume does not exist | create the target volume first |
| 36 | push returns unauthorized | not logged in, or the token lacks write permission | log in with a token that has write permission |
| 37 | push fails with a certificate error | the registry certificate is not trusted | install the registry's CA on the host, as the registry documents |
| 38 | pull is rate limited | anonymous pulls from a public registry | log in, or use a mirror you control |
| 39 | a deployed version changed without a release | the tag moved | deploy by digest |
| 40 | a CI job fails on a short name | the job depends on the registry configuration | write full names in every script |
Security and operations
| # | Symptom | Likely cause | Fix |
|---|---|---|---|
| 41 | rootless fails with newuidmap | no subordinate range, or uidmap missing | add the range, install uidmap, run podman system migrate |
| 42 | a container can change host files | the mount is wider than the service needs | mount the narrower path, read-only where possible |
| 43 | a password appears in inspect | the password was passed as an environment variable | move it to a secret |
| 44 | an audit finds a privileged container | --privileged used for a quick fix | remove it, and add only the capability the service needs |
| 45 | a scan finds vulnerable packages | an old base image | rebuild on an updated base, and pin the new digest |
| 46 | auto-update broke the service | a new build with a regression | roll back to the digest of the last good build |
| 47 | services stop after logout | lingering not enabled | loginctl enable-linger for the service user |
| 48 | web.service not found | the Quadlet file was added but not loaded | systemctl --user daemon-reload |
| 49 | behaviour changed after an upgrade | a default changed between Podman versions | read the release notes, and test on a lab host first |
| 50 | all containers and images disappeared | podman system reset was run by mistake | restore from exports and image copies, and limit who can run it |
Fifty interview questions
Each answer is short on purpose. Use the questions to check what you can explain without notes. Practise saying the answer in your own words.
Concepts
1. What is Podman? A container engine that runs OCI images, with a command line largely compatible with Docker.
2. What does daemonless mean? There is no central service. Each command does the work, and conmon monitors each container.
3. What is rootless? Running containers as an ordinary user, using user namespaces to map IDs.
4. What is an OCI image? An image that follows the Open Container Initiative image specification.
5. Image or container? An image is a read-only stack of layers. A container is an instance of an image with a writable layer.
6. What is a registry? A server that stores images and serves them by name.
7. What is Buildah? A tool for building OCI images. Podman's build command shares code with it.
8. What is Skopeo? A tool that copies, inspects and signs images between registries without running them.
9. What is conmon? A small helper process that monitors a container and records how it exits.
10. What runs the container process? An OCI runtime such as crun or runc, which creates the namespaces and cgroups.
Images and building
11. What is a fully qualified image name? Registry, namespace, name and tag, for example docker.io/library/alpine:3.20.
12. Why are short names risky? They are resolved through configured registries, so a script can pull from an unexpected place or fail.
13. Tag or digest? A tag is a name that can move. A digest is a hash of the content, and it does not change.
14. What is a dangling image? An untagged image left behind when a newer build takes its tag.
15. Containerfile or Dockerfile? The same syntax. Podman accepts both names.
16. Why copy the dependency file before the source? So the cached dependency layer survives changes to the source.
17. What is a multi-stage build? A build with several FROM stages, where only chosen files reach the final image.
18. What does .containerignore do? It excludes files from the build context, so they cannot be copied into the image.
19. Why set a non-root USER? It limits what a compromised process can do inside the container.
20. ENTRYPOINT or CMD? ENTRYPOINT sets the program to run. CMD sets default arguments, or the command when there is no ENTRYPOINT.
Running containers
21. How do you pass configuration? Environment variables, env files, or mounted configuration files.
22. Why not a password in an environment variable? inspect and the environment expose it. A secret is mounted as a file.
23. What does --memory do? It caps memory. A process that exceeds it is killed by the kernel.
24. Why might a restart policy not start a container after a reboot? Podman has no daemon. systemd, through Quadlet, does that job.
25. Which exit code means SIGKILL? 137, which is 128 plus 9.
26. Stop or kill? stop sends SIGTERM, waits for the timeout, then sends SIGKILL. kill sends a signal immediately.
27. Why the exec form of CMD? The program becomes PID 1 and receives the stop signal directly.
28. What states can a health check report? Starting, healthy and unhealthy.
29. What does --init address? Zombie processes and signal handling when the application is PID 1.
30. Where do you read a container's output? podman logs.
Storage and networking
31. What happens to the writable layer when a container is removed? It is deleted. Data that must survive belongs in a volume or a bind mount.
32. Named volume or bind mount? A named volume is managed by Podman. A bind mount maps a host path.
33. What do :Z and :z do? They set the SELinux label: :Z is private to one container, :z is shared.
34. What does --userns=keep-id do? It maps your user ID to the same ID inside the container, so bind-mount ownership matches.
35. What is podman unshare for? It runs a command inside your user namespace, for example to change ownership of files the container uses.
36. Why can a rootless container not bind port 80 by default? On Linux, ports below 1024 need privilege.
37. What is pasta? The default rootless network helper since Podman 5.0. It replaced slirp4netns.
38. What does netavark do? It provides the networking for container networks in current Podman releases.
39. How do containers find each other by name? On a user-defined network, through DNS.
40. What does --network host change? The container shares the host network namespace, so isolation is reduced.
Pods, services, security and operations
41. What is a pod? A group of containers that share namespaces, such as the network, through an infrastructure container.
42. What does kube play do? Creates pods and containers from a Kubernetes YAML file.
43. How does podman compose work? It runs an external provider, such as docker-compose or podman-compose, with the Compose file.
44. What is Quadlet? A systemd generator that turns files such as .container into service units.
45. Why is podman generate systemd deprecated? Quadlet files describe the desired state and can be kept in version control.
46. Why enable lingering? So user services keep running after logout and start at boot.
47. What does AutoUpdate=registry do? Checks whether the tag has a new image, pulls it, and restarts the service.
48. What does --cap-drop=ALL do? Removes all Linux capabilities from the container's process.
49. What is the risk of --privileged? It grants all capabilities and host device access, which removes most isolation.
50. How do you troubleshoot "cannot connect" on Windows? Check podman machine list, start the machine, then run the command again.