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

Ubuntu 20.04 - Could not prefetch cups_queue provider 'cups' #414

Open
jamesps-ebi opened this issue Aug 13, 2021 · 4 comments
Open

Ubuntu 20.04 - Could not prefetch cups_queue provider 'cups' #414

jamesps-ebi opened this issue Aug 13, 2021 · 4 comments

Comments

@jamesps-ebi
Copy link

Given Ubuntu 20.04, Puppet 6.24, CUPS 2.3.1, leoarnold-cups 2.2.2
When I apply the manifest

class hg_desktop::profile::cups
{
  
  # Printer driver file
  $ppd_name = 'KOC658UX.ppd'
  $ppd_path = "/usr/share/cups/model/${ppd_name}"

  # Install printer drivers
  file { $ppd_path:
    mode    => '0644',
    owner   => 'root',
    group   => 'root',
    source  => "puppet:///modules/hg_desktop/cups/ppd/${ppd_name}",
    require => Class[ 'cups::packages' ],
  }

  # Include Common Unix Printing System
  class { 'cups':
    default_queue => 'Follow_You',
  }

  # Please note for SMB protocol to work, samba client package
  # needs to be installed in the system.
  Class[ 'profile::hiera::packages' ]
  ->
  cups_queue { 'Follow_You':
    ensure       => 'printer',
    enabled      => true,
    accepting    => true,
    description  => 'EBI Follow_You Printing',
    ppd          => $ppd_path,
    uri          => 'smb://EBI/HARDCOPY/Follow_You',
    require      => File[ $ppd_path ],
  }
  ->
  cups_queue { 'FollowMe':
    ensure => absent,
  }

}

In order to add a new network/SMB printer queue
Then I get the following error when running puppet agent -t on the node

Could not prefetch cups_queue provider 'cups': IPP query 'ipptool -t ipp://localhost/ /dev/stdin' failed.
EXITCODE: 1
STDIN:
{
OPERATION CUPS-Get-Printers
GROUP operation
ATTR charset attributes-charset utf-8
ATTR language attributes-natural-language en
DISPLAY printer-name
}

STDOUT:
"/dev/stdin":
/dev/stdin [FAIL]
RECEIVED: 11038 bytes in response
status-code = client-error-bad-request ("media-type-supported": Bad keyword value "thick-1(-2nd)" - invalid character (RFC 8011 section 5.1.4).)
"media-type-supported": Bad keyword value "thick-1(-2nd)" - invalid character (RFC 8011 section 5.1.4).
printer-name (nameWithoutLanguage) = test_new

STDERR:

This is a config we previously had working on Ubuntu 18.04 with cups 2.2.7 and leoarnold-cups 2.0.2 and we're now testing on Ubuntu 20.04 nodes. As far as I can tell the printer in question IS added but is left disabled and not accepting jobs by default (also the above error from puppet agent logs).

@leoarnold
Copy link
Owner

leoarnold commented Aug 14, 2021

Note the lines

status-code = client-error-bad-request ("media-type-supported": Bad keyword value "thick-1(-2nd)" - invalid character (RFC 8011 section 5.1.4).)
"media-type-supported": Bad keyword value "thick-1(-2nd)" - invalid character (RFC 8011 section 5.1.4).

If you compare RFC 8011 section 5.1.4, you will find that thick-1(-2nd) is not a valid keyword because of the parentheses.

If you adjust that line in the PPD file, everything should be okay again I guess. Not sure why CUPS is suddenly(?) picky about this, but keep in mind that Debian / Ubuntu apply their own maintainer patches before building OS packages.

@leoarnold
Copy link
Owner

See also #6 (comment) and #61 (comment).

@jamesps-ebi
Copy link
Author

Thanks for your input. I'll look into your suggestion and see if I can solve this via the PPD file.

@jamesps-ebi
Copy link
Author

jamesps-ebi commented Aug 16, 2021

Looks like you're right. Similar to #6 (comment) I have manually removed any lines from the PPD containing parentheses and the puppet manifest now successfully runs, though I have no idea what the impact of this would be.

So I've reached out to the printer manufacturer to explain the issue since even the latest driver PPD files have this problem. I think this issue can probably be closed since it's more a problem with the printer driver itself.

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

2 participants