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

mount failed: mkdir: cannot create directory '/mnt/data': File exists #4239

Closed
dionizh opened this issue May 10, 2019 · 11 comments
Closed

mount failed: mkdir: cannot create directory '/mnt/data': File exists #4239

dionizh opened this issue May 10, 2019 · 11 comments
Labels
area/mount help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence. r/2019q2 Issue was last reviewed 2019q2

Comments

@dionizh
Copy link

dionizh commented May 10, 2019

When stopping a minikube mount process with ctrl+C, then try to remount the same disk again, minikube crashed with the following message:

Mounting host path /mnt/scratch/dzhong/redis into VM as /mnt/data ...
o Mount options:
- Type: 9p
- UID: docker
- GID: docker
- Version: 9p2000.L
- MSize: 262144
- Mode: 755 (-rwxr-xr-x)
- Options: map[]
@ Userspace file server: ufs starting

! mount failed: mkdir: cannot create directory '/mnt/data': File exists
: Process exited with status 1

  • Sorry that minikube crashed. If this was unexpected, we would love to hear from you:

Mount command run is a simple:
minikube mount /mnt/scratch/dzhong/redis:/mnt/data

I have to stop minikube, and start it again, for the mount to work.

Running the latest version of minikube and kubectl on centos7.

thanks
dioni

@RA489
Copy link

RA489 commented May 14, 2019

@dionizh can you paste exact command line used?

@dionizh
Copy link
Author

dionizh commented May 15, 2019

Hi I have given the command line above:
minikube mount /mnt/scratch/dzhong/redis:/mnt/data

@tstromberg tstromberg changed the title minikube unmount process is not clean mount failed: mkdir: cannot create directory '/mnt/data': File exists May 16, 2019
@tstromberg tstromberg added area/mount kind/bug Categorizes issue or PR as related to a bug. labels May 16, 2019
@tstromberg
Copy link
Contributor

tstromberg commented May 16, 2019

What version of minikube is this with?

I feel like v1.0.1 should handle this properly by using mkdir -p, but perhaps it isn't in this case. If you run into this, do you mind sharing the output of:

minikube ssh ls -lad /mnt/data
minikube ssh df -k /mnt/data

@tstromberg tstromberg added the triage/needs-information Indicates an issue needs more information in order to work on it. label May 16, 2019
@dionizh
Copy link
Author

dionizh commented May 17, 2019

It is minikube v1.0.1.
Going to check the output of those when I run into the issue again.

@tstromberg
Copy link
Contributor

I can confirm that this happens in v1.1 if a process is still using the old mountpoint. We should output a clearer error when this occurs.

To reproduce:

  • Run minikube mount
  • In a minikube ssh session, cd to the mount directory.
  • Hit Ctrl-C on the minikube mount process
  • Re-run minikube mount and watch it fail.

@tstromberg tstromberg added priority/backlog Higher priority than priority/awaiting-more-evidence. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. r/2019q2 Issue was last reviewed 2019q2 and removed triage/needs-information Indicates an issue needs more information in order to work on it. labels May 23, 2019
@dionizh
Copy link
Author

dionizh commented May 24, 2019

Thank you. That does sound like what I did.

@fenglixa
Copy link
Contributor

I reproduced this issue, and I would like to provide a PR to fix this issue.
Append my investigation & solution here:

  1. "|| true" is in the umount command. It will lead to "force Unmount" will be never called, should be code error.
  2. Current "force Unmount" cannot work if mount point is busy.

After address 1, the message will be more clearer to point the mount point is busy.
Error will be gone for this case if 2 is addressed.

@tstromberg any comments? Thanks a lot!

BR
-Francis

@tstromberg
Copy link
Contributor

tstromberg commented May 31, 2019 via email

@fenglixa
Copy link
Contributor

fenglixa commented Jun 3, 2019

Thanks @tstromberg PR #4393 wish you could help review, any comments are welcome.

@fenglixa
Copy link
Contributor

This issue could be closed by fixes #4393
/close

@k8s-ci-robot
Copy link
Contributor

@fenglixa: Closing this issue.

In response to this:

This issue could be closed by fixes #4393
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mount help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence. r/2019q2 Issue was last reviewed 2019q2
Projects
None yet
Development

No branches or pull requests

5 participants