Skip to content
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

Volume get detached after error with osxfs notifications #2777

Open
waj opened this issue Apr 6, 2018 · 25 comments
Open

Volume get detached after error with osxfs notifications #2777

waj opened this issue Apr 6, 2018 · 25 comments

Comments

@waj
Copy link

waj commented Apr 6, 2018

I was having an issue with an Elixir/Phoenix project and after some time debugging and reducing the problem I finally got something minimal that can be easily reproduced.

This started to happen after I upgraded to Docker for Mac Version 18.03.0-ce-mac60 (23751).
Diagnostics ID: CF39864B-6DD4-477F-99A6-6455DC6EC617

The problem is that sometimes a Docker volume gets detached. Here's an example to reproduce the issue:

docker-compose.yml:

version: '2'
volumes:
  vol:

services:
  app:
    build: .
    working_dir: /app
    volumes:
      - './:/app'
      - 'vol:/app/vol'

Dockerfile:

FROM debian:jessie

RUN \
  apt-get update && \
  DEBIAN_FRONTEND=noninteractive apt-get install -y inotify-tools && \
  apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

First, I start the container and confirm that the volume is mounted:

$ docker-compose run --rm app bash
root@d1bad28a1d5a:/app# mount | grep vol
/dev/sda1 on /app/vol type ext4 (rw,relatime,stripe=1024,data=ordered)

Now I start inotifywait to listen to some events on the /app directory (mounted from host)

root@d1bad28a1d5a:/app# inotifywait -m -r .
Setting up watches.  Beware: since -r was given, this may take a while!
Watches established.

On another terminal, in the host I run this command to rapidly create and delete files:

$ while true; do touch foo; rm foo; done

In the container I can see the notifications flooding the screen:

./ DELETE foo
./ CREATE foo
./ CREATE foo
./ DELETE foo
...

However at the same time, I can see in the Console.app logs coming from the com.docker.osxfs process complaining about missed files:

transfused: Event unlink /Users/waj/docker-foo/foo error: No such file or directory

Once that happen (very quickly indeed), in the container I cancel the inotifywait session and verify that the volume is not mounted anymore:

root@d1bad28a1d5a:/app# mount | grep vol
root@d1bad28a1d5a:/app#
@rchomat
Copy link

rchomat commented Apr 13, 2018

#2019 may be linked to this one ?

@artyfarty
Copy link

Volumes that suddenly dismount or stop updating correctly is a common problem for me and my coworkers. No idea how to fix this for now. docker-sync is nice but has its own stability issues

@artyfarty
Copy link

By the way. Why mount shows

osxfs on /***** type fuse.osxfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,max_read=1048576)

Why max_read=1048576? Isn't it a problem?

max_read=N
With this option the maximum size of read operations can be set. The default is infinite. Note that the size of read requests is limited anyway to 32 pages (which is 128kbyte on i386).

WHY

@waj
Copy link
Author

waj commented Apr 27, 2018

I can confirm this is still happening with Docker for Mac Version 18.03.1-ce-mac64 (24245)

@paschdan
Copy link

paschdan commented Jun 6, 2018

I can confirm this happens on Version 18.05.0-ce-mac66 (24545)

@docker-robott
Copy link
Collaborator

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@artyfarty
Copy link

artyfarty commented Sep 4, 2018

The problem persists. /remove-lifecycle stale

@paschdan
Copy link

paschdan commented Sep 5, 2018

/remove-lifecycle stale

@docker-robott
Copy link
Collaborator

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@artyfarty
Copy link

/remove-lifecycle stale

@waj
Copy link
Author

waj commented Jan 31, 2019

I just tested this on Docker for Mac Version 2.0.0.2 (30215), and still happening. This is really annoying. Is there any way I can contribute to fix this issue? I'm pretty sure it's something related with osxfs and the forwarding of inotify events. Is that code open source?

@docker-robott
Copy link
Collaborator

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@nguyenvietyen
Copy link

nguyenvietyen commented May 1, 2019

/remove-lifecycle stale

1 similar comment
@waj
Copy link
Author

waj commented Jun 21, 2019

/remove-lifecycle stale

@waj
Copy link
Author

waj commented Aug 8, 2019

Just upgraded to Docker Desktop 2.1.0.1 (37199) and still the same problem.

@macrael
Copy link

macrael commented Oct 13, 2019

I think I may be having the same problem.

 --mount type=volume,source=code-node,destination=/code/node_modules/ \
 --mount type=bind,source="$(pwd)",destination=/code \

I can reliably make the node_modules volume get unmounted simply by running touch node_modules on the host.

This seems wrong!

@docker-robott
Copy link
Collaborator

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@artyfarty
Copy link

artyfarty commented Jan 11, 2020

/remove-lifecycle stale
Thou shalth not silence Us, Machine.

@docker-robott
Copy link
Collaborator

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@waj
Copy link
Author

waj commented Apr 16, 2020

/remove-lifecycle stale

@waj
Copy link
Author

waj commented Apr 16, 2020

Still happening with Docker for Mac 2.2.0.5
2 years now with this really annoying bug reported multiple times: #3479, #3976, #2019, moby/moby#40109

@kurko
Copy link

kurko commented Jun 16, 2020

2.3.0.3 as well.

@docker-robott
Copy link
Collaborator

Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@artyfarty
Copy link

/remove-lifecycle stale
/lifecycle frozen

At least this issue is stable in this endless cycle of being marked as stale shortly after somebody tells that it still exists.

@daveisfera
Copy link

I just tried this with 2.3.6.1 and could not reproduce the issue so I believe that the issues with event notifications have been fixed in the edge build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants