-
Notifications
You must be signed in to change notification settings - Fork 117
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
getcwd error on volume mount #1509
Comments
@ccakes thanks for the detailed report, we're looking on our end if we could reproduce your issue and let you know here. |
I'm also seeing this issue on Seems transient. I've only recently started using Docker for Mac, so I don't know if downgrading would help (though it seems that is rather difficult: #1120) |
I and several of my coworkers have been hitting this pretty often on 17.06.0-ce-mac18 (and the previous version). In our case, calls to Python's |
FYI, this is still happening in:
|
I can still reproduce that on my Mac, any updates? |
@3axap4eHko do you have a reliable way to reproduce it? I've tried the edX repro steps and couldn't get it to happen. |
@dsheets I'm just build my container and run it by docker-compose and it's appear randomly after each rebuild.
but after rebuild without any changes it works
UPD: Just figured out it can start work even after restart containers |
I've stopped seeing this issue since I started mounting volumes with |
@3axap4eHko could you share your reproduction case? It's very hard to track this down without a reliable way to reproduce it locally. |
It's occurred to me that you may be seeing this behavior if you (or software you run) removes the working directory of the shell. Even recreating the directory will not allow the shell to recover and so may cause this strange situation where the It would still be fantastic to have a consistent reproduction for the issue as it may not be due to the above root cause. If you're interested in debugging it in situ, I recommend looking for places where directory removal or recursive removal occurs. I can imagine scenarios like |
Related to issue #2019 |
Issue appearing also in:
The actual errors printed are:
After Cached volume mount didn't fix the issue. I am now in the process of testing the Update: |
I've been having the same issue all the time, tried with |
I can confirm that |
I'm also seeing this issue, fwiw |
I also have this issue on my Mac, quitting and restarting docker fixes it for me temporarily. I am running multiple containers, and when it occurs in any container, there is a a chance where next command i execute in any other container throws the same error:
Docker Community Edition |
Had the same issue with redis container, restart the container solved the problem. Docker version 17.09.0-ce, build afdb6d4 |
I'm having this issue with Version 17.12.0-ce-mac47 (21805). |
via |
Ditto, getting the same issue here as well @ Version 17.09.0-ce-mac35. Can confirm that restarting the container helps, but is cumbersome. |
My issue turned out to be that I was using docker-compose with multiple project names and then when I stopped specifying the project name and used the defaults, it looked like it was using the wrong image and the permission checks got screwed up in the volumes. I deleted all images and rebuilt and it worked. I assume that once you start using the COMPOSE_PROJECT_NAME environment variable you have to keep using it or you would run into this issue. |
I was facing the same issue and could fix it for now. Setup 1. Stage build FROM ruby:2.4.1-slim AS build-bundle
...
# Copy the Gemfile as well as the Gemfile.lock and install the RubyGems.
COPY Gemfile Gemfile.lock ./
RUN bundle install -j $(nproc) --retry 3 --without production 2. Stage copy it from stage 1 FROM ruby:2.4.1-slim
...
COPY --from=build-bundle /usr/local/bundle /usr/local/bundle In my
It runs perfect, until I change my
Will result in error message: app | Could not find multipart-post-2.1.1 in any of the sources
app | Run `bundle install` to install missing gems.
app | Could not find multipart-post-2.1.1 in any of the sources
app | Run `bundle install` to install missing gems.
app exited with code 7 I try to start again...
... and now I get different error message: app | /usr/local/bundle/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor.rb:486:in `class_eval': No such file or directory - getcwd (Errno::ENOENT)
... How to fix:
It works for me with:
|
I was trying to work around a failure with a message about Node/Express/body-parser that seems to actually have been environmental. Docker seems to occasionally lose rights over a directory/file (docker/for-mac#1509) on Mac.
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an 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. |
/remove-lifecycle stale |
We have a resource-intensive project (Open edX Platform) with a docker-based devstack with multiple containers and volumes reuse between containers. This The only workaround that we found is to use NFS with Docker on Mac: https://github.com/edx/devstack/pull/465 |
Hopefully this experience can add a bit more color to the issue as I am having a related problem, if not the same one. A coworker recently added the :delegated to a volume mount on a build script for a project we are working on... this definitely triggered the inconsistency issue for me. Sometimes the whole build pipe'd work fine, sometimes it'd fail on the last step. 50,000 ft view, the process looks like those work fine, or seem to as far as I can tell. And they definitely work faster, as expected, with :delegated applied. But the last step in the pipeline, which is essentially a $ docker build . which has a Dockerfile in (code_root) that takes those two container-built ELF binaries deposited into the mac filesystem by the previous build steps using the -v mount and packages them up into a final container for deployment. It's that last step fails to work consistently with :delegated used in the first 2 steps. Sometimes it will, most times it won't. When it works, you see the whole docker-uploading-build-context and it works fine. When it fails, it gives the getcwd: can't find . thing and dies immediately. If I remove the delegated semantics and go with default, it's slower, as expected, but works consistently each time. It really feels like some sort of race condition is happening with the shared volume support where somehow the writeback from the first 2 containers is somehow confusing the last step. I tried, on a lark, adding a sync call to the end of each of the first 2 build containers just to see if perhaps forcing the writeback sooner would fix it, but it didn't. Not sure if this is helpful or not, but at least it is reproducible. |
I am also seeing the |
I'm seeing this with the jekyll-plantuml image on macOS 10.14.6, Docker version 19.03.8, build afacb8b. In the container, |
Very interesting point! But having |
@asbjornu, @OmarIthawi : I just got done debugging this issue in our Docker container, and sure enough, our WORKDIR in our Dockerfile was set to the same folder (in the container) that is later used as a volume mount folder in So, @asbjornu : You were exactly right. This pattern appears to be error-prone: Dockerfile: Docker-compose:
Incidentally, I was lucky enough to get a 100% repro to make it easy to test. I could
Furthermore, from then on, subsequent calls to
That would eventually get me a bash prompt, but from that prompt, calls to At this point, we're well over my head as far as Linux and Docker are concerned, but I sure hope this is fixable given how convenient and common it is. |
@jeanlaurent : I wanted to give you a direct ping to let you know that I have a 100% repro, as described above, and I hope it will be helpful in tracking this down! |
I came across this problem and was able to run - getcwd("/data", 4096) = 6
+ getcwd(0x1ba4590, 4096) = -1 ENOENT (No such file or directory) No idea if that is helpful.
|
This is biting us again on a frequent basis. Our developers have to restart our Docker containers frequently due to this bug. I'm going to experiment with removing |
I've just upgraded my machine to Dropbox Edge (version 2.3.4.0 (46980) at the time of this post) which uses Mutagen to do syncing for |
Still seeing the CWD error resolved with Mutagen @Taytay ? |
Mutagen was removed from Docker Edge in 2.3.5.0. |
I am still seeing this error after removing |
I got to the bottom of the problems I was experiencing. I removed one of the volume mounts and the behavior stopped. |
Issues go stale after 90 days of inactivity. Prevent issues from auto-closing with an 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. |
Fix bundler issue in build, and getcwd error due to volumes (similar to docker/for-mac#1509)
Closed issues are locked after 30 days of inactivity. 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. |
Expected behavior
Able to mount local directories (specifically, pwd) to containers and use them without issue
Actual behavior
Occasionally the container seems to lose access to the mountpoint. The shell doesn't have timestamps but this log is over a period of ~2mins
For reference, the Dockerfile used to create the perl-dev container is as follows
Information
Forum thread for reference
Steps to reproduce the behavior
I haven't been able to reliably reproduce this but it happens often enough that it's frustrating. I'll keep poking it at my end and see if I can make it reliably break but for me just by creating a new container and working for a while. As with the example, even sitting at the shell will eventually trigger it.
The text was updated successfully, but these errors were encountered: