facter fails to detect network interfaces with long names

207 views
Skip to first unread message

Alex L. Demidov

unread,
Sep 20, 2011, 1:20:43 PM9/20/11
to Puppet Users
I have Gentoo host where `ifconfig -a` prints long interface names
truncated to 9 chars (there is closed bug report [1]).

Unfortunately, `facter` uses `ifconfig -a` output to get list of
interface names and because of truncation it generates `interfaces`
fact with incorrect interface names. Also it fails to retrieve
individual interface information with following message for
each interface with name "myinterface":

Device "myinterfa" does not exist.
myinterfa: error fetching interface information: Device not found

[1]: https://bugs.gentoo.org/show_bug.cgi?id=179920

--
Alex L. Demidov (ALD9-RIPE).
http://alexeydemidov.com/
Freelance Consulting.

Ken Barber

unread,
Sep 20, 2011, 1:24:40 PM9/20/11
to Puppet Users
Hi Alex,

What happens when you run 'ip addr list' instead?

ken.

> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> 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.
>
>

--
"Join us for PuppetConf, September 22nd and 23rd in Portland, OR:
http://bit.ly/puppetconfsig"

Alex L. Demidov

unread,
Sep 20, 2011, 1:31:14 PM9/20/11
to Puppet Users
On Tue, Sep 20, 2011 at 06:24:40PM +0100, Ken Barber wrote:
> Hi Alex,
>
> What happens when you run 'ip addr list' instead?

It shows interface names properly and not truncated.

Ken Barber

unread,
Sep 20, 2011, 1:50:25 PM9/20/11
to Puppet Users
I think this gives a little weight to this ticket for Facter then:

http://projects.puppetlabs.com/issues/1346

Although - I don't see a 9 char limitation on Debian Wheezy. Not sure
where that patch came from though. I wonder how many other distros
suffer from this.

Of slightly related interest - I do see a 15 character limit when
using 'brctl addbr somelongnamefoo' to create a named interface - and
that seems to exist for both ifconfig and ip addr when reading the
interfaces. So I'm guessing 15 chars is the kernel limit or perhaps
brctl limit :-).

ken.

On Tue, Sep 20, 2011 at 6:31 PM, Alex L. Demidov


<alexey...@gmail.com> wrote:
> On Tue, Sep 20, 2011 at 06:24:40PM +0100, Ken Barber wrote:
>> Hi Alex,
>>
>> What happens when you run 'ip addr list' instead?
>
> It shows interface names properly and not truncated.
>
>>
>> ken.
>>
>> On Tue, Sep 20, 2011 at 6:20 PM, Alex L. Demidov
>> <alexey...@gmail.com> wrote:
>> > I have Gentoo host where `ifconfig -a` prints long interface names
>> > truncated to 9 chars (there is closed bug report [1]).
>> >
>> > Unfortunately, `facter` uses `ifconfig -a` output to get list of
>> > interface names and because of truncation it generates `interfaces`
>> > fact with incorrect interface names. Also it fails to retrieve
>> > individual interface information with following message for
>> > each interface with name "myinterface":
>> >
>> > Device "myinterfa" does not exist.
>> > myinterfa: error fetching interface information: Device not found
>> >
>> > [1]: https://bugs.gentoo.org/show_bug.cgi?id=179920
>
> --
> Alex L. Demidov (ALD9-RIPE).
> http://alexeydemidov.com/
> Freelance Consulting.
>

Alex L. Demidov

unread,
Sep 20, 2011, 2:16:08 PM9/20/11
to Puppet Users
On Tue, Sep 20, 2011 at 06:50:25PM +0100, Ken Barber wrote:
> I think this gives a little weight to this ticket for Facter then:
>
> http://projects.puppetlabs.com/issues/1346
>
> Although - I don't see a 9 char limitation on Debian Wheezy. Not sure
> where that patch came from though. I wonder how many other distros
> suffer from this.

It seems that they (and RHEL/Fedora) patched this long ago.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=405521

>
> Of slightly related interest - I do see a 15 character limit when
> using 'brctl addbr somelongnamefoo' to create a named interface - and
> that seems to exist for both ifconfig and ip addr when reading the
> interfaces. So I'm guessing 15 chars is the kernel limit or perhaps
> brctl limit :-).

Luckily all my interface names under 15 chars length.

Matthew Marlowe

unread,
Sep 20, 2011, 10:52:44 PM9/20/11
to puppet...@googlegroups.com
All,

I put in a request to have the gentoo bug reopened and see if we can
apply the same patch that the other distributions used.

Thanks,
Matt

On Tue, Sep 20, 2011 at 11:16 AM, Alex L. Demidov

Adrien Thebo

unread,
Sep 21, 2011, 2:14:19 PM9/21/11
to puppet...@googlegroups.com
Looking at the gentoo response in the ticket, the decision to maintain the interface truncation looks pretty final. Regardless of this, supporting iproute2 should be a priority, since I've heard of minimal arch installs that don't include net-tools at all and we can expect the trend towards iproute2 to continue.
Adrien Thebo
Puppet Labs Operations

Reply all
Reply to author
Forward
0 new messages