DB container stuck in lockfile loop

Hi all,
This might be more of a docker question than a WebODM question.

We had an unplanned reboot (power went out), and I can’t get my WebODM DB container working. It seems to have a lockfile permission issue after the server came back up. We’ve got about a year and a half worth of data in the DB container, so resetting it is not an option. The log looks like this:

PostgreSQL Database directory appears to contain a database; Skipping initialization
FATAL:  could not create lock file "/tmp/.s.PGSQL.5432.lock": Permission denied

Any help would be appreciated. Thanks!

1 Like

I finally figured this out! Incase anyone else has similar problems:

This was the error I was getting from docker logs db:
FATAL: could not create lock file "/tmp/.s.PGSQL.5432.lock": Permission denied

Stuck in a loop, restarting every few seconds. Used the docker inspect command to look at the db container, this part is helpful:

"GraphDriver": {
            "Data": {
                "LowerDir": "/mounts/hamilton/docker-storage/overlay2/92e229a52a2c498a0a027d12192e7c640f2ca74321a38f8573e22a6889501d2f-init/diff:/mounts/hamilton/docker-storage/overlay2/61434afde3cf3be3fb9cb21b15f91e70090ce87abdc96f1b8ec4410f3ea4d563/diff:/mounts/hamilton/docker-storage/overlay2/71a09f95b989436e6f206714e8318b886245ca26e9d465295c4ae5af6ee19a99/diff:/mounts/hamilton/docker-storage/overlay2/86f5fa8f7c89e9108024f326bbf476ef8efcfe984372edf391a162c4bfa16fbe/diff:/mounts/hamilton/docker-storage/overlay2/f725ef45fa52a6434cd60e0ff50aef571537df736098db34744b8d7c94d916ac/diff:/mounts/hamilton/docker-storage/overlay2/b55acfa4adefbc16b73d389fbffb08ed38a308d495d6497167e4c608058d5f3d/diff:/mounts/hamilton/docker-storage/overlay2/ac2770db082b11eadd1da97bf26edcb23fcb1285d33e5b5bdf787f44c835e771/diff",
                "MergedDir": "/mounts/hamilton/docker-storage/overlay2/92e229a52a2c498a0a027d12192e7c640f2ca74321a38f8573e22a6889501d2f/merged",
                "UpperDir": "/mounts/hamilton/docker-storage/overlay2/92e229a52a2c498a0a027d12192e7c640f2ca74321a38f8573e22a6889501d2f/diff",
                "WorkDir": "/mounts/hamilton/docker-storage/overlay2/92e229a52a2c498a0a027d12192e7c640f2ca74321a38f8573e22a6889501d2f/work"
            },
            "Name": "overlay2"

Part of the “LowerDir” is where you can find the actual filesystem the container is using. This one was it for me:
/mounts/hamilton/docker-storage/overlay2/ac2770db082b11eadd1da97bf26edcb23fcb1285d33e5b5bdf787f44c835e771/diff
I have no idea if there is an order, or reasoning for the list of paths in Graphdriver/Data/LowerDir, but this one did it. Inside is a regular linux filesystem, including the /tmp folder, which I used chmod -R 777 tmp to make sure it would have permission to write its lock file. Container started up perfectly after this.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.