for-mac icon indicating copy to clipboard operation
for-mac copied to clipboard

Docker Desktop 3.0.2 fails to mount volumes with (overlapping?) mounts, breaks ddev

Open rfay opened this issue 5 years ago • 19 comments

  • [x] I have tried with the latest version of my channel (Stable or Edge)
  • [x] I have uploaded Diagnostics
  • Diagnostics ID: 4878CE31-EDDB-4988-A949-52FEC38CFC79/20201219035944

Expected behavior

For years prior to Docker Desktop for Mac 3.0.2, the following docker-compose worked fine (and I reinstalled Docker Desktop 3.0.1 to test it). (This is a stripped-down version of what ddev uses as its basic functionality.)

version: '3.6'
services:
  db:
    image: drud/ddev-dbserver-mariadb-10.5:v1.16.0
    volumes:
    - source: ~/tmp/junk/base
      target: /mnt/ddev_config
      type: bind
  web:
    image: drud/ddev-webserver:v1.16.3
    links:
    - db:db
    volumes:
    - consistency: cached
      source: ~/tmp/junk
      target: /var/www/html
      type: bind
    - ~/tmp/junk/base/nginx_full:/etc/nginx/sites-enabled:ro

Actual behavior

Now, in Docker Desktop 3.0.2 for Mac:

$ docker-compose -f test4-compose.yaml up
Creating ddev_db_1 ... done
Creating ddev_web_1 ... error

ERROR: for ddev_web_1  Cannot start service web: error while creating mount source path '/host_mnt/Users/rfay/tmp/junk/base/nginx_full': mkdir /host_mnt/Users/rfay/tmp/junk/base/nginx_full: no such file or directory

ERROR: for web  Cannot start service web: error while creating mount source path '/host_mnt/Users/rfay/tmp/junk/base/nginx_full': mkdir /host_mnt/Users/rfay/tmp/junk/base/nginx_full: no such file or directory
ERROR: Encountered errors while bringing up the project.

Information

  • macOS Version: Big Sur 11.1 (amd64)

Diagnostic logs

Docker for Mac: version: 3.0.2

Steps to reproduce the behavior

  1. Use the above docker-compose.yaml, call it test4-compose.yaml
  2. mkdir -p ~/tmp/junk/base/nginx_full
  3. docker-compose -f test4-compose.yaml up

I am able to try a number of things that will make the docker-compose up start to work (but of course break the underlying functionality:

  • I can remove the links: db:db stanza in the web service.
  • I can remove the single volume mount in the db service.
  • I can remove the /var/www/html volume mount in the web service
  • I can turn off the "experimental" gRPC Fuse feature and it works fine.

My assumption is that the failure has to do with overlapping volume mounts.

Since the docker-compose in both Docker Desktop for Mac 3.0.1 and 3.0.2 is the same, "docker-compose version 1.27.4, build 40524192", I have to assume this is a Docker for Mac issue, not a docker-compose issue.

In addition to launching fine on Docker Desktop for Mac 3.0.1 and all previous versions, this works fine in Docker Desktop for Windows 3.0.0 (which has the same docker-compose version) on both the Windows side and the WSL2 side (with a WSL2 back-end).

rfay avatar Dec 19 '20 03:12 rfay

Thanks @rfay I will fix it on monday and do another release!

ebriney avatar Dec 19 '20 10:12 ebriney

Just to confirm I am experiencing a very similar issue which I suspect is related to the root cause for this one. For ages the following docker-compose.yml has worked for us no issues at all, but since 3.0.2 update, the subdirectory in the php container which shares the mount point with the node container is EMPTY from the perspective of the php container!

Our docker-compose.yml file (for reference only, some information redacted)

version: '3.2'

services:
  php:
    image: xxxxx/wordpress:7.3-apache
    ports:
      - "8083:80"
    links:
      - db
    volumes:
      - .:/var/www:delegated
    networks:
      - custom
  db:
    image: mysql:5.7.23
    restart: always
    volumes:
      - ./docker/mysql/initdb.d:/docker-entrypoint-initdb.d:delegated
    environment:
      - MYSQL_DATABASE=xxxxxx
      - MYSQL_USER=xxxxxx
      - MYSQL_PASSWORD=xxxxxx
      - MYSQL_RANDOM_ROOT_PASSWORD=1
    ports:
      - "3309:3306"
    networks:
      - custom
    env_file:
      - ./.env
  node:
    image: "node:14.8.0"
    user: "node"
    working_dir: /app
    environment:
      - NODE_ENV=development
    volumes:
      - ./web/app/themes/affected-directory/:/app
    expose:
      - "8081"
    command: tail -F /dev/null
networks:
  custom:
    driver: bridge
#volumes:
#  data:

For those who are curios, this is a WordPress Bedrock project. Long story short we use the php/db containers like you might expect, plus the additional node container is for consistent local builds without having to rely on nvm locally etc.

So, what is expected (and has worked for all Docker versions 3.0.1 or earlier):

The local directory (our theme) in /web/app/themes/affected-directory should be accessible under /var/www/web/app/themes/affected-directory in the php container and /app in the node container.

This has been the case and has worked perfectly for as long as I can remember.

With Docker Desktop for Mac 3.0.2 the theme directory in the php container is empty - almost as if there is some kind of conflict with shared mount points.

teaforchris avatar Dec 20 '20 21:12 teaforchris

Same here with WireMock:

  recipe_service:
    command: --verbose
    image: rodolpheche/wiremock:2.18.0-alpine
    volumes:
    - ./wiremock:/home/wiremock/mappings

"data" is automatically mounted at "/home/wiremock/" and "mappings" is not mounted anymore. I downgraded to v2.5.0.1 in the meantime.

olvlvl avatar Dec 21 '20 10:12 olvlvl

Handy now Docker auto updates to new releases that break... I downgraded as well to get it working again.

roahes89 avatar Dec 21 '20 11:12 roahes89

Hi. Can someone confirm this build is solving the issue so I can do a release: https://desktop-stage.docker.com/mac/stable/51017/Docker.dmg I tested it with ddev WordPress quickstart and it failed with 3.0.2 but not with this build.

ebriney avatar Dec 21 '20 12:12 ebriney

@jfernandezr even with https://desktop-stage.docker.com/mac/stable/51017/Docker.dmg ?

ebriney avatar Dec 21 '20 13:12 ebriney

Sorry @ebriney , I reported that I was having the same issue but as I did not want to just say that and not cooperate, I deleted my previous message. I'm in the middle of a project release and I will downgrade to 3.0.1 (I want to have some nice and calm xmas). When my project is released correctly, I can test the 51017 build.

Thanks!!

jfernandezr avatar Dec 21 '20 13:12 jfernandezr

No problem @jfernandezr, you can just disable grpcfuse in settings->experimental, it should work even with 3.0.2

ebriney avatar Dec 21 '20 14:12 ebriney

Hi. Can someone confirm this build is solving the issue so I can do a release: https://desktop-stage.docker.com/mac/stable/51017/Docker.dmg I tested it with ddev WordPress quickstart and it failed with 3.0.2 but not with this build.

Verified working for me. 👍🏼

markkrijgsman avatar Dec 21 '20 14:12 markkrijgsman

Hi. Can someone confirm this build is solving the issue so I can do a release: https://desktop-stage.docker.com/mac/stable/51017/Docker.dmg I tested it with ddev WordPress quickstart and it failed with 3.0.2 but not with this build.

Also works for me.

imago-storm avatar Dec 21 '20 14:12 imago-storm

@ebriney I did very modest testing with your proposed build 3.0.3 from https://desktop-stage.docker.com/mac/stable/51017/Docker.dmg (https://github.com/docker/for-mac/issues/5157#issuecomment-748952320) and it seems to work fine for me with ddev. Thanks so much.

rfay avatar Dec 21 '20 14:12 rfay

Just published, I prepare a PR to add ddev wordpress example in our CI. Do you think it is enough @rfay?

ebriney avatar Dec 21 '20 14:12 ebriney

Awesome, thanks @ebriney . You're saying you're adding ddev wordpress example to your tests? That is fantastic!

rfay avatar Dec 21 '20 15:12 rfay

Yes, I just wonder if wordpress example is ok to catch most of the breakages

ebriney avatar Dec 21 '20 15:12 ebriney

It certainly would catch this specific one, but it would take much more to catch various things that have happened over the years. But this is a great start.

rfay avatar Dec 21 '20 15:12 rfay

@ebriney testing the upgrade process. I see nothing about 3.0.3 in the release notes and the "Update and restart" doesn't tell me what I'm going to upgrade to.

But... the upgrade does upgrade to 3.0.3.

~~Unfortunately, I'm afraid you'll have to reopen this. It no longer fails mounting nginx_full... it just doesn't mount it any more. So if you run the test4-compose.yaml in the OP, and then exec into it, you'll find that the mount has not happened.~~

~~So this issue was not solved at all, although we all felt better when we were able to get the thing started. Sorry for the poor testing.~~

Although I was able to recreate the not-mounting-/etc/nginx/sites-enabled two different ways when I wrote this, I can't now. So I'm not sure what the difference is. 3.0.3 remains suspect for me, but I don't know now.

rfay avatar Dec 21 '20 23:12 rfay

It must be the same behavior as 3.0.1, I rolled back all patches. For the release notes the PR is open but I don't have rights to merge it and most people are in holidays this week.

ebriney avatar Dec 22 '20 09:12 ebriney

Sorry for the freakout then, I'll continue using 3.0.3 and see if I freak out again. I do know that when I went back and tested with the OP docker-compose recipe I did the wrong thing, because there was nothing in the sample directory for me to look for inside the container.

rfay avatar Dec 22 '20 14:12 rfay

Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

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

docker-robott avatar Jan 21 '21 03:01 docker-robott