error: no such object: fix12-dkrun-nothere from docker inspect
means the engine found nothing under the name or ID you gave. List what exists
(docker ps -a, docker images) and inspect the exact name it
prints.
In the test the name simply did not exist, and a made-up 12-character ID,
0123456789ab, gave the same message. Copy the name from the listing instead of
typing it from memory. A wrong --type is another way to get a "no such"
message, shown below.
The error
docker inspect fix12-dkrun-nothere
[]
error: no such object: fix12-dkrun-nothere
Two details stand out. The command still prints an empty JSON array [], and
the exit code is 1. Run again with the two streams sent to separate files, the
[] was on stdout and the message on stderr:
cmd /c "docker inspect fix12-dkrun-nothere 1>inspect-stdout.txt 2>inspect-stderr.txt"
type inspect-stdout.txt
[]
type inspect-stderr.txt
error: no such object: fix12-dkrun-nothere
So a script that reads stdout gets [], and one that reads the exit code gets 1.
The message is lower case and starts with error:, not with
Error response from daemon.
Why it happens
The typed forms give more specific messages, and a typed form does not find an object of another kind, even when the name exists:
docker image inspect fix12-dkrun-k
[]
Error response from daemon: No such image: fix12-dkrun-k:latest
docker container inspect alpine:latest
[]
Error response from daemon: No such container: alpine:latest
Here fix12-dkrun-k was a running container and alpine:latest a
cached image, yet each lookup of the other kind failed. docker inspect --type image
fix12-dkrun-alp, another running container, did the same and added the
:latest tag to the name.
The fix
docker ps -a --filter name=fix12-dkrun --format "{{.Names}} {{.Status}}"
fix12-dkrun-rs Up 6 seconds
fix12-dkrun-alp Up 1 second
docker inspect -f "{{.Name}}" fix12-dkrun-alp
/fix12-dkrun-alp
The listing gives the real names; inspecting one of them works, and -f
picks a single field instead of the full JSON. For images the listing is
docker images, for volumes docker volume ls and for networks
docker network ls (those three were not needed in this test).
How it was reproduced
Docker Desktop 4.99.0 on Windows 11, client and engine 29.9.3, the cached
alpine:latest image (Alpine 3.24.2). A PowerShell script ran each command
through cmd /c with stderr merged into stdout, so the commands are shown
without a prompt; the one run with separate files is shown as the cmd /c line
that ran. Runs: plain docker inspect on a missing name and a made-up ID, the
image, container and --type image forms on names of
the other kind, then -f on a real name. The names starting with
fix12-dkrun- are the test's own.
Frequently asked
- What does docker inspect error no such object mean?
- The engine found nothing under the name or ID you gave. In the test a missing name and a made-up ID both gave it. List what exists with docker ps -a or docker images and inspect a name copied from that list.
- Why does docker inspect print [] before the error?
- In the test the [] went to stdout and the error to stderr, and the exit code was 1, so a script reading stdout gets an empty array.
- What is the difference between docker inspect and docker container inspect?
- In the test docker container inspect alpine:latest said No such container although the image exists, and docker image inspect on a running container said No such image. Plain docker inspect said no such object for a name that did not exist.
More decoded errors in the Fixes category. For the image
message from docker save, tag and rmi, see
No
such image.