Troubleshooting, 50 production problems and 50 interview questions

Optional. Read common Podman errors, run the diagnostic commands in order, walk through two failures, review 50 production problems with their fixes, and answer 50 interview questions.
PodmanTroubleshootingInterviewsOptional hourOptional ninth hour

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

Hour 8 · 00–10 · 10 min

Podman error text changes between releases. Use this table as a guide, read the full message, and then check the cause it points to.

SymptomLikely causeFirst check
short-name resolution error, no prompt possiblea short image name in a script with no terminaluse the full name, such as docker.io/library/alpine
cannot find UID/GID for user, newuidmap errorsno subordinate range, or uidmap missinggrep "^$USER:" /etc/subuid /etc/subgid
address already in useanother process holds the host portss -ltnp
permission denied on a bind mountownership in the user namespace, or an SELinux labelpodman unshare cat /proc/self/uid_map, then :Z on a dedicated folder
permission denied binding port 80rootless low-port restrictionpublish a higher host port
Cannot connect to Podman (Windows, macOS)the machine is stoppedpodman machine list, then podman machine start
exit code 137SIGKILL: out of memory, or stop timeoutpodman inspect for OOMKilled and the memory setting
read-only file systema :ro mount or --read-only, on a path the app writesgive the path a volume or --tmpfs
bad address on a container namethe containers are on different networkspodman network inspect on each
no such containera typo, or the container was removedpodman ps -a
Change one thing at a time. Write down what you changed, then run the same command again.

Diagnostic toolkit

Hour 8 · 10–20 · 10 min

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
  • info shows the rootless state, the runtime, the network helper and the storage driver.
  • ps -a shows stopped containers, where a crash appears.
  • logs --tail shows what the application wrote. Start there.
  • inspect shows the configuration you actually ran, the exit code, OOMKilled, the mounts and the health state.
  • top lists the processes inside the container.
  • container diff lists files changed compared with the image.
  • events shows recent starts, stops and kills.
  • system df shows whether the disk is full.
  • --log-level=debug shows what Podman does, step by step. Filter the output before you read it.
  • ss -ltnp shows which process listens on each port.
  • journalctl --user shows the logs of a Quadlet service.
  • getenforce shows 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

Hour 8 · 20–30 · 10 min

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.

Exit code 137 without 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

Hour 8 · 30–44 · 14 min

Each row is a symptom seen in production, its likely cause, and the fix. Check the cause before you apply the fix.

Build

#SymptomLikely causeFix
1COPY fails with no such filebuild run from the wrong folder, or the file is excludedbuild from the folder with the file, and check .containerignore
2old code in the image after an editthe copied file path is different from the one editedcheck the path in COPY, then rebuild with --no-cache
3every build is slowan expensive step sits below a step that changes every timemove the rarely changing step up
4base image pull failsthe tag was removed or the registry is unreachablepin a digest, and mirror the base image you depend on
5image is hundreds of megabytes too largebuild tools stay in the final imagemulti-stage build, slim base, clean package caches in the same RUN
6a secret is found in image historycopied into a layer and deleted laterrebuild, rotate the secret, and use a build-time secret mount
7the container runs as rootno USER in the Containerfileadd a numeric USER
8exec format error at run timeimage built for another CPU architecturebuild or pull the matching --platform
9the health check never runsthe OCI image format drops HEALTHCHECKset the health check at run time, or build with --format docker
10arguments appended to the wrong commandmixed ENTRYPOINT and CMDchoose one clear entry point, and document the arguments

Runtime

#SymptomLikely causeFix
11container exits at oncethe foreground process endedread logs and the exit code, then fix the command
12exit code 137out of memory, or a stop timeoutcheck OOMKilled, raise the limit or the stop time
13stop always takes the full timeoutshell form, so sh ignores SIGTERM as PID 1use the exec form of CMD
14no restart after rebootno systemd unitrun the service with Quadlet and enable lingering
15crash loopa configuration error repeated at each startread the first error in the logs, fix the configuration
16health status unhealthythe check command is missing, or the route is wrongrun healthcheck run by hand, fix the command or the route
17disk fullunused images, stopped containers, large volumessystem df, then targeted prune after review
18slow start after deploythe image is pulled on startpre-pull, use a smaller image, keep a local copy
19wrong time in logsthe image defaults to UTCset TZ and check the timezone data in the image
20logs fill the diskno log rotation for the log driverconfigure rotation for the driver in use

Networking

#SymptomLikely causeFix
21container name does not resolvethe containers are on the default networkput them on a user-defined network
22address already in useanother process holds the portss -ltnp, then choose another port
23published port unreachable from another machinebound to 127.0.0.1intended, or publish on the right address and open the firewall
24connection refused inside the networkthe service listens on loopback onlylisten on 0.0.0.0 inside the container
25permission denied on port 80rootless low-port restrictionpublish a higher port, or change the threshold deliberately
26outbound traffic is slowthe rootless helper is slirp4netns on 4.xcheck podman info, and plan the move to Podman 5.x
27external names do not resolvehost DNS or VPN settingstest with nslookup in a container, then check the host resolver
28two stacks clash on a portthe same host port in two projectsgive each project its own port
29the application logs the wrong client addressthe helper translates addressesuse the proxy headers, and document the helper
30containers in a pod cannot reach each other by namecontainers in a pod share localhostuse 127.0.0.1

Storage, logs and registries

#SymptomLikely causeFix
31permission denied on a bind mountthe ID mapping, or an SELinux labelcheck uid_map, then keep-id or unshare chown, and :Z on a dedicated folder
32data missing after a prunean unused volume was removedrestore from the last export, and record an owner for every volume
33read-only file systema :ro mount or --read-only on a written pathgive that path a volume or --tmpfs
34SELinux denial on a mountthe folder has the wrong label:Z on a dedicated folder, never on a system path
35volume import failsthe target volume does not existcreate the target volume first
36push returns unauthorizednot logged in, or the token lacks write permissionlog in with a token that has write permission
37push fails with a certificate errorthe registry certificate is not trustedinstall the registry's CA on the host, as the registry documents
38pull is rate limitedanonymous pulls from a public registrylog in, or use a mirror you control
39a deployed version changed without a releasethe tag moveddeploy by digest
40a CI job fails on a short namethe job depends on the registry configurationwrite full names in every script

Security and operations

#SymptomLikely causeFix
41rootless fails with newuidmapno subordinate range, or uidmap missingadd the range, install uidmap, run podman system migrate
42a container can change host filesthe mount is wider than the service needsmount the narrower path, read-only where possible
43a password appears in inspectthe password was passed as an environment variablemove it to a secret
44an audit finds a privileged container--privileged used for a quick fixremove it, and add only the capability the service needs
45a scan finds vulnerable packagesan old base imagerebuild on an updated base, and pin the new digest
46auto-update broke the servicea new build with a regressionroll back to the digest of the last good build
47services stop after logoutlingering not enabledloginctl enable-linger for the service user
48web.service not foundthe Quadlet file was added but not loadedsystemctl --user daemon-reload
49behaviour changed after an upgradea default changed between Podman versionsread the release notes, and test on a lab host first
50all containers and images disappearedpodman system reset was run by mistakerestore from exports and image copies, and limit who can run it

Fifty interview questions

Hour 8 · 44–60 · 16 min

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.

Final quiz

Hour 8

Sources and version notes