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

Beaker broken for Fedora >20, Ubuntu 15.04 #63

Closed
dfarrell07 opened this issue Mar 2, 2015 · 22 comments
Closed

Beaker broken for Fedora >20, Ubuntu 15.04 #63

dfarrell07 opened this issue Mar 2, 2015 · 22 comments

Comments

@dfarrell07
Copy link
Owner

Update: Turns out the F21 failures have nothing to do with the info in the first few posts below. Skip to this comment.

Another update: ^^That was true, but now that we have Puppet 3.7.5 and the associated patch we're seeing the tar-related error again, so we're back to the first issue described.

Third update: Fedora 21, 22 and Ubuntu 15.04 Beaker tests are failing. The Fedora ones are clearly an issue with Beaker, it attempts invalid commands. The Ubuntu may be as well, I haven't looked as closely. Fedora 20, CentOS 7 and Ubuntu 14.04 work.

Apparently the Fedora 21 Vagrant box we're using doesn't ship with tar by default (not sure if that's the case with F21 generally, likely so).

[~/puppet-opendaylight]$ BEAKER_destroy=no bundle exec rake fedora_21 &> fedora_21_1.log
[~/puppet-opendaylight]$ cd .vagrant/beaker_vagrant_files/fedora-21.yml
[~/puppet-opendaylight/.vagrant/beaker_vagrant_files/fedora-21.yml]$ vagrant ssh
Last login: Mon Mar  2 00:30:07 2015 from 10.0.2.2
[vagrant@fedora-21 ~]$ command -v tar
[vagrant@fedora-21 ~]$ which tar
/usr/bin/which: no tar in (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/vagrant/.local/bin:/home/vagrant/bin)

It is is the repos, we just need to manually install it for Fedora 21.

[vagrant@fedora-21 ~]$ sudo yum provides tar
2:tar-1.27.1-7.fc21.x86_64 : A GNU file archiving program
Repo        : fedora
@dfarrell07 dfarrell07 self-assigned this Mar 2, 2015
@dfarrell07 dfarrell07 added this to the Release on Forge milestone Mar 2, 2015
dfarrell07 added a commit that referenced this issue Mar 2, 2015
* Without this, wouldn't be provisioned via RPM or tarball
* Relevant to #32 and #63

Signed-off-by: Daniel Farrell <[email protected]>
@dfarrell07
Copy link
Owner Author

Note that I'm not totally convinced that is really about tar/lack of tar. Could be something else and a cryptic (as normal) error message from Puppet.

@dfarrell07
Copy link
Owner Author

Here's the most relevant part of F21 Beaker error message, btw:

puppet module install camptocamp-archive
Last 10 lines of output were:
        Notice: Preparing to install into /etc/puppet/modules ...
        Notice: Downloading from https://forgeapi.puppetlabs.com ...
        Error: No suitable tar implementation found
        Error: Try 'puppet help module install' for usage

@dfarrell07 dfarrell07 changed the title Install tar on Fedora 21 Fedora 21 Beaker tests failing Mar 2, 2015
@dfarrell07
Copy link
Owner Author

Until we get this line of code via a new Puppet release, F21 Beaker tests will be broken in the same way the F20 ones are.

Note that CentOS 7 is not affected because of this line.

Marking this as blocked on a Puppet release that includes 1b8737.

@dfarrell07
Copy link
Owner Author

The fix we need was included when the Puppet 3.7.5 release was cut.

Hasn't been packaged for Fedora yet:

[~/puppet-opendaylight]$ puppet --version
3.7.4
[~/puppet-opendaylight]$ sudo yum update -y
[sudo] password for daniel: 
Loaded plugins: langpacks, refresh-packagekit
bluejeans                                                       | 2.9 kB  00:00:00     
google-chrome                                                   |  951 B  00:00:00     
rpmfusion-free-updates                                          | 3.3 kB  00:00:00     
rpmfusion-nonfree-updates                                       | 3.3 kB  00:00:00     
updates/20/x86_64/metalink                                      |  14 kB  00:00:00     
No packages marked for update

@dfarrell07
Copy link
Owner Author

Hasn't been packaged for Fedora yet:

Tuns out they use a different Yum repo. Once I pointed Yum at yum.puppetlabs.com I got the 3.7.5 update. Direct link to RPM.

[~]$ puppet --version                                                                                                                      10:35:12
3.7.5
[~]$ sudo yum info puppet                                                                                                                  10:35:14
Loaded plugins: langpacks, refresh-packagekit
Installed Packages
Name        : puppet
Arch        : noarch
Version     : 3.7.5
Release     : 1.fc20
Size        : 6.3 M
Repo        : installed
From repo   : puppetlabs-products
Summary     : A network tool for managing many disparate systems
URL         : http://puppetlabs.com
License     : ASL 2.0
Description : Puppet lets you centrally manage every important aspect of your system using a
            : cross-platform specification language that manages all the separate elements
            : normally aggregated in different files, like users, cron jobs, and hosts,
            : along with obviously discrete elements like packages, services, and files.

@dfarrell07 dfarrell07 removed the blocked label Apr 6, 2015
@dfarrell07
Copy link
Owner Author

After I moved to Puppet 3.7.5 and got the associated fix I'm back to seeing tar-related errors.

fedora-21 11:05:34$ puppet module install puppetlabs-stdlib
Notice: Preparing to install into /etc/puppet/modules ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Error: No suitable tar implementation found
Error: Try 'puppet help module install' for usage

I think that's caused by this puppetlabs/puppet code:

  def self.instance
    if Puppet::Util.which('tar') && ! Puppet::Util::Platform.windows?
      Gnu.new
    elsif Puppet.features.minitar? && Puppet.features.zlib?
      Mini.new
    else
      raise RuntimeError, 'No suitable tar implementation found'
    end
  end

Which makes sense given that which tar does in fact fail on F21:

[vagrant@fedora-21 ~]$ which tar
/usr/bin/which: no tar in (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/vagrant/.local/bin:/home/vagrant/bin)
[vagrant@fedora-21 ~]$ echo $?
1

@dfarrell07
Copy link
Owner Author

Manually installing tar fixes the problem:

[vagrant@fedora-21 ~]$ puppet module install puppetlabs-stdlib
Notice: Preparing to install into /home/vagrant/.puppet/modules ...
Notice: Created target directory /home/vagrant/.puppet/modules
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Error: No suitable tar implementation found
Error: Try 'puppet help module install' for usage
[vagrant@fedora-21 ~]$ sudo yum install -y tar
Resolving Dependencies
--> Running transaction check
---> Package tar.x86_64 2:1.27.1-7.fc21 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================
 Package                       Arch                             Version                                     Repository                        Size
===================================================================================================================================================
Installing:
 tar                           x86_64                           2:1.27.1-7.fc21                             fedora                           894 k

Transaction Summary
===================================================================================================================================================
Install  1 Package

Total download size: 894 k
Installed size: 2.9 M
Downloading packages:
tar-1.27.1-7.fc21.x86_64.rpm                                                                                                | 894 kB  00:00:05     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction (shutdown inhibited)
  Installing : 2:tar-1.27.1-7.fc21.x86_64                                                                                                      1/1 
  Verifying  : 2:tar-1.27.1-7.fc21.x86_64                                                                                                      1/1 

Installed:
  tar.x86_64 2:1.27.1-7.fc21                                                                                                                       

Complete!
[vagrant@fedora-21 ~]$ puppet module install puppetlabs-stdlib
Notice: Preparing to install into /home/vagrant/.puppet/modules ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
/home/vagrant/.puppet/modules
└── puppetlabs-stdlib (v4.5.1)

@dfarrell07
Copy link
Owner Author

I don't think I'll be able to fix the tar issue by using a simple Puppet package type in the ODL mod, as this is failing way before we even puppet apply the ODL mod, during the initial module installs via Beaker in spec_helper_acceptance.rb.

  # Configure all nodes in nodeset
  c.before :suite do
    # Install opendaylight module on any/all Beaker hosts
    # TODO: Should this be done in host.each loop?
    puppet_module_install(:source => proj_root, :module_name => 'opendaylight')
    hosts.each do |host|
      # Install stdlib, a dependency of the odl mod
      # TODO: Why is 1 an acceptable exit code?
      on host, puppet('module', 'install', 'puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] }
      # Install archive, a dependency of the odl mod use for tarball-type installs
      on host, puppet('module', 'install', 'camptocamp-archive'), { :acceptable_exit_codes => [0] }
      # Install Java Puppet mod, a dependency of the tarball install method
      on host, puppet('module', 'install', 'puppetlabs-java'), { :acceptable_exit_codes => [0] }
    end
  end

First debuging plan is to attempt to find an F21 Vagant box that does have tar installed by default (relevant to #15).

@dfarrell07
Copy link
Owner Author

The chef/fedora-21 box (which is the one I hoped to move to in #15) has tar:

[~/f21]$ vagrant destroy -f                                                                                                                13:07:40
==> fedora-21: Destroying VM and associated drives...
[~/f21]$ vagrant up                                                                                                                        13:07:46
Bringing machine 'fedora-21' up with 'virtualbox' provider...
==> fedora-21: Importing base box 'chef/fedora-21'...
==> fedora-21: Matching MAC address for NAT networking...
==> fedora-21: Checking if box 'chef/fedora-21' is up to date...
==> fedora-21: Setting the name of the VM: f21_fedora-21_1428340077792_25802
==> fedora-21: Clearing any previously set network interfaces...
==> fedora-21: Preparing network interfaces based on configuration...
    fedora-21: Adapter 1: nat
==> fedora-21: Forwarding ports...
    fedora-21: 22 => 2222 (adapter 1)
==> fedora-21: Running 'pre-boot' VM customizations...
==> fedora-21: Booting VM...
==> fedora-21: Waiting for machine to boot. This may take a few minutes...
    fedora-21: SSH address: 127.0.0.1:2222
    fedora-21: SSH username: vagrant
    fedora-21: SSH auth method: private key
    fedora-21: Warning: Connection timeout. Retrying...
    fedora-21: 
    fedora-21: Vagrant insecure key detected. Vagrant will automatically replace
    fedora-21: this with a newly generated keypair for better security.
    fedora-21: 
    fedora-21: Inserting generated public key within guest...
    fedora-21: Removing insecure key from the guest if its present...
    fedora-21: Key inserted! Disconnecting and reconnecting using new SSH key...
==> fedora-21: Machine booted and ready!
==> fedora-21: Checking for guest additions in VM...
==> fedora-21: Setting hostname...
==> fedora-21: Mounting shared folders...
    fedora-21: /vagrant => /home/daniel/f21
[~/f21]$ vagrant ssh                                                                                                                       13:08:22
Last login: Thu Dec 18 07:06:12 2014 from 10.0.2.2
[vagrant@fedora-21 ~]$ which tar
/usr/bin/tar
[vagrant@fedora-21 ~]$ logout
Connection to 127.0.0.1 closed.
[~/f21]$ cat Vagrantfile                                                                                                                   13:08:54
Vagrant.configure("2") do |c|
  c.vm.define 'fedora-21' do |v|
    v.vm.hostname = 'fedora-21'
    v.vm.box = 'chef/fedora-21'
    v.vm.box_url = 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_fedora-21_chef-provisionerless.box'
    v.vm.box_check_update = 'true'
    v.vm.provider :virtualbox do |vb|
      vb.customize ['modifyvm', :id, '--memory', '1024']
    end
  end
end

@dfarrell07
Copy link
Owner Author

After switching to the chef/fedora-21 box, I'm seeing a different error:

[~/f21]$ vagrant up                                                                                                                        13:19:02
Bringing machine 'fedora-21' up with 'virtualbox' provider...
==> fedora-21: Importing base box 'chef/fedora-21'...
==> fedora-21: Matching MAC address for NAT networking...
==> fedora-21: Checking if box 'chef/fedora-21' is up to date...
==> fedora-21: Setting the name of the VM: f21_fedora-21_1428341646241_46333
==> fedora-21: Fixed port collision for 22 => 2222. Now on port 2200.
==> fedora-21: Clearing any previously set network interfaces...
==> fedora-21: Preparing network interfaces based on configuration...
    fedora-21: Adapter 1: nat
    fedora-21: Adapter 2: hostonly
==> fedora-21: Forwarding ports...
    fedora-21: 22 => 2200 (adapter 1)
==> fedora-21: Running 'pre-boot' VM customizations...
==> fedora-21: Booting VM...
==> fedora-21: Waiting for machine to boot. This may take a few minutes...
    fedora-21: SSH address: 127.0.0.1:2200
    fedora-21: SSH username: vagrant
    fedora-21: SSH auth method: private key
    fedora-21: Warning: Connection timeout. Retrying...
    fedora-21: 
    fedora-21: Vagrant insecure key detected. Vagrant will automatically replace
    fedora-21: this with a newly generated keypair for better security.
    fedora-21: 
    fedora-21: Inserting generated public key within guest...
    fedora-21: Removing insecure key from the guest if its present...
    fedora-21: Key inserted! Disconnecting and reconnecting using new SSH key...
==> fedora-21: Machine booted and ready!
==> fedora-21: Checking for guest additions in VM...
==> fedora-21: Setting hostname...
==> fedora-21: Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

ARPCHECK=no /sbin/ifup eth1 2> /dev/null

Stdout from the command:

ERROR    : [/etc/sysconfig/network-scripts/ifup-eth] Device eth1 does not seem to be present, delaying initialization.


Stderr from the command:


Based on this thread, the issue seems to be fairly common and unclear-if-fixed.

Ideas:

  • Check other F21 boxes to see if they show this behavior
  • Report this failure to Chef folks who built the F21 box, may be an error on their part.

@dfarrell07
Copy link
Owner Author

Using this Beaker node config:

HOSTS:
  fedora-21:
    roles:
      - master
    platform: fedora-21-x86_64
    box: hansode/fedora-21-server-x86_64
    box_url: https://atlas.hashicorp.com/hansode/boxes/fedora-21-server-x86_64
    hypervisor: vagrant

CONFIG:
  log_level: verbose
  type: foss

So this F21 Vagrant box, using this Vagrantfile:

Vagrant.configure("2") do |c|
  c.vm.define 'fedora-21' do |v|
    v.vm.hostname = 'fedora-21'
    v.vm.box = 'hansode/fedora-21-server-x86_64'
    v.vm.box_url = 'https://atlas.hashicorp.com/hansode/boxes/fedora-21-server-x86_64'
    v.vm.box_check_update = 'true'
    v.vm.network :private_network, ip: "10.255.148.171", :netmask => "255.255.0.0", :mac => "080027DBC21B"
    v.vm.provider :virtualbox do |vb|
      vb.customize ['modifyvm', :id, '--memory', '1024']
    end
  end
end

I see this error:

 Failed to exec 'vagrant up'. Error was The guest machine e
ntered an invalid state while waiting for it (RuntimeError)
to boot. Valid states are 'starting, running'. The machine is in the
'poweroff' state. Please verify everything is configured
properly and try again.

@dfarrell07
Copy link
Owner Author

Same error as described above with the box-cutter/fedora21 Vagrant box. Debugging...

@dfarrell07
Copy link
Owner Author

Same error as described above with the box-cutter/fedora21 Vagrant box. Debugging...

Looks like it's actually an error with my VBox kernel mod version. sigh

@dfarrell07
Copy link
Owner Author

Looks like it's actually an error with my VBox kernel mod version.

After fixing my local Vagrant setup, re-testing the box-cutter/fedora21 Vagrant box.

Beaker config:

HOSTS:
  fedora-21:
    roles:
      - master
    platform: fedora-21-x86_64
    box: box-cutter/fedora21
    box_url: https://atlas.hashicorp.com/box-cutter/boxes/fedora21
    hypervisor: vagrant

CONFIG:
  log_level: verbose
  type: foss

Resulting Vagrantfile:

Vagrant.configure("2") do |c|
  c.vm.define 'fedora-21' do |v|
    v.vm.hostname = 'fedora-21'
    v.vm.box = 'box-cutter/fedora21'
    v.vm.box_url = 'https://atlas.hashicorp.com/box-cutter/boxes/fedora21'
    v.vm.box_check_update = 'true'
    v.vm.network :private_network, ip: "10.255.244.193", :netmask => "255.255.0.0", :mac => "08002788D552"
    v.vm.provider :virtualbox do |vb|
      vb.customize ['modifyvm', :id, '--memory', '1024']
    end
  end
end

Fails with (partial)

Failed to exec 'vagrant up'. Error was The following SSH command responded with a non-zero exit status. (RuntimeError)
Vagrant assumes that this means the command failed!

ARPCHECK=no /sbin/ifup eth1 2> /dev/null

Stdout from the command:

ERROR    : [/etc/sysconfig/network-scripts/ifup-eth] Device eth1 does not seem to be present, delaying initialization.

@dfarrell07
Copy link
Owner Author

Device eth1 does not seem to be present, delaying initialization.

This is a fairly helpful relevant thread.

@dfarrell07
Copy link
Owner Author

Device eth1 does not seem to be present, delaying initialization.

Also helpful.

@dfarrell07
Copy link
Owner Author

Building on the info provided in the two threads above, I'm able to reproduce the problem in a fairly simple setup.

[~/f21]$ vagrant --version
Vagrant 1.7.2

It doesn't seem to matter which F21 box I use.

Failing Example

Vagrantfile:

Vagrant.configure("2") do |c|
  c.vm.define 'fedora-21' do |v|
    v.vm.box = 'chef/fedora-21'
    v.vm.network :private_network, ip: "10.0.0.2"
  end
end

Output of vagrant up:

[~/f21]$ vagrant up
# snip
==> fedora-21: Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

ARPCHECK=no /sbin/ifup eth1 2> /dev/null

Stdout from the command:

ERROR    : [/etc/sysconfig/network-scripts/ifup-eth] Device eth1 does not seem to be present, delaying initialization.


Stderr from the command:

Working example

Just removing the private network line in the Vagrantfile:

Vagrant.configure("2") do |c|
  c.vm.define 'fedora-21' do |v|
    v.vm.box = 'chef/fedora-21'
  end
end

Output of vagrant up:

[~/f21]$ vagrant destroy -f
==> fedora-21: Forcing shutdown of VM...
==> fedora-21: Destroying VM and associated drives...
[~/f21]$ vagrant up
# snip, works
[~/f21]$ echo $?
0

dfarrell07 added a commit that referenced this issue Apr 24, 2015
* Likely an issue with Vagrant image, not Puppet mod
* Relevant to issue #63

Signed-off-by: Daniel Farrell <[email protected]>
jhoblitt added a commit to jhoblitt/puppetlabs-ntp that referenced this issue Jun 15, 2015
As of this commit, beaker (2.14.1) is currently incompatible with
vagrant/fedora 20+.  See:
dfarrell07/puppet-opendaylight#63 (comment)
jhoblitt added a commit to jhoblitt/puppetlabs-ntp that referenced this issue Jun 23, 2015
As of this commit, beaker (2.14.1) is currently incompatible with
vagrant/fedora 20+.  See:
dfarrell07/puppet-opendaylight#63 (comment)
jhoblitt added a commit to jhoblitt/puppetlabs-ntp that referenced this issue Jun 23, 2015
As of this commit, beaker (2.14.1) is currently incompatible with
vagrant/fedora 20+.  See:
dfarrell07/puppet-opendaylight#63 (comment)
@dfarrell07
Copy link
Owner Author

I'm still seeing the failure from /sbin/ifup eth1 with boxcutter/fedora21, boxcutter/fedora22 and chef/fedora-21. Attempting to upgrade Beaker 2.10.0 to 2.18.3 and re-test.

@dfarrell07
Copy link
Owner Author

Seeing the same error for Beaker 2.18.3.

ARPCHECK=no /sbin/ifup eth1 2> /dev/null

Stdout from the command:

ERROR    : [/etc/sysconfig/network-scripts/ifup-eth] Device eth1 does not seem to be present, delaying initialization.
[~/puppet-opendaylight]$ bundle list | grep beaker
  * beaker (2.18.3)
  * beaker-rspec (5.0.2)

dfarrell07 added a commit that referenced this issue Aug 7, 2015
Upgrade CentOS box to one that tracks the latest version (15.05 atm).

Use boxcutter boxes for all Vagrantfiles. Seem higher quality.

Add a Fedora 22 box.

Note that Beaker 2.18.3 (current version) is incompatible with F20+,
so those tests are currently failing. See #63

Signed-off-by: Daniel Farrell <[email protected]>
@dfarrell07
Copy link
Owner Author

boxcutter/ubuntu1404 works, boxcutter/ubuntu1504 fails at

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

service hostname start

Stdout from the command:



Stderr from the command:

stdin: is not a tty

dfarrell07 added a commit that referenced this issue Aug 8, 2015
Use (seemingly better) boxcutter Ubuntu 14.04 box.

Add Ubuntu 15.04 box. Note that the 15.04 Beaker tests are
currently failing (see #63).

Update Rake tasks accordingly.

Signed-off-by: Daniel Farrell <[email protected]>
@dfarrell07 dfarrell07 changed the title Fedora 21 Beaker tests failing Beaker broken for Fedora >20, Ubuntu 15.04 Aug 8, 2015
@dfarrell07
Copy link
Owner Author

Summery:

Fedora 21, 22 and Ubuntu 15.04 Beaker tests are failing. The Fedora ones are clearly an issue with Beaker, it attempts invalid commands. The Ubuntu may be as well, I haven't looked as closely. Fedora 20, CentOS 7 and Ubuntu 14.04 work.

dfarrell07 added a commit that referenced this issue Sep 15, 2015
Upgrade CentOS box to one that tracks the latest version (15.05 atm).

Use boxcutter boxes for all Vagrantfiles. Seem higher quality.

Add a Fedora 22 box.

Note that Beaker 2.18.3 (current version) is incompatible with F20+,
so those tests are currently failing. See #63

Signed-off-by: Daniel Farrell <[email protected]>
dfarrell07 added a commit that referenced this issue Sep 15, 2015
Use (seemingly better) boxcutter Ubuntu 14.04 box.

Add Ubuntu 15.04 box. Note that the 15.04 Beaker tests are
currently failing (see #63).

Update Rake tasks accordingly.

Signed-off-by: Daniel Farrell <[email protected]>
@dfarrell07
Copy link
Owner Author

I'm addressing this by moving from Vagrant -> Docker as the Beaker provider. See #8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant