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

Bug #11319

Macports provider not working properly

Added by Christian Birch over 2 years ago. Updated over 1 year ago.

Status:ClosedStart date:12/09/2011
Priority:NormalDue date:
Assignee:Christian Birch% Done:

0%

Category:package
Target version:-
Affected Puppet version:2.7.8 Branch:
Keywords:macports provider nil

We've Moved!

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

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

‘Not working properly’ isn’t a very useful subject but I’m finding it hard to debug this issue anymore by myself. I’m on OSX 10.7.2 with Puppet 2.7.8 and Macports 2.0.3. Issue was present in 2.7.6 (source) as well and also with 2.6.4 (installed via Macports).

# test.pp
package { 'git' : 
    ensure => 'latest',
    provider => 'macports',
}
# sudo puppet apply test.pp -v
info: Applying configuration version '1323470601'
err: /Stage[main]//Package[git]/ensure: change from absent to latest failed: Could not update: undefined method `[]' for nil:NilClass at /private/etc/puppet/test.pp:4
notice: Finished catalog run in 0.79 seconds

Puppet will complain about “undefined method `[]‘ for nil:NilClass” for any package. Running with debug mode and trace enabled:

# sudo puppet apply test.pp -v -d --trace
Password:
debug: Puppet::Type::Package::ProviderUrpmi: file urpmi does not exist
debug: Puppet::Type::Package::ProviderDpkg: file /usr/bin/dpkg does not exist
debug: Puppet::Type::Package::ProviderUp2date: file /usr/sbin/up2date-nox does not exist
debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/local/sbin/portupgrade does not exist
debug: Puppet::Type::Package::ProviderPkg: file /usr/bin/pkg does not exist
debug: Puppet::Type::Package::ProviderFreebsd: file /usr/sbin/pkg_info does not exist
debug: Puppet::Type::Package::ProviderSun: file /usr/bin/pkginfo does not exist
debug: Puppet::Type::Package::ProviderPacman: file /usr/bin/pacman does not exist
debug: Puppet::Type::Package::ProviderFink: file /sw/bin/fink does not exist
debug: Puppet::Type::Package::ProviderAptitude: file /usr/bin/aptitude does not exist
debug: Puppet::Type::Package::ProviderZypper: file /usr/bin/zypper does not exist
debug: Puppet::Type::Package::ProviderHpux: file /usr/sbin/swremove does not exist
debug: Puppet::Type::Package::ProviderAptrpm: file apt-get does not exist
debug: Puppet::Type::Package::ProviderSunfreeware: file pkg-get does not exist
debug: Puppet::Type::Package::ProviderNim: file /usr/sbin/nimclient does not exist
debug: Puppet::Type::Package::ProviderRug: file /usr/bin/rug does not exist
debug: Puppet::Type::Package::ProviderPortage: file /usr/bin/emerge does not exist
debug: Puppet::Type::Package::ProviderOpenbsd: file pkg_info does not exist
debug: Puppet::Type::Package::ProviderRpm: file rpm does not exist
debug: Puppet::Type::Package::ProviderApt: file /usr/bin/apt-get does not exist
debug: Puppet::Type::Package::ProviderYum: file rpm does not exist
debug: Puppet::Type::Package::ProviderPorts: file /usr/local/sbin/portupgrade does not exist
debug: Puppet::Type::Package::ProviderAix: file /usr/sbin/installp does not exist
debug: Creating default schedules
debug: Failed to load library 'selinux' for feature 'selinux'
debug: Failed to load library 'shadow' for feature 'libshadow'
debug: Failed to load library 'ldap' for feature 'ldap'
debug: Puppet::Type::User::ProviderLdap: feature ldap is missing
debug: Puppet::Type::User::ProviderPw: file pw does not exist
debug: Puppet::Type::User::ProviderUseradd: file chage does not exist
debug: Puppet::Type::User::ProviderUser_role_add: file roleadd does not exist
debug: Puppet::Type::User::ProviderDirectoryservice: Executing '/usr/bin/dscl -plist . -list /Users'
debug: Puppet::Type::User::ProviderDirectoryservice: Executing '/usr/bin/dscl -plist . -read /Users/puppet'
debug: /File[/etc/puppet/ssl/certs]: Autorequiring File[/etc/puppet/ssl]
debug: /File[/var/lib/puppet/state/graphs]: Autorequiring File[/var/lib/puppet/state]
debug: /File[/var/lib/puppet/state/state.yaml]: Autorequiring File[/var/lib/puppet/state]
debug: /File[/etc/puppet/ssl]: Autorequiring File[/etc/puppet]
debug: /File[/var/lib/puppet/clientbucket]: Autorequiring File[/var/lib/puppet]
debug: /File[/var/lib/puppet/facts]: Autorequiring File[/var/lib/puppet]
debug: /File[/var/lib/puppet/log]: Autorequiring File[/var/lib/puppet]
debug: /File[/etc/puppet/ssl/private]: Autorequiring File[/etc/puppet/ssl]
debug: /File[/var/lib/puppet/lib]: Autorequiring File[/var/lib/puppet]
debug: /File[/var/lib/puppet/client_yaml]: Autorequiring File[/var/lib/puppet]
debug: /File[/var/lib/puppet/state/last_run_summary.yaml]: Autorequiring File[/var/lib/puppet/state]
debug: /File[/var/lib/puppet/run]: Autorequiring File[/var/lib/puppet]
debug: /File[/var/lib/puppet/state]: Autorequiring File[/var/lib/puppet]
debug: /File[/var/lib/puppet/state/last_run_report.yaml]: Autorequiring File[/var/lib/puppet/state]
debug: /File[/etc/puppet/ssl/certificate_requests]: Autorequiring File[/etc/puppet/ssl]
debug: /File[/var/lib/puppet/client_data]: Autorequiring File[/var/lib/puppet]
debug: /File[/etc/puppet/ssl/public_keys]: Autorequiring File[/etc/puppet/ssl]
debug: /File[/etc/puppet/ssl/private_keys]: Autorequiring File[/etc/puppet/ssl]
debug: Finishing transaction 2221713900
debug: Loaded state in 0.01 seconds
debug: Loaded state in 0.01 seconds
info: Applying configuration version '1323470916'
debug: /Schedule[daily]: Skipping device resources because running on a host
debug: /Schedule[monthly]: Skipping device resources because running on a host
debug: /Schedule[hourly]: Skipping device resources because running on a host
debug: Prefetching macports resources for package
debug: Puppet::Type::Package::ProviderMacports: Executing '/opt/local/bin/port -q installed'
debug: Puppet::Type::Package::ProviderMacports: Executing '/opt/local/bin/port -q installed git'
debug: Puppet::Type::Package::ProviderMacports: Executing '/opt/local/bin/port -q installed git'
/opt/local/lib/ruby/site_ruby/1.8/puppet/parameter.rb:165:in `fail'
/opt/local/lib/ruby/site_ruby/1.8/puppet/type/package.rb:89:in `set_latest'
/opt/local/lib/ruby/site_ruby/1.8/puppet/property.rb:81:in `send'
/opt/local/lib/ruby/site_ruby/1.8/puppet/property.rb:81:in `call_valuemethod'
/opt/local/lib/ruby/site_ruby/1.8/puppet/property.rb:256:in `set'
/opt/local/lib/ruby/site_ruby/1.8/puppet/property.rb:310:in `sync'
/opt/local/lib/ruby/site_ruby/1.8/puppet/transaction/resource_harness.rb:114:in `apply_parameter'
/opt/local/lib/ruby/site_ruby/1.8/puppet/transaction/resource_harness.rb:56:in `perform_changes'
/opt/local/lib/ruby/site_ruby/1.8/puppet/transaction/resource_harness.rb:133:in `evaluate'
/opt/local/lib/ruby/site_ruby/1.8/puppet/transaction.rb:49:in `apply'
/opt/local/lib/ruby/site_ruby/1.8/puppet/transaction.rb:84:in `eval_resource'
/opt/local/lib/ruby/site_ruby/1.8/puppet/transaction.rb:103:in `evaluate'
/opt/local/lib/ruby/site_ruby/1.8/puppet/util.rb:476:in `thinmark'
/opt/local/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/opt/local/lib/ruby/site_ruby/1.8/puppet/util.rb:475:in `thinmark'
/opt/local/lib/ruby/site_ruby/1.8/puppet/transaction.rb:103:in `evaluate'
/opt/local/lib/ruby/site_ruby/1.8/puppet/transaction.rb:380:in `traverse'
/opt/local/lib/ruby/site_ruby/1.8/puppet/transaction.rb:99:in `evaluate'
/opt/local/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:141:in `apply'
/opt/local/lib/ruby/site_ruby/1.8/puppet/configurer.rb:121:in `retrieve_and_apply_catalog'
/opt/local/lib/ruby/site_ruby/1.8/puppet/util.rb:180:in `benchmark'
/opt/local/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/opt/local/lib/ruby/site_ruby/1.8/puppet/util.rb:179:in `benchmark'
/opt/local/lib/ruby/site_ruby/1.8/puppet/configurer.rb:120:in `retrieve_and_apply_catalog'
/opt/local/lib/ruby/site_ruby/1.8/puppet/configurer.rb:151:in `run'
/opt/local/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:215:in `main'
/opt/local/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:135:in `run_command'
/opt/local/lib/ruby/site_ruby/1.8/puppet/application.rb:306:in `run'
/opt/local/lib/ruby/site_ruby/1.8/puppet/application.rb:410:in `hook'
/opt/local/lib/ruby/site_ruby/1.8/puppet/application.rb:306:in `run'
/opt/local/lib/ruby/site_ruby/1.8/puppet/application.rb:401:in `exit_on_fail'
/opt/local/lib/ruby/site_ruby/1.8/puppet/application.rb:306:in `run'
/opt/local/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:69:in `execute'
/opt/local/bin/puppet:4
err: /Stage[main]//Package[git]/ensure: change from absent to latest failed: Could not update: undefined method `[]' for nil:NilClass at /private/etc/puppet/test.pp:4
debug: /Schedule[never]: Skipping device resources because running on a host
debug: /Schedule[weekly]: Skipping device resources because running on a host
debug: /Schedule[puppet]: Skipping device resources because running on a host
debug: Finishing transaction 2220870220
debug: Storing state
debug: Stored state in 0.04 seconds
notice: Finished catalog run in 0.85 seconds
debug: Finishing transaction 2221816080
debug: Received report to process from cbm.local
debug: Processing report from cbm.local with processor Puppet::Reports::Store

Related issues

Related to Puppet - Bug #17603: Puppet execute has unexpected semantics Accepted

History

#1 Updated by James Turnbull over 2 years ago

  • Description updated (diff)
  • Category set to package

#2 Updated by Josh Cooper over 2 years ago

Hi Christian, We recently fixed a series of macport related issue in master. See https://github.com/puppetlabs/puppet/commit/a52eb6ecaa8dca06639c60f05f3204eefdb4d482. This particular issue may be a duplicate of #8319 when ensuring latest but the package is currently absent. Can you confirm if a build from master resolves the issue for you?

#3 Updated by Josh Cooper over 2 years ago

  • Status changed from Unreviewed to Investigating

#4 Updated by Christian Birch over 2 years ago

Josh: Thanks. I can confirm that using a build from master solves this issue!

Package “git” does not exist within macports though. Maybe that was the actual error that puppet previously couldn’t handle? It now gives me the correct error message:

err: /Stage[main]//Package[git]/ensure: change from absent to latest failed: Could not update: Execution of '/opt/local/bin/port -q install git' returned 1: Error: Port git not found
 at /private/etc/puppet/test.pp:4

Changing package to “git-core” makes it work like a charm which it didn’t previously.

#5 Updated by Andrew Parker over 1 year ago

  • Status changed from Investigating to Closed

This appears to be fixed now based on the previous comment.

Also available in: Atom PDF