puppet-archive icon indicating copy to clipboard operation
puppet-archive copied to clipboard

archive not found with puppet apply

Open mattford63 opened this issue 8 years ago • 7 comments

puppet-archive seems to ignore the --modulepath setting on execution (at least for me).

Debug: Caching environment 'production' (ttl = 0 sec)
Error: Could not autoload puppet/provider/archive/ruby: Unable to find archive module in modulepath /etc/puppet/modules:/opt/puppetlabs/puppet/modules
Error: Could not autoload puppet/type/archive: Could not autoload puppet/provider/archive/ruby: Unable to find archive module in modulepath /etc/puppet/modules:/opt/puppetlabs/puppet/modules
Error: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/archive: Could not autoload puppet/provider/archive/ruby: Unable to find archive module in modulepath /etc/puppet/modules:/opt/puppetlabs/puppet/modules at /home/matt/src/bitbucket/workstation/puppet/modules/terraform/manifests/init.pp:27:3 on node gamingpc.lan

The run command looks like this

puppet apply --hiera_config=/home/matt/src/bitbucket/workstation/puppet/hiera.yaml --modulepath=/home/matt/src/bitbucket/workstation/puppet/modules:/home/matt/src/bitbucket/workstation/puppet/localmodules /home/matt/src/bitbucket/workstation/puppet/manifests/site.pp --color=true --verbose --debug --show_diff --write-catalog-summary
~/src/bitbucket/workstation

mattford63 avatar Dec 05 '16 17:12 mattford63

After playing around with some different puppet installs it seems as though it defaults to the original search locations.

mattford63 avatar Dec 05 '16 17:12 mattford63

Hi, can you provide a simple reconstruction case?

Is archive behaving differently than other type/provider modules in this context?

ffrank avatar Sep 24 '17 19:09 ffrank

#105 and #225 might be related, though they're in a master-server context, not using puppet apply.

kwisatz avatar Oct 23 '17 08:10 kwisatz

Interesting, although those feel different.

What we'd really need here is a step-by-step how to create an environment that exhibits this specific issue.

ffrank avatar Oct 24 '17 16:10 ffrank

Having the same issues here:

mkdir modules
git clone https://github.com/voxpupuli/puppet-archive modules/archive
cat >> test.pp >> EOF
archive { '/home/mbaur/g10k':
  ensure  => present,
  source  => 'https://github.com/xorpaul/g10k/releases/download/v0.3.14/g10k-linux-amd64.zip',
  extract => true,
}
EOF
puppet apply --modulepath=modules/ test.pp

Leads to this error:

Error: Could not autoload puppet/provider/archive/curl: Could not find parent provider ruby of curl
Error: Could not autoload puppet/type/archive: Could not autoload puppet/provider/archive/curl: Could not find parent provider ruby of curl
Error: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/archive: Could not autoload puppet/provider/archive/curl: Could not find parent provider ruby of curl at /home/mbaur/test.pp:1:1 on node mbaur-gitdevelopment.restvlan4.syseleven

baurmatt avatar Nov 03 '17 15:11 baurmatt

2019-11-08 11:45:50,353 ERROR [puppetserver] Puppet Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/archive: Could not autoload puppet/provider/archive/ruby: Unable to find archive module in modulepath /etc/puppetlabs/code/modules:/opt/puppetlabs/puppet/modules (file: /etc/puppetlabs/code/environments/dev/modules_forge/consul/manifests/install.pp, line: 40, column: 10) on node oomohchahwaiphee
2019-11-08 11:45:50,355 ERROR [puppetserver] Puppet Server Error: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/archive: Could not autoload puppet/provider/archive/ruby: Unable to find archive module in modulepath /etc/puppetlabs/code/modules:/opt/puppetlabs/puppet/modules (file: /etc/puppetlabs/code/environments/dev/modules_forge/consul/manifests/install.pp, line: 40, column: 10) on node oomohchahwaiphee
/etc/puppetlabs/code/environments/dev/modules_forge/archive/lib/puppet/provider/archive/ruby.rb:7:in `<main>'
org/jruby/RubyKernel.java:1022:in `load'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/autoload.rb:66:in `load_file'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/autoload.rb:1:in `block in (root)'
org/jruby/RubyArray.java:1800:in `each'

@ffrank Hey Felix! I'm having a similar error - using Puppet Server v6.7.1 in Docker (Kubernetes).

In another issue they're suggesting running puppet generate types.

Xtigyro avatar Nov 09 '19 11:11 Xtigyro

Running puppet generate types works. To save yall the need to do the same exploration that I did, here's the resource you'll probably want to end up on: https://github.com/puppetlabs/r10k/blob/main/doc/faq.mkd#how-can-run-i-puppet-generate-types-for-each-changed-environment-during-deployment

And since postrun: is also supported by g10k, a config such as this works:

---
:cachedir: '/var/cache/g10k'
:sources: 
  :sccd:
    remote: 'ssh://server/puppet.git'
    branch: not_producton
    basedir: '/etc/puppetlabs/code/environments'
   
postrun: ["/usr/local/bin/generate-puppet-types.sh", "$modifiedenvs"]

kwisatz avatar Mar 08 '22 11:03 kwisatz