The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:

Bug #7038

Cannot use prtdiag in Solaris non-global zones

Added by Jeremiah Shirk over 4 years ago. Updated over 3 years ago.

Status:ClosedStart date:04/11/2011
Priority:NormalDue date:
Assignee:Adrien Thebo% Done:

0%

Category:library
Target version:1.6.3
Keywords:solaris, prtdiag, global zone Affected Facter version:1.5.9
Branch:https://github.com/adrienthebo/facter/tree/ticket/1.6.x/7038-safe_prtdiag_output_checking_in_zones

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com


Description

Found in 1.5.9rc5. facter tries to use prtdiag in Solaris zones, but this will only work in the global zone. Let me know if I can provide more info.

$ facter -d    
Caught recursion on kernel
value for kernel is still nil
value for macaddress is still nil
Found no suitable resolves of 1 for arp
value for arp is still nil
Not an EC2 host
prtdiag can only be run in the global zone
Error: private method `split' called for nil:NilClass

Related issues

Related to Facter - Bug #7726: Facter should not call prtconf inside a Solaris zone Closed 05/31/2011
Related to Facter - Bug #7753: Errors when adding a resolve should not crash facter Closed 06/01/2011
Duplicated by Facter - Bug #10179: Could not run Puppet configuration client: Could not retr... Duplicate 10/19/2011

History

#1 Updated by James Turnbull over 4 years ago

  • Category set to library
  • Status changed from Unreviewed to Investigating
  • Assignee set to Adrien Thebo

#2 Updated by James Turnbull over 4 years ago

  • Affected Facter version set to 1.5.9

#3 Updated by Adrien Thebo over 4 years ago

  • Status changed from Investigating to In Topic Branch Pending Review
  • Branch set to https://github.com/adrienthebo/facter/tree/tickets/next/7038

#4 Updated by Jeremiah Shirk over 4 years ago

I installed adrienthebo-facter-e28956d on my test system. With that in place, the prtdiag error is gone, and all of the key/value pairs in the output look reasonable.

I do see the following in STDERR, which might be interesting:

$ facter -d 1>/dev/null
prtconf: devinfo facility not available
/as/app/ruby/1.8.7-p334/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not found: dnsdomainname
sh: sysctl: not found

#5 Updated by Adrien Thebo over 4 years ago

I was able to duplicate the prtconf output to stderr; for the other two I did not see. I believe these should be filed in a separate issue, and I can look into fixing them there.

#6 Updated by James Turnbull over 4 years ago

  • Target version changed from 1.5.9 to 1.6.0

#7 Updated by Mark Phillips about 4 years ago

Adrien Thebo wrote:

I was able to duplicate the prtconf output to stderr; for the other two I did not see. I believe these should be filed in a separate issue, and I can look into fixing them there.

Hi – has that been done? i.e. is the prtconf issue a separate ticket?

It’s easy enough to cater for by changing the prtconf to prtconf 2>/dev/null

#8 Updated by Adrien Thebo about 4 years ago

Separate branch for removing the prtconf output can be found at #7726

#9 Updated by Mark Phillips about 4 years ago

Looks like it doesn’t work on T5220s either:

testing9s:puppet# facter
prtdiag: not implemented on SUNW,SPARC-Enterprise-T5220
Error: private method `split' called for nil:NilClass

#10 Updated by Adrien Thebo about 4 years ago

These failures are really manifestations of #7753, which I’ll also fix. But to verify – on the Sun T5220, prtdiag only returns not implemented on SUNW,SPARC-Enterprise-T5220, right?

#11 Updated by Mark Phillips about 4 years ago

Adrien Thebo wrote:

These failures are really manifestations of #7753, which I’ll also fix. But to verify – on the Sun T5220, prtdiag only returns not implemented on SUNW,SPARC-Enterprise-T5220, right?

Correct. And yes, this is all 7753 really. Should be handling things like this much better.

#12 Updated by Adrien Thebo about 4 years ago

Mark Phillips wrote:

Adrien Thebo wrote:

These failures are really manifestations of #7753, which I’ll also fix. But to verify – on the Sun T5220, prtdiag only returns not implemented on SUNW,SPARC-Enterprise-T5220, right?

Correct. And yes, this is all 7753 really. Should be handling things like this much better.

I realized that I didn’t ask this earlier – this is a zone on a sun T5220, right?

#13 Updated by Mark Phillips about 4 years ago

Adrien Thebo wrote:

Mark Phillips wrote:

Adrien Thebo wrote:

These failures are really manifestations of #7753, which I’ll also fix. But to verify – on the Sun T5220, prtdiag only returns not implemented on SUNW,SPARC-Enterprise-T5220, right?

Correct. And yes, this is all 7753 really. Should be handling things like this much better.

I realized that I didn’t ask this earlier – this is a zone on a sun T5220, right?

Hey Adrien,

In this case, no – it’s Solaris 9.

#14 Updated by Mark Phillips about 4 years ago

This, however, is a zone …

testing10s:~ root# facter facterversion
prtdiag can only be run in the global zone
Error: private method `split' called for nil:NilClass

#15 Updated by Adrien Thebo about 4 years ago

Mark Phillips wrote:

This, however, is a zone …

[…]

Could you test the updated facter at https://github.com/adrienthebo/facter/tree/tickets/next/7038 and see if that works?

#16 Updated by Mark Phillips about 4 years ago

Adrien Thebo wrote:

Mark Phillips wrote:

This, however, is a zone …

[…]

Could you test the updated facter at https://github.com/adrienthebo/facter/tree/tickets/next/7038 and see if that works?

Hi Adrien,

Thanks – will try and get a chance to test over the weekend and let you know.

—Mark

#17 Updated by Paul Armstrong about 4 years ago

uname -a
SunOS builder.int.otoh.org 5.11 snv_151a i86pc i386 i86pc

/opt/3rd-party/bin/facter  -v
1.5.9-adrienthebo

/opt/3rd-party/bin/facter  -d
Caught recursion on kernel
value for kernel is still nil
Found no suitable resolves of 1 for arp
value for arp is still nil
Not an EC2 host
prtconf: devinfo facility not available
Error: private method `split' called for nil:NilClass

Still errors out with error code 12

#18 Updated by Paul Armstrong about 4 years ago

This is probably more useful:

/opt/3rd-party/bin/facter --trace --debug
Caught recursion on kernel
value for kernel is still nil
Found no suitable resolves of 1 for arp
value for arp is still nil
Not an EC2 host
prtconf: devinfo facility not available
/usr/ruby/1.8/lib/ruby/site_ruby/1.8/facter/util/memory.rb:44:in `vmstat_find_free_memory': private method `split' called for nil:NilClass (NoMethodError)
        from /usr/ruby/1.8/lib/ruby/site_ruby/1.8/facter/memory.rb:207
        from /usr/ruby/1.8/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73:in `load'
        from /usr/ruby/1.8/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73:in `load_file'
        from /usr/ruby/1.8/lib/ruby/site_ruby/1.8/facter/util/loader.rb:38:in `load_all'
        from /usr/ruby/1.8/lib/ruby/site_ruby/1.8/facter/util/loader.rb:33:in `each'
        from /usr/ruby/1.8/lib/ruby/site_ruby/1.8/facter/util/loader.rb:33:in `load_all'
        from /usr/ruby/1.8/lib/ruby/site_ruby/1.8/facter/util/loader.rb:30:in `each'
        from /usr/ruby/1.8/lib/ruby/site_ruby/1.8/facter/util/loader.rb:30:in `load_all'
        from /usr/ruby/1.8/lib/ruby/site_ruby/1.8/facter/util/collection.rb:90:in `load_all'
        from /usr/ruby/1.8/lib/ruby/site_ruby/1.8/facter.rb:102:in `to_hash'
        from /usr/ruby/1.8/lib/ruby/site_ruby/1.8/facter/application.rb:14:in `run'
        from /opt/3rd-party/bin/facter:60

#19 Updated by Adrien Thebo about 4 years ago

Paul,

Could you provide platform info for this? Does vmstat or prtconf provide any output on stdout on the host exhibiting errors?

#20 Updated by Adrien Thebo about 4 years ago

  • Branch changed from https://github.com/adrienthebo/facter/tree/tickets/next/7038 to https://github.com/adrienthebo/facter/tree/ticket%2Fmaster%2F7038

Rebased branch against master

#21 Updated by Paul Armstrong about 4 years ago

There’s a separate bug here that I tripped up (related, you might want to fix it in the same change). If an externally called binary fails, facter propagates it as a stack trace rather than handling it properly.

vmstat fails on this host (I made a config change a broke a device file it needed). Once I make vmstat work again, your code works fine.

Is this the platform info you were after? ruby 1.8.7 (2009-06-12 patchlevel 174) [i386-solaris2.11]

#22 Updated by Paul Armstrong about 4 years ago

Here’s the facter output after I made vmstat work:

/opt/3rd-party/bin/facter -d
Caught recursion on kernel
value for kernel is still nil
Found no suitable resolves of 1 for arp
value for arp is still nil
Not an EC2 host
prtconf: devinfo facility not available
Found no suitable resolves of 1 for selinux
value for selinux is still nil
Found no suitable resolves of 1 for selinux_config_policy
value for selinux_config_policy is still nil
value for ipaddress6_builder0 is still nil
Found no suitable resolves of 2 for architecture
value for architecture is still nil
value for ipaddress6 is still nil
Found no suitable resolves of 1 for arp_lo0
value for arp_lo0 is still nil
Found no suitable resolves of 1 for xendomains
value for xendomains is still nil
Found no suitable resolves of 2 for lsbrelease
value for lsbrelease is still nil
Found no suitable resolves of 1 for arp
value for arp is still nil
Found no suitable resolves of 1 for selinux
value for selinux is still nil
Found no suitable resolves of 1 for selinux_config_mode
value for selinux_config_mode is still nil
Found no suitable resolves of 1 for vlans
value for vlans is still nil
Found no suitable resolves of 2 for lsbdistid
value for lsbdistid is still nil
value for puppetversion is still nil
Found no suitable resolves of 2 for lsbdistcodename
value for lsbdistcodename is still nil
Found no suitable resolves of 1 for selinux
value for selinux is still nil
Found no suitable resolves of 1 for selinux_current_mode
value for selinux_current_mode is still nil
Found no suitable resolves of 1 for selinux
value for selinux is still nil
Found no suitable resolves of 1 for lsbmajdistrelease
value for lsbmajdistrelease is still nil
Found no suitable resolves of 2 for iphostnumber
value for iphostnumber is still nil
Found no suitable resolves of 1 for physicalprocessorcount
value for physicalprocessorcount is still nil
Found no suitable resolves of 1 for selinux
value for selinux is still nil
Found no suitable resolves of 1 for selinux_policyversion
value for selinux_policyversion is still nil
value for macaddress_lo0 is still nil
Found no suitable resolves of 2 for architecture
value for architecture is still nil
Found no suitable resolves of 2 for lsbdistrelease
value for lsbdistrelease is still nil
Found no suitable resolves of 1 for selinux
value for selinux is still nil
Found no suitable resolves of 1 for selinux_enforced
value for selinux_enforced is still nil
value for cfkey is still nil
value for ipaddress6_lo0 is still nil
Found no suitable resolves of 1 for arp_builder0
value for arp_builder0 is still nil
Found no suitable resolves of 1 for swapencrypted
value for swapencrypted is still nil
Found no suitable resolves of 2 for lsbdistdescription
value for lsbdistdescription is still nil
Found no suitable resolves of 1 for selinux
value for selinux is still nil
Found no suitable resolves of 1 for selinux_mode
value for selinux_mode is still nil
domain => int.otoh.org
facterversion => 1.5.9-adrienthebo
fqdn => builder.int.otoh.org
hardwareisa => i386
hardwaremodel => i86pc
hostname => builder
id => root
interfaces => lo0,builder0
ipaddress => 172.16.32.90
ipaddress_builder0 => 172.16.32.90
ipaddress_lo0 => 127.0.0.1
is_virtual => true
kernel => SunOS
kernelmajversion => snv_151a
kernelrelease => 5.11
kernelversion => snv_151a
macaddress => 2:8:20:f3:8:75
macaddress_builder0 => 2:8:20:f3:8:75
memoryfree => 12.02 GB
memorysize => 15.75 GB
netmask => 255.255.255.0
netmask_builder0 => 255.255.255.0
netmask_lo0 => 255.0.0.0
network_builder0 => 172.16.32.0
network_lo0 => 127.0.0.0
operatingsystem => Solaris
operatingsystemrelease => 5.11
path => /usr/sbin:/usr/bin
ps => ps -ef
rubysitedir => /usr/ruby/1.8/lib/ruby/site_ruby/1.8
rubyversion => 1.8.7
sshdsakey => AAAAB3NzaC1kc3MAAACBANHaDMumyyoJRjeBCGCm6tMkgAX6RWqzqrrhbQaTndmZAf13RJNQmETnru2qCV9SDQDfMkZ0Et1VkVctGIs+gAswbfs7zTdBY3gupig7maLoCjrX5vxfvnFOUR7dlwh+MI1SqlsGQl6dFF8JIlGGCU4xkCyF3op55NVVkWA3eLIpAAAAFQDGskgy86rlLqKQbgF1jFS4o5PnHQAAAIA0XW9WYyNaz+LIQHOdxjn1RuHqmofVZb4vRAdtKTP7BrrV3PSi4P1VLIGBb3PhtNcDimyIsDk9i+8xtSdZKjXYSJDNnTb9IGpD5VfsHkkB5ppUA4mnDaVtNKlygQZ65NZXcWKLmQCNQrmIgmGES/eWajlMkYuYddech2p9sXmfCwAAAIAFixDhryUAmKn5ndAf6B2iI9QJnxUeUUC0dyNLeGKuntKPAoUPOVupxXM/MJ2gk8PICTjX1x653BkTM73jwxIK3D2/ywA0PKADb4491J46fq06KHM2v5QJfRNXI5Tffb9bi2KUU14keBhjfDKPNH71BLrwSfufOx5153vBJEpKRQ==
sshrsakey => AAAAB3NzaC1yc2EAAAABIwAAAQEA1CmNxlyilqbZUnVzLy7cAOW0ZrAzc9uP6arjltv4w+OzH9MwIBQ+Z91Od0L8iavTbT4dRyRdpPRS8Vi9yXNDZpwW6s/yL9hB4gpRsaabUBfhIYv9Hy4cFT/Qikcw3UdzbBcQpQAbJdTyncoLTxGcJjBm28tfo1cLylZnDUNBmLJwt1Ib97k2oQW49j6knfcHkqg3YBQp+m6pfVLPy1TclXtq+LGR06kdP7YiJyQqOe+wUGZtP21iwyAC2lPd4iXVmqu7d5OJU9XKtpz4A32XjeQ5MEfqNQrP0RYwvnSFL/MswV9MwMXKUea24bYAv92y8frIho9OyEcVmop1vPNyqQ==
swapfree => 7.87 GB
swapsize => 7.87 GB
timezone => UTC
uniqueid => 00c73c34
uptime => 15046 days
uptime_days => 15046
uptime_hours => 361114
uptime_seconds => 1300013493
virtual => zone

#23 Updated by Mark Phillips about 4 years ago

Paul – thanks for getting in there with the testing, I’ve not had the opportunity.

#24 Updated by Michael Stahnke about 4 years ago

  • Target version changed from 1.6.0 to 144

#25 Updated by Mark Phillips about 4 years ago

Looks better folks, but there’s still a small whinge:


root@testing10s # facter
prtdiag can only be run in the global zone
prtconf: devinfo facility not available

But then it does actually work, rather than bomb out.

Calling individual variables looks ok:

root@testing10s # facter facterversion
1.6.0

#26 Updated by Adrien Thebo about 4 years ago

Mark Phillips wrote:

Looks better folks, but there’s still a small whinge:

[…]

But then it does actually work, rather than bomb out.

Calling individual variables looks ok:

[…]

This is stuff being pumped out on stderr, right? And is this against facter 1.6.0, or the updated branch in this ticket?

#27 Updated by Mark Phillips about 4 years ago

This was against your branch code Adrien.

#28 Updated by Adrien Thebo about 4 years ago

Silencing the output for prtconf was actually done in #7726, in a separate branch. It should be merged in the next release of facter.

#29 Updated by Adrien Thebo almost 4 years ago

  • Branch changed from https://github.com/adrienthebo/facter/tree/ticket%2Fmaster%2F7038 to https://github.com/adrienthebo/facter/tree/ticket/1.6.x/7038-safe_prtdiag_output_checking_in_zones

Rewrote the patch against 1.6.2.

#30 Updated by Ken Barber almost 4 years ago

  • Keywords set to solaris, prtdiag, global zone

Added some review comments to the pull request Adrien.

#31 Updated by Ken Barber almost 4 years ago

  • Status changed from In Topic Branch Pending Review to Merged - Pending Release
  • Target version changed from 144 to 1.6.3

#32 Updated by Ken Barber over 3 years ago

  • Status changed from Merged - Pending Release to Closed

Also available in: Atom PDF