Facter does not deliver ip addresses

352 views
Skip to first unread message

Axel Bock

unread,
Aug 20, 2012, 4:19:39 AM8/20/12
to puppet...@googlegroups.com
Hi readers,

another problem of mine. A host which worked just fine on friday is now not able to find out its own IP address. The reason is pretty simple as far as I have figured out: Facter. Facter returns the network interfaces just fine: interfaces=eth0,eth1, but then the ipaddress_ETHx entries are completely missing.

Any idea what could be the cause of this?


Thanks in advance & greetings,
Axel.

Eric Sorenson

unread,
Sep 4, 2012, 5:57:08 PM9/4/12
to puppet...@googlegroups.com
Hi Axel - what OS? What version of Facter? What does the output of your 'ifconfig -a' (or local equivalent) look like? Could you please run 'facter --debug' and pastebin the output somewhere?

Axel Bock

unread,
Sep 5, 2012, 4:52:02 AM9/5/12
to puppet...@googlegroups.com
Hello,

@Joseph: not yet.

@Eric: sure :) . SLES 11 SP2, and the output is here: http://pastebin.com/jqgNmewk

But I have an idea. I have another host where it still works. The host it stopped working on has two IP addresses configured on one (!) network device. so an "ip a" gives me:
[...]
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:50:56:99:05:02 brd ff:ff:ff:ff:ff:ff
    inet 130.250.8.15/24 brd 130.250.8.255 scope global eth0
    inet 130.250.8.20/24 brd 130.250.8.255 scope global secondary eth0
[...]

Maybe this is not actually covered by the detection algorithm of facter? :)


Anyway, thanks for your help!
Axel.

Krzysztof Wilczynski

unread,
Sep 5, 2012, 12:40:19 PM9/5/12
to puppet...@googlegroups.com

Ashley Penney

unread,
Sep 5, 2012, 3:25:45 PM9/5/12
to puppet...@googlegroups.com
I am going to guess this is the old 'There's no /sbin/ifconfig' thing.
I've got a pull request for facter that fixes this and a bunch of
other stuff at https://github.com/puppetlabs/facter/pull/267 if you
want to try checking out that version of Facter and trying it on your
SuSE box. It'll try and use /sbin/ip first and fallback on ifconfig
if that's not available. It might resolve this for you.
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-users/-/fR9hLVhv3bsJ.
>
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.

Axel Bock

unread,
Sep 6, 2012, 2:17:02 AM9/6/12
to puppet...@googlegroups.com
Hi Krysztof,

like this:

eth0      Link encap:Ethernet  Hardware Adresse 00:50:56:99:05:02
          inet Adresse:130.250.8.15  Bcast:130.250.8.255  Maske:255.255.255.0
          inet6 Adresse: fe80::250:56ff:fe99:502/64 Gültigkeitsbereich:Verbindung
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3351042 errors:0 dropped:14 overruns:0 frame:0
          TX packets:5629216 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 Sendewarteschlangenlänge:1000
          RX bytes:831103271 (792.6 Mb)  TX bytes:5488168284 (5233.9 Mb)

eth1      Link encap:Ethernet  Hardware Adresse 00:50:56:99:18:02
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 Sendewarteschlangenlänge:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

lo        Link encap:Lokale Schleife
          inet Adresse:127.0.0.1  Maske:255.0.0.0
          inet6 Adresse: ::1/128 Gültigkeitsbereich:Maschine
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:250524 errors:0 dropped:0 overruns:0 frame:0
          TX packets:250524 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 Sendewarteschlangenlänge:0
          RX bytes:59997729 (57.2 Mb)  TX bytes:59997729 (57.2 Mb)


And @Ashley - no, there is an /sbin/ifconfig, as you can see ... isn't "Senderwarteschlangenlänge" a _great_ word? ;))

Greetings!
Axel.

Axel Bock

unread,
Sep 6, 2012, 2:25:44 AM9/6/12
to puppet...@googlegroups.com
uuh ... /inet addr[...]/ as pattern in ip.rb? a wild guess ... if the output is localized - then puppet won't be able to get the IP address info, right?
check.

l1215022:~ # facter | grep _eth
l1215022:~ # export LC_ALL="en_US"
l1215022:~ # facter | grep _eth
ipaddress_eth0 => 130.250.8.15
macaddress_eth0 => 00:50:56:99:05:02
macaddress_eth1 => 00:50:56:99:18:02
netmask_eth0 => 255.255.255.0
l1215022:~ #

oh boy. seriously? NO ONE noticed that before?? I'm stunned right now.

Axel Bock

unread,
Sep 6, 2012, 2:30:57 AM9/6/12
to puppet...@googlegroups.com
... @joseph: do you have localized ipconfig output?

(btw I have facter 1.5.2, puppet 2.6.17, both from suse rpms)

Stephen Gran

unread,
Sep 6, 2012, 2:39:44 AM9/6/12
to puppet...@googlegroups.com
Hi,

Why do your init scripts start puppet with a locale other than C?

Cheers,
--
Stephen Gran
Senior Systems Integrator - guardian.co.uk

Please consider the environment before printing this email.
------------------------------------------------------------------
Visit guardian.co.uk - newspaper of the year

www.guardian.co.uk www.observer.co.uk www.guardiannews.com

On your mobile, visit m.guardian.co.uk or download the Guardian
iPhone app www.guardian.co.uk/iphone and iPad edition www.guardian.co.uk/iPad

Save up to 37% by subscribing to the Guardian and Observer - choose the papers you want and get full digital access.
Visit guardian.co.uk/subscribe

---------------------------------------------------------------------
This e-mail and all attachments are confidential and may also
be privileged. If you are not the named recipient, please notify
the sender and delete the e-mail and all attachments immediately.
Do not disclose the contents to another person. You may not use
the information for any purpose, or store, or copy, it in any way.

Guardian News & Media Limited is not liable for any computer
viruses or other material transmitted with or as part of this
e-mail. You should employ virus checking software.

Guardian News & Media Limited

A member of Guardian Media Group plc
Registered Office
PO Box 68164
Kings Place
90 York Way
London
N1P 2AP

Registered in England Number 908396

Joseph Mitchell Magen

unread,
Sep 6, 2012, 3:30:43 AM9/6/12
to puppet...@googlegroups.com
I'm on a fresh install of Fedora 17 and using Factor 1.6.11 and Puppet 2.7.19.

[root@localhost ~]# ifconfig -a
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 18029  bytes 5321352 (5.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 18029  bytes 5321352 (5.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

p4p1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 00:18:8b:b1:3c:34  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 18 

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 72:6d:6c:d2:45:82  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.2.108  netmask 255.255.255.0  broadcast 192.168.2.255
        inet6 fe80::219:7dff:fe3d:dc0f  prefixlen 64  scopeid 0x20<link>
        ether 00:19:7d:3d:dc:0f  txqueuelen 1000  (Ethernet)
        RX packets 170677  bytes 128108844 (122.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 154224  bytes 18496509 (17.6 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost ~]# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Any ideas?  export LC_ALL to "C" or "en_US.UTF-8" didn't help.

Joseph



בתאריך יום חמישי, 6 בספטמבר 2012 02:30:57 UTC-4, מאת Axel Bock:

Axel Bock

unread,
Sep 6, 2012, 4:01:02 AM9/6/12
to puppet...@googlegroups.com, stephe...@guardian.co.uk
I have no idea what my init scripts are doing actually :) . I am just wondering why nothing shows up when *I* run puppet agent --test.
And it still confuses me that this seems to be a requirement (which I could not find anywhere ... not that I looked, though :) for a command line tool which usually runs in a localized environment.

hm.

Daniel Pittman

unread,
Sep 6, 2012, 1:55:45 PM9/6/12
to puppet...@googlegroups.com, stephe...@guardian.co.uk
On Thu, Sep 6, 2012 at 1:01 AM, Axel Bock <axel...@arbeitsagentur.de> wrote:
> I have no idea what my init scripts are doing actually :) . I am just
> wondering why nothing shows up when *I* run puppet agent --test.
> And it still confuses me that this seems to be a requirement (which I could
> not find anywhere ... not that I looked, though :) for a command line tool
> which usually runs in a localized environment.

Puppet, and Facter, usually force the environment locale to 'C' before
running external commands - precisely so that you don't have to worry
about this.

If you have found somewhere that doesn't do that, it is clearly and
unambiguously a bug, and you should file a ticket at
http://projects.puppetlabs.com/projects/facter/issues/new

--
Daniel Pittman
⎋ Puppet Labs Developer – http://puppetlabs.com
♲ Made with 100 percent post-consumer electrons
Reply all
Reply to author
Forward
0 new messages