gael-ian / vagrant-bindfs

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

bindfs installing to the virtual machine breaks #87

Closed BoBRoID closed 5 years ago

BoBRoID commented 5 years ago

Hi all! Today I've reinstalled OS on my computer, and found that all my project which are using bindfs plugin won't able to work. I saw an error in my console:

The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed!

[ -f ./bindfs.tar.gz ] && rm ./bindfs.tar.gz

Stdout from the command:

Stderr from the command:

After hours of digging I realized that it might depends on plugin's version. I've downgraded it (from 1.1.1 to 1.1) and now all working correct. I guess it would be helpful, because I spend few hours to solve this error message.

gael-ian commented 5 years ago

Hi @BoBRoID

Can you please tell me:

This may help a lot to identify a bug and fix it.

Thanks

BoBRoID commented 5 years ago

Hi @gael-ian! My VM's provider is libvirt, and OS are centos/6 and centos/7. I'm not very good at vagrant configuration, so I took yii2 default configuration, and just put vagrant-bindfs to the required modules list:

required_plugins = %w( vagrant-hostmanager vagrant-vbguest vagrant-bindfs )

required_plugins.each do |plugin|
    exec "vagrant plugin install #{plugin}" unless Vagrant.has_plugin? plugin
end

I always uses:

cd /path/to/project sudo vagrant up --provider=libvirt

and machine started without any problems. But today I've got error message which is described in the first topic. After few hours I decided to install older bindfs version:

sudo vagrant plugin uninstall vagrant-bindfs sudo vagrant plugin install vagrant-bindfs --plugin-version=1.1

and then my machine started correctly, without any errors.

I hope this information was helpful.

gael-ian commented 5 years ago

Hi @BoBRoID

By default using CentOS, no packages repository containing bindfs is activated so it will always be installed from sources (See #83). Your problem was this installation failed because the install script could not download the correct tarball or build the sources it contains.

At some time between 1.12.0 and 1.13.0, the release tools used for bindfs has changed. Before 1.13.0, the tarball name will omit the patch release number if it was 0. Since 1.13.0, the full version number is always used.

I added a few method today to the plugin to ensure the proper tarball name will always be used to download bindfs sources and build them. This should fix your problem.

As there is no big differences between vagrant-bindfs 1.1.0 and 1.1.2, you can just use your installed plugin as is or you can upgrade to the latest version if you want.

Sorry for the inconvenience

mpartel commented 5 years ago

At some time between 1.12.0 and 1.13.0, the release tools used for bindfs has changed. Before 1.13.0, the tarball name will omit the patch release number if it was 0. Since 1.13.0, the full version number is always used.

Ah, that was just me the human being inconsistent. Sorry about that :)

gael-ian commented 5 years ago

@mpartel No worries, that was much easier to solve than a real problem ;)

BoBRoID commented 5 years ago

Thank you guys for this work! I updated the plugin, but unfortunately got the same error.

sudo vagrant plugin install vagrant-bindfs Installing the 'vagrant-bindfs' plugin. This can take a few minutes... Fetching: vagrant-bindfs-1.1.2.gem (100%) Installed the plugin 'vagrant-bindfs (1.1.2)'!

sudo vagrant up --provider=libvirt Bringing machine 'pricecomparer' up with 'libvirt' provider... ... ==> pricecomparer: -- Base box: centos/7 ... ==> pricecomparer: Bindfs seems to not be installed on the virtual machine, installing now The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed!

[ -f ./bindfs.tar.gz ] && rm ./bindfs.tar.gz

Stdout from the command:

Stderr from the command:

gael-ian commented 5 years ago

Hi @BoBRoID

Can you please copy your Vagranfile here?

gael-ian commented 5 years ago

@BoBRoID The incriminated command is nothing more than an end trap runed after the installation script to clean temporary files. I guess the real problem may hide behind.

I just released a new release, in which this command has been silenced even when it fails. Can you please update the plugin and launch vagrant up again?

Thanks

BoBRoID commented 5 years ago

Hi @BoBRoID

Can you please copy your Vagranfile here?

Hi @gael-ian!

I uploaded my config here: https://github.com/BoBRoID/my-vagrant-config

@BoBRoID The incriminated command is nothing more than an end trap runed after the installation script to clean temporary files. I guess the real problem may hide behind.

I just released a new release, in which this command has been silenced even when it fails. Can you please update the plugin and launch vagrant up again?

Thanks

Yeah, I've tried this at my laptop and I've got another error. It's too large so please see it here: https://gist.github.com/BoBRoID/3d40525e9d6e7e5c6a88b0ad801819d0

gael-ian commented 5 years ago

@BoBRoID

Ok, my bad. I did some refactoring when I released 1.1.2 that introduce a stupid bug on source install command building. I should have unit tests for that but it's not really easy to test code that will be executed on guest machines. The only method I found is to launch tests machines and there's a lot of them...

I'll try to find a better testing method in the future but for now, your problem should be fixed with vagrant-bindfs 1.1.4. I runned a full provisioning of a CentOS 7 box with installation from source and everything went fine.

Sorry for the inconvenience