Giter Club home page Giter Club logo

Comments (17)

dfarrell07 avatar dfarrell07 commented on September 13, 2024

Trying to use the F21 box linked above, I'm seeing the following error:

Exited: 1
/home/daniel/.gem/ruby/gems/beaker-2.2.0/lib/beaker/host.rb:285:in `exec': Host 'fedora-21-x64' exited with 1 running: (Beaker::Host::CommandFailure)
 yum install -y puppet
Last 10 lines of output were:
    --> Running transaction check
    ---> Package libyaml.x86_64 0:0.1.6-6.fc21 will be installed
    ---> Package ruby-irb.noarch 0:2.1.5-26.fc21 will be installed
    ---> Package ruby-shadow.x86_64 1:2.2.0-2.el7 will be installed
    --> Processing Dependency: libruby.so.2.0()(64bit) for package: 1:ruby-shadow-2.2.0-2.el7.x86_64
    --> Finished Dependency Resolution
    Error: Package: 1:ruby-shadow-2.2.0-2.el7.x86_64 (puppetlabs-deps)
               Requires: libruby.so.2.0()(64bit)
     You could try using --skip-broken to work around the problem
     You could try running: rpm -Va --nofiles --nodigest

With this config file:

HOSTS:
  fedora-21-x64:
    roles:
      - master
    platform: el-7-x86_64
    box: TFDuesing/Fedora-21
    hypervisor: vagrant

CONFIG:
  log_level: verbose
  type: foss

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

Narrowed down the scope of the error described above.

The Beaker config above produced the following Vagrantfile:

Vagrant.configure("2") do |c|
  c.vm.define 'fedora-21' do |v|
    v.vm.hostname = 'fedora-21'
    v.vm.box = 'TFDuesing/Fedora-21'
    v.vm.box_url = 'https://vagrantcloud.com/TFDuesing/boxes/Fedora-21'
    v.vm.box_check_update = 'true'
    v.vm.network :private_network, ip: "10.255.118.215", :netmask => "255.255.0.0", :mac => "0800278DA5F2"
    v.vm.provider :virtualbox do |vb|
      vb.customize ['modifyvm', :id, '--memory', '1024']
    end
  end
end

Which I copied into a new directory, then vagrant up'd.

A sudo yum install -y puppet in the resulting box works as expected. However, parsing through the output produce by Beaker, I noticed that it doesn't install Puppet from the default repos. Instead, it uses rpm -q --quiet puppetlabs-release || rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm and then yum install -y puppet.

Repeating those two commands on a fresh box produced from the Vagrantfile above was enough to reproduce the error:

Error: Package: 1:ruby-shadow-2.2.0-2.el7.x86_64 (puppetlabs-deps)
           Requires: libruby.so.2.0()(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

Even cleaner, I can reproduce the error with the following.

Add the chef/fedora-21 Vagrant box described here.

wget http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_fedora-21_chef-provisionerless.box
vagrant box add chef/fedora-21 opscode_fedora-21_chef-provisionerless.box

Create a working directory and this Vagrantfile

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "chef/fedora-21"
  config.vm.provision "shell", inline: "rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm"
  config.vm.provision "shell", inline: "yum install -y puppet"
end

vagrant up

==> default: Error: Package: 1:ruby-shadow-2.2.0-2.el7.x86_64 (puppetlabs-deps)
==> default:            Requires: libruby.so.2.0()(64bit)
==> default:  You could try using --skip-broken to work around the problem
==> default:  You could try running: rpm -Va --nofiles --nodigest

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

Reading the relevant Puppet docs, it seems plausible that this error is caused by Beaker attempting to use the CentOS/RHEL 7 Puppet repo, instead of the Fedora one. Note that there isn't a Fedora 21 RPM at the URL bumped from F20.

http://yum.puppetlabs.com/puppetlabs-release-fedora-21.noarch.rpm

Not Found

The requested URL /puppetlabs-release-fedora-21.noarch.rpm was not found on this server.

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

Using bundle exec rake fedora to run against F20, I see Beaker issuing the same RPM command described above for F21.

fedora-20 13:25:21$ rpm -q --quiet puppetlabs-release || rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm

For whatever reason, this doesn't cause yum install -y puppet to fail.

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

This Beaker node file

HOSTS:
  fedora-21:
    roles:
      - master
    platform: fedora-21-x86_64
    # TODO: Move to an offical-ish F21 box once one goes on Vagrantcloud
    # See: https://github.com/opscode/bento/issues/312
    box: TFDuesing/Fedora-21
    box_url: https://vagrantcloud.com/TFDuesing/boxes/Fedora-21
    hypervisor: vagrant

CONFIG:
  log_level: debug
  type: foss

Produces this error (due to missing F21 RPM).

/home/daniel/.gem/ruby/gems/beaker-2.2.0/lib/beaker/host.rb:285:in `exec': Host 'fedora-21' exited with 1 running: (Beaker::Host::CommandFailure)
 rpm -q --quiet puppetlabs-release || rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-fedora-21.noarch.rpm
Last 10 lines of output were:
    curl: (22) The requested URL returned error: 404 Not Found
    error: skipping http://yum.puppetlabs.com/puppetlabs-release-fedora-21.noarch.rpm - transfer failed
    Retrieving http://yum.puppetlabs.com/puppetlabs-release-fedora-21.noarch.rpm

Note that the 404 is expected, but it's good confirmation to see that the URL is determined by the platform line in the Beaker node description.

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

Changing the platform line to point at F20, and therefore a working RPM URL, gets things mostly working for F21. I'm seeing one Beaker test failure (at least they are running).

Failures:

  1) opendaylight class default parameters Service "opendaylight" should be enabled
     On host ``
     Failure/Error: it { is_expected.to be_enabled }
       systemctl --plain list-dependencies runlevel3.target | grep '^opendaylight.service$'
       expected Service "opendaylight" to be enabled
     # ./spec/acceptance/class_spec.rb:22:in `block (4 levels) in <top (required)>'

Finished in 2 minutes 18.8 seconds
4 examples, 1 failure

Failed examples:

rspec ./spec/acceptance/class_spec.rb:22 # opendaylight class default parameters Service "opendaylight" should be enabled

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

The issue is that as of Fedora 21, systemctl --plain list-dependencies outputs a green or red (stdout, stderr) unicode circle (9679) and a space before the service name. The grep command executed by serverspec matches against the beginning of the line, which was fine for F20 without the prepended unicode but fails for F21, even if the service is enabled.

[vagrant@localhost ~]$ systemctl --plain list-dependencies runlevel3.target | grep 'opendaylight.service$'
● opendaylight.service
[vagrant@localhost ~]$ echo $?
0
[vagrant@localhost ~]$ systemctl --plain list-dependencies runlevel3.target | grep '^opendaylight.service$'
[vagrant@localhost ~]$ echo $?
1

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

These are the lines of systemctl that are causing the issue:

https://github.com/systemd/systemd/blob/master/src/systemctl/systemctl.c#L1629

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

This is the commit that caused the issue:

systemd/systemd@dbc2c08

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

The systemd people on Freenode/#systemd made a quick fix to cause --plain to not output the unicode dots that are causing issues.

3:07:54 PM <dfarrell07> I'm interested in disabling the unicode char printed by `systemctl list-dependices`, added in this commit https://github.com/systemd/systemd/commit/dbc2c080debdc45683bc5534e327455d4fbbbea7
3:08:33 PM <dfarrell07> It's causing issues for projects that grep for `^<some service>$`
3:09:03 PM <dfarrell07> Because of the matching against the beginning of the line
3:09:18 PM <dfarrell07> A popular tool, serverspec, is hitting a bug for F21 because of this
3:09:33 PM — dfarrell07 is digging into that bug from a distantly related project
3:10:31 PM  → Noiwex joined  ⇐ normalrawr quit  
3:16:28 PM <zbyszek> dfarrell07: systemctl show -p Wants,Requires ... is the proper way to do this.
3:16:48 PM <zbyszek> That output is stable and should be used by other tools.
3:16:59 PM <dfarrell07> zbyszek: checking that out now, thanks for info
3:17:04 PM → The_Blob joined ([email protected])
3:17:13 PM <zbyszek> systemctl "pretty" output is explicitly documented as user-oriented and subject ot change.
3:17:25 PM <dfarrell07> zbyszek: cool, makes sense
3:17:36 PM → bel3atar_ joined ([email protected])
3:17:45 PM <grawity> Wants, Requires are not transitive though
3:18:06 PM  → stackofcats joined  ⇐ bel3atar, manio, stackofc1ts, [42], mamikk, booly-yam-5635 and Kinokoio quit  
3:18:45 PM <zbyszek> grawity: True...
3:19:55 PM <dfarrell07> grawity: was just noticing that, as I can't duplicate the behavior serverspec seems to need using `show -p <whatever>`
3:21:36 PM → [42] joined ([email protected])
3:22:12 PM <zbyszek> I guess we could modify --plain to not show the dot.
3:22:29 PM <dfarrell07> zbyszek: that's what I initially had in mind
3:22:37 PM <dfarrell07> read: that's the behavior I expected
3:22:39 PM  → manio and prahal joined  
3:23:40 PM <dfarrell07> zbyszek, grawity: Would you like me to file a bug to document this?
3:23:50 PM <zbyszek> Not necessary.
3:25:11 PM ⇐ ||arifaX quit (~Commodore@unaffiliated/arifax/x-427475) Quit: http://quassel-irc.org - Chat comfortably. Anywhere.
3:27:11 PM <zdzichu> This function is intended to generate human-readable output. If you are looking for computer-parsable output, use show instead. 
3:27:18 PM <zdzichu> ^^ mam systemctl status
3:27:19 PM <zdzichu> man
3:27:53 PM → mamikk joined ([email protected])
3:29:39 PM <dfarrell07> zdzichu: Given that `show` seems to be non-transitive, how can I reproduce the behavior of commands like `systemctl --plain list-dependencies runlevel3.target | grep '^opendaylight.service$'` using it?
3:30:42 PM ⇐ xakz quit ([email protected]) Ping timeout: 245 seconds
3:30:47 PM <zdzichu> ehm, what are you trying to do?
3:30:53 PM ⇐ Noiwex quit ([email protected]) Ping timeout: 240 seconds
3:31:03 PM <zdzichu> it looks like "systemctl is-enabled opendaylight.service"
3:31:15 PM <dfarrell07> zdzichu: not so much me as a popular project, called serverspec, that uses basically exactly that command
3:31:16 PM ⇐ kukks quit (~Guenter@samba/team/kukks) Ping timeout: 264 seconds
3:31:23 PM — dfarrell07 looks into `is-enabled`
3:32:48 PM <dfarrell07> zdzichu: is-enabled looks like what they need, I'll submit a PR to move them to that interface
3:32:51 PM <dfarrell07> thanks @ all :)
3:33:53 PM  → booboy and booly-yam-4014 joined  ⇐ bluelupo quit  ↔ stackofcats and manio nipped out  
3:42:17 PM <fdo-vcs> zbyszek master 250ba66 src/systemctl/systemctl.c * systemctl: do not show dots with --plain
3:42:49 PM <zbyszek> dfarrell07: ^, even if you don't need actually need it.
3:43:19 PM <dfarrell07> zbyszek: Awesome, thanks *impressed* :)

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

Went over to the serverspec repo with the intention of filing a bug to move them to the is-enabled systemd interface. However, it seems that the new-ish versions of serverspec have already made the switch.

Looking at the commit that cut the 1.16.0 release, which is the one Bundler is giving me, I see the relevant (erroneous) lines.

[~/serverspec]$ git checkout -b systemd_f21 5a38362 
[~/serverspec]$ grep -rniI "list-d" *
spec/arch/service_spec.rb:7:  its(:command) { should eq "systemctl --plain list-dependencies multi-user.target | grep '^sshd.service$'" }
spec/arch/service_spec.rb:16:  its(:command) { should eq "systemctl --plain list-dependencies graphical.target | grep '^sshd.service$'" }
spec/nixos/service_spec.rb:7:  its(:command) { should eq "systemctl --plain list-dependencies multi-user.target | grep 'sshd.service$'" }
spec/nixos/service_spec.rb:16:  its(:command) { should eq "systemctl --plain list-dependencies multi-user.target | grep 'sshd.service$'" }
spec/nixos/service_spec.rb:21:  its(:command) { should eq "systemctl --plain list-dependencies graphical.target | grep 'sshd.service$'" }
spec/redhat7/service_spec.rb:7:  its(:command) { should eq "systemctl --plain list-dependencies runlevel3.target | grep '^sshd.service$'" }
spec/redhat7/service_spec.rb:16:  its(:command) { should eq "systemctl --plain list-dependencies runlevel4.target | grep '^sshd.service$'" }

Looking at the latest version, they are gone.

[~/serverspec]$ git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
[~/serverspec]$ grep -rniI "list-d" *
[~/serverspec]$

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

Now I'm in a bit of a dependency hell.

I need a newer version of serverspec to get the systemd fix to make F21 work. However, when I try to request a newer version from Bunlder (Gemfile below) it helpfully informs me of the following conflict:

[~/dfarrell07-opendaylight]$ bundle install
Updating https://github.com/rodjek/rspec-puppet.git
Fetching gem metadata from https://rubygems.org/.........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "rspec":
  In Gemfile:
    rspec-puppet (>= 0) ruby depends on
      rspec (~> 2.0) ruby

    serverspec (~> 2.0) ruby depends on
      rspec (3.0.0)
[~/dfarrell07-opendaylight]$ cat Gemfile                                                                                                               15:48:14
source "https://rubygems.org"

group :test do
  gem "rake"
  gem "puppet", ENV['PUPPET_VERSION'] || '~> 3.7.0'
  gem "rspec-puppet", :git => 'https://github.com/rodjek/rspec-puppet.git'
  gem "puppetlabs_spec_helper"
  gem "metadata-json-lint"
end

group :development do
  gem "travis"
  gem "serverspec", "~> 2.0"
  gem "travis-lint"
  gem "beaker"
  gem "beaker-rspec"
  gem "vagrant-wrapper"
  gem "puppet-blacksmith"
  gem "guard-rake"
end

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

Found a pull request to update the version of rspec used by rspec-puppet. If this gets merged, my issues should be solved. I posted there to let them know about the issues with Beaker testing against F21 that dep issue is causing.

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

Someone forked rspec-puppet and only updated the version of rspec required. Updating my Gemfile to point at that fork, deleting Gemfile.lock and re-running bundle install gave me a version of serverspec with the F21 systemd fix I need.

[~/dfarrell07-opendaylight]$ bundle exec gem list | grep rspec                                                                                         18:21:05
beaker-rspec (5.0.0)
rspec (3.1.0)
rspec-core (3.1.7)
rspec-expectations (3.1.2)
rspec-its (1.1.0)
rspec-mocks (3.1.3)
rspec-puppet (2.0.0)
rspec-support (3.1.2)
serverspec (2.7.1)

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

And finally, Beaker against Fedora 21 passes.

Finished in 2 minutes 21.7 seconds (files took 2 minutes 48.8 seconds to load)
4 examples, 0 failures

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

The bulk of this work is done. Going to handle the remaining, more specific TODOs in their own issues. For now, those are #15 and #16.

from puppet-opendaylight.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.