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

Error on "purge_unmanaged_queues" with CUPS stopped #251

Open
tequeter opened this issue Feb 25, 2020 · 2 comments
Open

Error on "purge_unmanaged_queues" with CUPS stopped #251

tequeter opened this issue Feb 25, 2020 · 2 comments

Comments

@tequeter
Copy link
Contributor

tequeter commented Feb 25, 2020

Given

  • CentOS 7 with Puppet 6.12 and CUPS 1.6.3.
  • CUPS stopped.

When I apply the manifest

class { 'cups':
  purge_unmanaged_queues => true,
}

In order to remove old queues.

Then I get the error message:

Info: Loading facts
Notice: Compiled catalog for centos-7-x64.x in environment production in 0.09 seconds
Error: /Stage[main]/Cups::Queues::Unmanaged/Resources[cups_queue]: Failed to generate additional resources using 'generate': IPP query 'ipptool -c ipp://localhost/ /dev/stdin' failed.
EXITCODE: 1
STDIN:
          {
            OPERATION CUPS-Get-Classes
            GROUP operation
            ATTR charset attributes-charset utf-8
            ATTR language attributes-natural-language en
            DISPLAY printer-name
            DISPLAY member-names
          }

STDOUT:

STDERR:
ipptool: Unable to connect to localhost on port 631 - Transport endpoint is not connected

Info: Applying configuration version '1582653619'
Notice: /Stage[main]/Cups::Server::Services/Service[cups]/ensure: ensure changed 'stopped' to 'running'
Info: /Stage[main]/Cups::Server::Services/Service[cups]: Unscheduling refresh on Service[cups]
Notice: Applied catalog in 0.39 seconds

The error message doesn't prevent the Puppet run from succeeding, but "normal errors" impede log monitoring, encourage bad practices from operators etc.

NB: additionally, the module does not achieve the desired state because it does not purge any queue on that run, but that would be hard to fix for little gain: on the second run, the CUPS service will be started, the queues will be detected and purged. That's a separate issue and I am not considering it here.

tequeter added a commit to tequeter/puppet-cups that referenced this issue Feb 25, 2020
tequeter added a commit to tequeter/puppet-cups that referenced this issue Feb 25, 2020
@leoarnold
Copy link
Owner

Something about this does not look right. The error stems from /Stage[main]/Cups::Queues::Unmanaged which should be applied after /Stage[main]/Cups::Server::Services/Service[cups]/ensure as per

Class[cups::packages]
-> Class[cups::server]
-> Class[cups::queues]

and /Stage[main]/Cups::Server::Services should not yield until the server is listening again.

@tequeter
Copy link
Contributor Author

The error happens while Puppet discovers existing resources instances. That's before the catalog is applied.

Dependencies and ordering are only considered during catalog application, when Puppet reconciles the discovered state with the desired state.

To illustrate with the error above:

Notice: Compiled catalog for ... # hand off from server
# The agent discovers resources here
Error: ... Failed to generate additional resources using 'generate': IPP ...
Info: Applying configuration version ... # catalog application starts here

IOW, no amount of resource ordering will fix this. Resource instance discovery must work no matter the current node state (CUPS running, stopped, not yet installed, ...).

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