Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

puppet_agent::run plan doesn't recognize failed puppet run #737

Open
bastelfreak opened this issue Nov 1, 2024 · 0 comments
Open

puppet_agent::run plan doesn't recognize failed puppet run #737

bastelfreak opened this issue Nov 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@bastelfreak
Copy link
Collaborator

Describe the Bug

I've a node that doesn't receive a working catalog:

[root@elastic01 ~]# puppet agent -t
Info: Using environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Notice: Requesting catalog from puppet:8140 (10.0.1.1)
Notice: Catalog compiled by puppet
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Could not find resource 'Class[Elastic_stack::Repo]' for relationship on 'Class[Elasticsearch::Package]' on node elastic01
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
[root@elastic01 ~]#

When I run bolt plan run puppet_agent::run --targets elastic01

Starting: plan puppet_agent::run
Starting: Check for Puppet agent on elastic01
Finished: Check for Puppet agent with 0 failures in 2.6 sec
Starting: Run Puppet agent on elastic01
Finished: Run Puppet agent with 0 failures in 13.98 sec
Finished: plan puppet_agent::run in 16.59 sec
Finished on elastic01:
  Info: Using environment 'production'
  Info: Retrieving pluginfacts
  Info: Retrieving plugin
  Info: Loading facts
  Notice: Requesting catalog from puppet:8140 (10.0.1.1)
  Notice: Catalog compiled by puppet
  {
    "report": {
      "host": "elastic01",
      "time": "2024-11-01T18:33:25.278068282+01:00",
      "configuration_version": null,
      "transaction_uuid": "abd4b06e-4abb-4313-bfe0-2f4784d2e9ed",
      "report_format": 12,
      "puppet_version": "8.8.1",
      "status": "failed",
      "transaction_completed": false,
      "noop": false,
      "noop_pending": false,
      "environment": "production",
      "logs": [
        {
          "level": "info",
          "message": "Using environment 'production'",
          "source": "Puppet",
          "tags": [
            "info"
          ],
          "time": "2024-11-01T18:33:25.621086284+01:00",
          "file": null,
          "line": null
        },
        {
          "level": "info",
          "message": "Retrieving pluginfacts",
          "source": "Puppet",
          "tags": [
            "info"
          ],
          "time": "2024-11-01T18:33:25.695307560+01:00",
          "file": null,
          "line": null
        },
        {
          "level": "info",
          "message": "Retrieving plugin",
          "source": "Puppet",
          "tags": [
            "info"
          ],
          "time": "2024-11-01T18:33:25.754770248+01:00",
          "file": null,
          "line": null
        },
        {
          "level": "info",
          "message": "Loading facts",
          "source": "Puppet",
          "tags": [
            "info"
          ],
          "time": "2024-11-01T18:33:28.769399749+01:00",
          "file": null,
          "line": null
        },
        {
          "level": "notice",
          "message": "Requesting catalog from puppet:8140 (10.0.1.1)",
          "source": "Puppet",
          "tags": [
            "notice"
          ],
          "time": "2024-11-01T18:33:29.914082743+01:00",
          "file": null,
          "line": null
        },
        {
          "level": "notice",
          "message": "Catalog compiled by puppet",
          "source": "Puppet",
          "tags": [
            "notice"
          ],
          "time": "2024-11-01T18:33:33.747198975+01:00",
          "file": null,
          "line": null
        },
        {
          "level": "err",
          "message": "Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Could not find resource 'Class[Elastic_stack::Repo]' for relationship on 'Class[Elasticsearch::Package]' on node elastic01",
          "source": "Puppet",
          "tags": [
            "err"
          ],
          "time": "2024-11-01T18:33:33.748008863+01:00",
          "file": null,
          "line": null
        },
        {
          "level": "warning",
          "message": "Not using cache on failed catalog",
          "source": "Puppet",
          "tags": [
            "warning"
          ],
          "time": "2024-11-01T18:33:33.748174011+01:00",
          "file": null,
          "line": null
        },
        {
          "level": "err",
          "message": "Could not retrieve catalog; skipping run",
          "source": "Puppet",
          "tags": [
            "err"
          ],
          "time": "2024-11-01T18:33:33.748301569+01:00",
          "file": null,
          "line": null
        }
      ],
      "metrics": {
        "resources": {
          "name": "resources",
          "label": "Resources",
          "values": [
            [
              "total",
              "Total",
              0
            ],
            [
              "skipped",
              "Skipped",
              0
            ],
            [
              "failed",
              "Failed",
              0
            ],
            [
              "failed_to_restart",
              "Failed to restart",
              0
            ],
            [
              "restarted",
              "Restarted",
              0
            ],
            [
              "changed",
              "Changed",
              0
            ],
            [
              "out_of_sync",
              "Out of sync",
              0
            ],
            [
              "scheduled",
              "Scheduled",
              0
            ],
            [
              "corrective_change",
              "Corrective change",
              0
            ]
          ]
        },
        "time": {
          "name": "time",
          "label": "Time",
          "values": [
            [
              "startup_time",
              "Startup time",
              0.342585476
            ],
            [
              "plugin_sync",
              "Plugin sync",
              3.0698982240000987
            ],
            [
              "fact_generation",
              "Fact generation",
              1.1442879470000662
            ],
            [
              "total",
              "Total",
              8.470369591
            ]
          ]
        },
        "changes": {
          "name": "changes",
          "label": "Changes",
          "values": [
            [
              "total",
              "Total",
              0
            ]
          ]
        },
        "events": {
          "name": "events",
          "label": "Events",
          "values": [
            [
              "total",
              "Total",
              0
            ],
            [
              "failure",
              "Failure",
              0
            ],
            [
              "success",
              "Success",
              0
            ]
          ]
        }
      },
      "resource_statuses": {
      },
      "corrective_change": false,
      "cached_catalog_status": "not_used"
    },
    "exitcode": 1
  }
Successful on 1 target: elastic01
Ran on 1 target

Expected Behavior

I expect that I see a proper error message.

Steps to Reproduce

  • create broken puppet code that doesn't compile
  • run the puppet_agent::run plan

Environment

  • puppetlabs-puppet_agent 4.21.0

Additional Context

Add any other context about the problem here.

@bastelfreak bastelfreak added the bug Something isn't working label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant