-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
virtiofs breaks initial startup of Postgres container #6270
Comments
Just realized that 4.7.0 was realized yesterday. I have updated Docker desktop and confirm that this issue persists. |
I've confirmed that enabling VirtioFS is what causes the error here. The Big Sur virtualization framework on its own is not enough to cause the failure. |
Can confirm. But this staging release mentioned here seems to fix it: docker/roadmap#7 (comment) |
I also have this problem and latest build does not seem to fix this. |
This can be fixed by PGDATA env variable mentioned on: Also I was mounting
|
Hi, Does someone obtain this behavior? Thanks |
I had the same issue. @OgulcanCelik's suggestion did the trick. In my case I changed
to
and it started working. |
I had the same problem with Docker Desktop for Mac 4.7.0 and the postgres:11.7 container:
It seems that VirtioFS has a bug with some filesystem operations in the initialization script of Postgres. |
The same on Docker Desktop for Mac 4.7.1 with postgres:14-alpine |
I have the same issue with Docker Desktop for Mac 4.7.1 with postgres:11-alpine =S |
Still having this issue with Docker Desktop for Mac 4.8.0, MacOS 12.3.1 (M1), postgres 13.6-bullseye image when initialising a new database. The db section of my compose file includes:
Tried various permutations on the (sub)directories with same result. |
Same on Docker Desktop for Mac 4.8.1 😞 |
MacOS 12.4 resolves this for me - although VirtioFS seems to be killing my inter-container communications afterwards, so it is still a no-go. |
MacOS 12.4 Starting a Postgres with an empty data folder: |
If you're still facing this issue, I recommend you to upgrade your macOS to 12.4 release. Tried it with Docker Desktop for Mac 4.8.2 and VirtioFS enabled, it worked for me. |
With macOS 12.4 and Docker Desktop 4.8.2 I am no longer able to reproduce this error using the steps in my original post. Edit: See #6270 (comment), this isn't fully resolved for me |
Update - I have an M1 Mac Mini and an M1 MBP configure identically - MacOS 12.4, Docker 4.8.2. With VirtioFS enabled, I experience the following:
I have tried mapping the |
@tunecrew thanks for mentioning that, I'm seeing the same behavior actually. Starting with the initial empty data dir works, but subsequent launches work only intermittently. |
Not fixed by Docker 4.9
|
MacOs 12.4, Docker 4.9.0 |
MacOs 12.4, Docker 4.10.1 |
Same thing with mongodb container |
Still same issue on MacOS 12.4, Docker 4.11.1 |
Hi folks, You can do the following to switch:
|
This is just a workaround, not a actual fix of the problem. |
MacOS 12.5.1 (M1), Docker Desktop 4.11.1. Still facing the same issue. |
MacOS 12.5.1 (M1), Docker Desktop 4.12.0. Not fixed. |
MacOS 12.5.1 (Intel), Docker Desktop 4.12.0. Not fixed. |
Kind of working, but only because I have fails several times during startup, then eventually works: (MacOS 12.5.1 (Intel), Docker Desktop 4.13.1)
|
MacOS 13.0.1 (M1), Docker Desktop 4.13.1. Not fixed. EDIT:
|
I still have the issue using Docker Desktop 4.14.1 on macOS 12.6.1 on M1 when running the container as the default user:
gives
Specifying Running the container again with an existing data directory worked most of the time. YMMV :-/ |
Now it works for me on Docker 4.15, macOS 12.16.1 🎉
|
It has been fixed in the new Docker version - 4.15.0! Thank you :) |
so far so good - starts first time every time 4.15.0 for me. |
The problem is still present on :
|
I am on that version and it is still working for me so far. Is it definitely not the |
Just upgraded to 4.17.0 (99724) Still working first time for me...
|
I just updated to 4.17.0 and now it's Not working. I don't remember what I was on before, but it was working. I think 4.17 worked randomly once or twice. If I switch to gRPC FUSE, it works. I'm on Intel BTW |
M1, v4.19.0, VirtioFS
|
I have the same issue on v4.21.1 / VirtioFS. Switching back to gRPC FUSE fixed it for me. Not a solution, but maybe a workaround for some until it is fixed. Apple Silicon, 13.2 |
M1 Apple chip 4.11.0 + VFS: Affected consistently ❌ Will edit if this proves incorrect over time in my case |
Just faced this issue with 4.23.0 version on Mac M1. Switching back to gRPC FUSE fixed the problem. |
Still a problem with 4.24.2 (124339) on Mac M1, using gRPC on this version fixed the prostgresql startup issue. |
Facing this issue with Docker v4.26.1 @ Apple M2 / Sonoma 14.2.1 with VirtioFS enabled. Switching to gRPC FUSE works for me. |
changing the mount point "/var/lib/postgresql/data" to "/var/lib/postgresql" fixed for me. Docker image Version 15.2 |
Thank you very much, it solved my problem. |
Edit: Our problem is a bit different. Created a new issue: #7415 My team is still having this problem. We're on MacOS 14.6.1 using Docker Desktop 4.34.0 and we're using the image postgres:16.4-bookworm. We mount an empty directory onto I've added the following logs to the container entrypoint at startup (using
So the server is being started by the user who owns the data directory. And yet when the database starts, it immediately crashes:
Changing the file sharing implementation in Docker Desktop from |
Expected behavior
Enabling VirtioFS and Big Sur Virtualization framework does not cause changes in container behavior outside of speed.
Actual behavior
Program in container fails to start successfully when it depends on files mounted in shared volume. PostgreSQL complains
LOG: could not open file "pg_wal/000000010000000000000001": No such file or directory
andFATAL: could not open file "pg_wal/000000010000000000000001": No such file or directory
. Disabling virtiofs and experimental virtualization framework allows the container to start without issue.Information
This may be a duplicate of #6219 or #6243, but I am not sure. I am trying to run a Postgres container using
docker-compose up Postgres
, with this docker-compose file. This service is set to mount postgresql's data to the host's./data/postgres
directory, enabling data persistence. When I run the container in a fresh directory without virtiofs and new virtualization framework, it starts just fine. However, if I try to start it from scratch with virtiofs enabled, it fails to start with the message above. I assume virtiofs is interfering with how long it takes for items to show up and be accessible once created. Please let me know if there is any additional information I can provide.Output of
/Applications/Docker.app/Contents/MacOS/com.docker.diagnose check
Steps to reproduce the behavior
wget curl https://gist.githubusercontent.com/TylerADavis/d1fb104553740bd6b48ea2bdadd6a59d/raw/adcf9d667d5a0c9a51a243be609644d46007a546/docker-compose.yml > docker-compose.yml
docker-compose up postgres
runs without issueThe text was updated successfully, but these errors were encountered: