gael-ian / vagrant-bindfs

A Vagrant plugin to automate bindfs mount in the VM
MIT License
483 stars 37 forks source link

"The following bindfs command failed to run!" #69

Closed Vandaahl closed 7 years ago

Vandaahl commented 7 years ago

My host is Ubuntu 16.10 and my guest is Ubuntu 14.04 using Virtualbox. The bindfs plugin installed successfully on both the host and guest. I would like to use an NFS share and set the owner/group to a particular user, but I'm running into this error and I don't know how to debug it. Here's my Vagrant file:

http://pastebin.com/vFynQ8UR

If I remove the default_options and only use this, I still get the error:

config.vm.synced_folder "~/Documents/development/www", "/vagrant-nfs", type: :nfs config.bindfs.bind_folder "/vagrant-nfs", "/srv/users/serverpilot/apps/test/public"

Any hints would be most welcome.

gael-ian commented 7 years ago

Hello,

Can you add the full error message with the failing command ?

Thank you

Vandaahl commented 7 years ago

Absolutely, thanks for bothering:


==> default: Exporting NFS shared folders... ==> default: Preparing to edit /etc/exports. Administrator privileges will be required... [sudo] password for marc: ● nfs-server.service - NFS server and services Loaded: loaded (/lib/systemd/system/nfs-server.service; enabled; vendor preset: enabled) Active: active (exited) since ma 2017-02-20 19:37:09 CET; 5min ago Main PID: 1329 (code=exited, status=0/SUCCESS) Tasks: 0 (limit: 4915) CGroup: /system.slice/nfs-server.service

feb 20 19:37:09 marc systemd[1]: Starting NFS server and services... feb 20 19:37:09 marc systemd[1]: Started NFS server and services. ==> default: Mounting NFS shared folders... ==> default: Mounting shared folders... default: /vagrant => /home/marc/Documents/development/vagrant/serverpilot_trusty64 ==> default: Checking for bindfs in VM... default: Package manager detected: apt-get default: Fuse kernel module is installed default: Fuse kernel module is loaded default: Bindfs 1.12.3 is installed ==> default: Machine is ready to use bindfs! ==> default: Creating bind mounts after synced_folders... default: /vagrant-nfs => /srv/users/serverpilot/apps/test/public The following bindfs command failed to run!

`/usr/bin/bindfs --force-user=serverpilot --force-group=serverpilot --perms=u=rwX:g=rD:o=rD /vagrant-nfs /srv/users/serverpilot/apps/test/public`

Please check options values and compatibility. For a complete documentation, run sudo bindfs --help on the VM. You can see it online at http://bindfs.org/docs/bindfs.1.html

gael-ian commented 7 years ago

Hi @Vandaahl

I just pushed on rubygems.org a new release of vagrant-bindfs with a more verbose error message when a bindfs command fail.

You should be able to find where the problem comes from with the complete output (standard and error) of the command but, if not, feel free to reopen this issue and add your full Vagrantfile and the copy of a vagrant up output.

Thanks

Vandaahl commented 7 years ago

Thanks a bunch, now I get an actual error message :+1: Hope you don't mind me posting it here because maybe someone else will find it useful:

Error output: stdin: is not a tty fuse: mountpoint is not empty fuse: if you are sure this is safe, use the 'nonempty' mount option

My mount point "/srv/users/serverpilot/apps/test/public" had one file in it, "index.php". All I had to do was delete it and now the error is gone and the mounting works as I intended. Thank you!

gael-ian commented 7 years ago

Thanks for reporting your issue, now it will be easier for everyone to fix this kind of problems.

Happy hacking

voldedore commented 7 years ago

I'm current facing this issue too.

How can I use custom options? E.g.: -o nonempty

After ssh to the machine and manually run

sudo /usr/bin/bindfs --force-user=vagrant --force-group=vagrant --perms=u=rwx:g=r:o=r -o nonempty /var/tmp/www /home/vagrant/Code

All seems to work, but the vagrant up occurs error while the mount is not empty.

gael-ian commented 7 years ago

Hello,

Can you add the full error message and the part of your Vagrantfile with the bind_folder method calls ?

Thank you

voldedore commented 7 years ago

Hi, I did a vagrant destroy then vagrant up so the error was gone. I will feedback here once it occurs again. Thanks for replying.