Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Could not autoload puppet/type/cups_queue #91

Closed
cmseal opened this issue Jan 11, 2019 · 6 comments
Closed

Could not autoload puppet/type/cups_queue #91

cmseal opened this issue Jan 11, 2019 · 6 comments

Comments

@cmseal
Copy link

cmseal commented Jan 11, 2019

Given Fedora 27 with Puppet 5.5.8 and CUPS 2.2.4.

When I apply the manifest

include '::cups'
cups::resources:
  lab001:
    ensure: printer
    accepting: true
    access:
      policy: allow
      users: ['all']
    description: "Lab001"
    enabled: true
    held: false
    location: "London site"
    make_and_model: "Zebra CPCL Label Printer"
    shared: false
    uri: socket://lab001.lon.example.com:9100
  lab002:
    ensure: printer
    accepting: true
    access:
      policy: allow
      users: ['all']
    description: "Lab002"
    enabled: true
    held: false
    location: "London site"
    make_and_model: "Zebra CPCL Label Printer"
    shared: false
    uri: socket://lab002.lon.example.com:9100

In order to setup printers using hiera

Then I get the error message:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Could not autoload puppet/type/cups_queue: /etc/puppetlabs/code/environments/production/modules_3rdparty/cups/lib/puppet/type/cups_queue.rb:104: unknown type of %string
      return "created a #{should_to_s(new_value)}" unless %i[class printer].include?(current_value)
                                                            ^ (file: /etc/puppetlabs/code/environments/production/modules_3rdparty/cups/manifests/queues/resources.pp, line: 22, column: 5)
@leoarnold
Copy link
Owner

The version of (J)Ruby your Puppet Server is running on is too old to understand the %i percent literal. This means you are using a version of Ruby which has already reached its end-of-life.

Also, this code was added to the module after the latest release which means you are working with a forked or cloned version of the module.

@cmseal
Copy link
Author

cmseal commented Jan 11, 2019

@leoarnold thanks for taking the time to explain it. Much appreciated!

@tparkercbn
Copy link

tparkercbn commented Jun 12, 2019

This is an issue on any servers running puppet 4. They use their own built in ruby which at the moment is: /opt/puppetlabs/puppet/bin/ruby --version
ruby 2.1.9p490 (2016-03-30 revision 54437) [x86_64-linux]

I am running puppet 4.10.12 on Debian 8 which are both listed as compatible in the forge module version 2.2.0.

@leoarnold
Copy link
Owner

@tparkercbn The percent literal was already available in Ruby 2.0.0: https://docs.ruby-lang.org/en/2.0.0/syntax/literals_rdoc.html#label-Percent+Strings

@tparkercbn
Copy link

I agree, so I'm not sure why it's breaking. This is with module version 2.2.0 on server 4.12.10 (on Debian 8) and client 4.10.12 (on Debian 8)

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Type-Name, Could not autoload puppet/type/cups_queue: /etc/puppetlabs/code/environments/production/modules/cups/lib/puppet/type/cups_queue.rb:104: unknown type of %string
return "created a #{should_to_s(new_value)}" unless %i[class printer].include?(current_value)
^ at /etc/puppetlabs/code/environments/production/modules/cups/manifests/queues/default.pp:24:18

leoarnold added a commit that referenced this issue Jun 12, 2019
@leoarnold
Copy link
Owner

@tparkercbn D'Oh: Since Puppet 4, the Puppet Server is written in Clojure and runs on the JVM where it uses some version of JRuby which probably does not support the percent literal.

I dropped the use of percent literals and published version 2.2.1 without it just now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants