Interesting times debugging puppet

Saturday, 26 August 2017

I recently upgraded a bunch of systems from Jessie to Stretch, and as a result of that one of my hosts has started showing me a lot of noise in an hourly cron-email:

Command line is not complete. Try option "help"

I've been ignoring these emails for the past while, but today I sat down to track down the source. It was obviously coming from facter, the system that puppet uses to gather information about hosts.

Running facter -debug made that apparent:

 root@smaug ~ # facter --debug
 Found no suitable resolves of 1 for ec2_metadata
 value for ec2_metadata is still nil
 value for netmask_git is still nil
 value for ipaddress6_lo is still nil
 value for macaddress_lo is still nil
 value for ipaddress_master is still nil
 value for ipaddress6_master is still nil
 Command line is not complete. Try option "help"
 value for netmask_master is still nil
 value for ipaddress_skx_mail is still nil
 ..

There we see the issue, and it is obviously relating to our master interface.

To cut a long-story short /usr/lib/ruby/vendor_ruby/facter/util/ip.rb contains some code which eventually runs this:

 ip link show $interface

That works on all other interfaces I have:

  $ ip link show git
  6: git: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 1000

But not on master:

  $ ip link show master
  Command line is not complete. Try option "help"

I ninja-edited the code from this:

  ethbond = regex.match(%x{/sbin/ip link show '#{interface}'})

to:

  ethbond = regex.match(%x{/sbin/ip link show dev '#{interface}'})

And suddenly puppet-runs without any errors. I'm not 100% sure if this is a bug bug, but it is something of a surprise anyway.

This host runs KVM guests, one of the guests is a puppet-master, with a local name master. Hence the name of the interface. Similarly the interface git is associated with the KVM guest behind git.steve.org.uk.

| 5 comments.

 

Comments On This Entry

[author] Steve Kemp

Submitted at 08:37:23 on 26 august 2017

Reported as a bug, the fine maintainers can decide if it is or isn't :)

[gravitar] rjc

Submitted at 09:06:43 on 26 august 2017

FWIW, the former command line (without 'dev') is present on Ubuntu 14.04 LTS with Puppet 3.8 from puppet.com

Where do you get your puppet packages from? All packages upgraded, right? :^)

[author] Steve Kemp

Submitted at 09:15:46 on 26 august 2017

All packages come from the Stretch archive:

root@smaug ~ # dpkg --list facter puppet
..
ii  facter         2.4.6-1      all          collect and display facts about t
ii  puppet         4.8.2-5      all          configuration management system

The origins are as-expected:

root@smaug ~ # apt-cache policy puppet facter
puppet:
  Installed: 4.8.2-5
  Candidate: 4.8.2-5
  Version table:
 *** 4.8.2-5 500
        500 http://ftp.uk.debian.org/debian stretch/main amd64 Packages
        100 /var/lib/dpkg/status
facter:
  Installed: 2.4.6-1
  Candidate: 2.4.6-1
  Version table:
 *** 2.4.6-1 500
        500 http://ftp.uk.debian.org/debian stretch/main amd64 Packages
        100 /var/lib/dpkg/status
[gravitar] riccio

Submitted at 08:46:55 on 11 september 2017

I think that's because the ip(8) command changed syntax, please compare:

  • https://manpages.debian.org/jessie/iproute2/ip-link.8.en.html
  • https://manpages.debian.org/stretch/iproute2/ip-link.8.en.html
[gravitar] riccio

Submitted at 07:45:44 on 5 september 2017

I think it's because the iproute2 package has changed the "ip link show" suboptions, please compare:

  • https://manpages.debian.org/jessie/iproute2/ip-link.8.en.html
  • https://manpages.debian.org/stretch/iproute2/ip-link.8.en.html

^F master

 

Comments are closed on posts which are more than ten days old.

Recent Posts

Recent Tags