I was trying to install Photon by pulling the docker image. But when I run docker build -t photon . I am getting the below error.

 ---> Running in 3076fb42ef8b
ERROR: Unable to read database state: No such file or directory
ERROR: Failed to open apk database: No such file or directory
The command '/bin/sh -c apk add git && git clone https://github.com/s0md3v/Photon.git Photon' returned a non-zero code: 99

I observed the same error before when I tried to install some other application. So, I am guessing this is not something specific to Photon. What is causing this error? How to fix this?

  • Did you create an issue on their GitHub?
    – 030
    Nov 27 '19 at 18:18

Please try splitting this line:

RUN apk add git && git clone https://github.com/s0md3v/Photon.git Photon

into two:

RUN apk add git

RUN git clone https://github.com/s0md3v/Photon.git Photon

This will tell you exactly which piece of the command fails. If it is the apk add git part maybe try this: RUN apk update && apk add git.

Also you may fixing to a specific tag in the FROM python:3-alpine as 3-alpine follows the latest alpine release which may have some unknown/unfixed issues.

See https://hub.docker.com/_/python/ for available tags.


It may help to try it on another computer or inside a VM to isolate the cause.

I ran into the same issue on one computer (stable Manjaro with snap docker). Interestingly, I was able to build the same Dockerfile without issues on another computer (running KDE Neon with snap docker). I'm not sure what the actual cause of the issue is, but it seems, in my case, to be a problem with docker itself and not the Dockerfile.

FROM redis:5.0.9-alpine

LABEL version="1.0.4"

    REDIS_MASTER_NAME=redismaster \
    REDIS_MASTER=redis-zero \

RUN apk --no-cache add drill
ERROR: Unable to read database state: No such file or directory
ERROR: Failed to open apk database: No such file or directory
The command '/bin/sh -c apk --no-cache add drill' returned a non-zero code: 99

We had a similar case, where an image doesn't build and had been raising the issue above (while it worked on other machines) we had put a lot of time and efforts to upgrade Docker (on Ubuntu 18.04), clean up all images, volumes ...try many staff to debug, but as crazy as it sounds, after just explicitly restarting the docker service, it has resolved itself. (I wouldn't be able to explain what happened exactly)

So always first try the old "have you(I) turned it on and off again (explicitly)"!

btw before purging images.., at the all beginning have had a different message (it was complaining about access to some Python packages permission).


I was getting this error in the Docker installation that installed using "snap" in Ubuntu 18.04. My problem was resolved when I uninstalled Docker and installed it as in their official documentation.

To uninstall Docker (snap): https://askubuntu.com/a/1155962/1063090
Docker official installation: https://docs.docker.com/engine/install/ubuntu/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.