windowspuppet

Undefined resource 'archive' after installing `puppet-archive`


After installing the puppet-archive module via r10k, Puppet does not recognize the resource, despite seemingly correctly including it, and throws the following error:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER:
  Server Error: Evaluation Error:
  Error while evaluating a Resource Statement, Unknown resource type: 'archive'
    (file: /etc/puppetlabs/code/environments/repro_issue/modules/role/manifests/archive_issue/archive_issue.pp, line: 4, column: 6)
    on node MY_NODE

On the server, however, I can see things look correct:

$ puppet module list --environment repro_issue | grep "archive"
├── puppet-archive (v7.1.0)
$ puppet config print modulepath --environment repro_issue
/etc/puppetlabs/code/environments/repro_issue/modules

Puppetfile

mod 'puppet-archive', '7.1.0'
mod 'puppetlabs/stdlib', '9.6.0'

Node Definition

node /MY_NODE/ {
  include role::archive_issue::archive_issue
}

Role Contents

#
class role::archive_issue::archive_issue {
  include 'archive'
  -> archive { 'C:\\nginx-1.27.0.zip':
    ensure       => present,
    source       => 'https://nginx.org/download/nginx-1.27.0.zip',
    extract_path => 'C:\\',
  }
}

What am I missing? We have other modules that work correctly (puppetlabs-apache, puppetlabs-python, puppetlabs-apt) -- it just seems to be the addition of new modules that doesn't work.


Solution

  • This issue is caused by missing resource types on the server, and can be fixed manually by running puppet generate types --environment $ENVIRONMENT.

    When deploying via r10k, the process may be automated by adding a post-run action that generates types for all modified environments, as documented in the r10k FAQ.