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

vagrant-share.rb:10: [BUG] Segmentation fault #9220

Closed
traumschule opened this issue Nov 26, 2017 · 10 comments
Closed

vagrant-share.rb:10: [BUG] Segmentation fault #9220

traumschule opened this issue Nov 26, 2017 · 10 comments

Comments

@traumschule
Copy link

traumschule commented Nov 26, 2017

Vagrant version

Vagrant 2.0.1

Ruby version

2.4.2

Rubygems version

2.6.13

Host operating system

debian stretch

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 9.1 (stretch)
Release:        9.1
Codename:       stretch
$ uname -a
Linux 4.9.0-4-686-pae #1 SMP Debian 4.9.51-1 (2017-09-28) i686 GNU/Linux

Debug output

https://gist.github.com/traumschule/1bd533457439d92c6b3eb9ae1a520607

Expected behavior

No segflt.

Actual behavior

Segmentation fault.

Steps to reproduce

  1. slow internet / probably interrupted connection
  2. update vagrant to 2.0.1
  3. vagrant plugin install vagrant-hostmanager && vagrant up

Removing ~/.vagrant.d/gems/2.4.2/gems/vagrant-share-1.1.9 obviously leads to

/opt/vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/bundler.rb:390:in `write': No such file or directory @ rb_sysopen - /home/user/.vagrant.d/gems/2.4.2/gems/v
agrant-share-1.1.9/vagrant-share.gemspec (Errno::ENOENT)
@briancain
Copy link
Member

Hi @traumschule - Could you please run the following command, and then install the hostmanager plugin?

vagrant plugin expunge

Thanks!

@traumschule
Copy link
Author

traumschule commented Nov 27, 2017

Thanks for looking into this!

$ vagrant plugin expunge
Would you like Vagrant to attempt to reinstall current plugins? [N]: y

This command permanently deletes all currently installed user plugins.
It should only be used when a repair command is unable to properly fix
the system.

Continue? [N]: y

All user installed plugins have been removed from this Vagrant
environment!

Vagrant will now attempt to reinstall user plugins that were removed.
Installing the 'vagrant-cachier' plugin. This can take a few
minutes...Fetching: vagrant-cachier-1.2.1.gem (100%) Fetching:
vagrant-hostmanager-1.8.7.gem (100%) Fetching: vagrant-share-1.1.9.gem
(100%) Installed the plugin 'vagrant-cachier (1.2.1)'!
Installing the 'vagrant-hostmanager' plugin. This can take a few
minutes... Installed the plugin 'vagrant-hostmanager (1.8.7)'!
$ ./scripts/vagrant/install.sh
Checking your system ...

  • vagrant: /usr/bin/vagrant
    Vagrant 2.0.1
    Note: Vagrant prior 1.8.2 will fail.
  • ansible: /usr/bin/ansible
    ansible 2.4.1.0
    config file = /home/hitchwiki/src/hwt/ansible.cfg
    configured module search path = [u'/home/hitchwiki/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
    ansible python module location = /usr/lib/python2.7/dist-packages/ansible
    python version = 2.7.13 (default, Jan 19 2017, 14:48:08) [GCC 6.3.0 20170118]

All fine, let's roll ...
Installing the 'vagrant-hostmanager' plugin. This can take a few minutes...
Installed the plugin 'vagrant-hostmanager (1.8.7)'!
/home/hitchwiki/.vagrant.d/gems/2.4.2/gems/vagrant-share-1.1.9/lib/vagrant-share.rb:10: [BUG] Segmentation fault at 0x00000008
ruby 2.4.2p198 (2017-09-14 revision 59899) [i686-linux]

Here is the content of ./scripts/vagrant/install.sh:

echo "Checking your system ..."
for app in vagrant ansible; do
  bin=$(which $app)
  if [[ ! $bin ]] ; then
    echo "Please install $app."
  else
    echo "- $app: $bin"
    $bin --version
    if [ $app = "vagrant" ] ; then echo "Note: Vagrant prior 1.8.2 will fail." ; fi
  fi
done
echo -e $sep
echo "All fine, let's roll ..."
vagrant plugin install vagrant-hostmanager
vagrant up

Downgrading vagrant solves this bug:

echo "Downgrade vagrant to avoid https://github.com/hashicorp/vagrant/issues/9220"
apt-get install vagrant=1.9.1+dfsg-1 virtualbox=5.1.30-dfsg-1~bpo9+1 \
  python3{,-minimal}=3.5.3-1 libpython3-stdlib=3.5.3-1

@briancain
Copy link
Member

Hi...just from the output you shared it looks like you're installing the plugin twice? After running vagrant plugin expunge in the output, I see something that says:

Installing the 'vagrant-hostmanager' plugin. This can take a few
minutes... Installed the plugin 'vagrant-hostmanager (1.8.7)'!

Right before you run your installation script.

@traumschule
Copy link
Author

traumschule commented Nov 28, 2017

That is correct. The first stems form vagrant plugin expunge:

Vagrant will now attempt to reinstall user plugins that were removed.

Is it expected tocause no issue to run vagrant plugin install vagrant-hostmanager multiple times?

@traumschule
Copy link
Author

traumschule commented Nov 30, 2017

The bug seems to be fixed in HEAD.

Upgrading to ruby 2.5 is not necessary and breaks vagrants dependencies (just in case someone had the same idea as me):

Bundler could not find compatible versions for gem "ruby":                                     
  In Gemfile:                                                         
    ruby                                                                                                
                                                                       
    vagrant was resolved to 2.0.2.dev, which depends on                                                                 
      ruby (< 2.5, ~> 2.2)                                                                                                

Could not find gem 'ruby (< 2.5, ~> 2.2)', which is required by gem 'vagrant', in any of the sources.

@TRPB
Copy link

TRPB commented Jan 6, 2018

Will this be fixed in 2.0.2? It seems the only current workaround is downgrading, I'm having the same issue with the vagrant-triggers plugin.

@Xachman
Copy link

Xachman commented Jan 18, 2018

I ran into this issue when the 32bit version of vagrant 2.0.1 was installed. After installing the 64bit version this was fixed.

@maxi7587
Copy link

I had this issue too... Removing Vagrant and using an older version fixed the problem...

@mitsest
Copy link

mitsest commented Feb 24, 2020

Having the same issue, when trying to vagrant up a trellis setup (localhost wordpress) on macOS. Updated ruby to latest version, and the problem persists.

Which is the suggested vagrant version to use?

@ghost
Copy link

ghost commented Feb 25, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Feb 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants