Jira (PUP-6708) Agent does not save local copy of last_run_report.yaml if submission to report server fails

49 views
Skip to first unread message

Moses Mendoza (JIRA)

unread,
Sep 15, 2016, 5:41:09 PM9/15/16
to puppe...@googlegroups.com
Moses Mendoza created an issue
 
Puppet / Bug PUP-6708
Agent does not save local copy of last_run_report.yaml if submission to report server fails
Issue Type: Bug Bug
Affects Versions: PUP 4.6.2
Assignee: Unassigned
Created: 2016/09/15 2:40 PM
Priority: Normal Normal
Reporter: Moses Mendoza

On an Ubuntu 16.04 VM running Puppet 1.6.2 agent:

The agent does not appear to save a run report if it fails to submit the report to its report server.

root@ubuntu16:~# puppet agent -t --server=foo:1 --report_server=bar:2 --http_connect_timeout=3s --http_debug
opening connection to foo:1:8140...
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: execution expired
Info: Retrieving pluginfacts
opening connection to foo:1:8140...
Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Failed to generate additional resources using 'eval_generate': execution expired
opening connection to foo:1:8140...
Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Could not evaluate: Could not retrieve file metadata for puppet:///pluginfacts: execution expired
Info: Retrieving plugin
opening connection to foo:1:8140...
Error: /File[/opt/puppetlabs/puppet/cache/lib]: Failed to generate additional resources using 'eval_generate': execution expired
opening connection to foo:1:8140...
Error: /File[/opt/puppetlabs/puppet/cache/lib]: Could not evaluate: Could not retrieve file metadata for puppet:///plugins: execution expired
Info: Loading facts
opening connection to foo:1:8140...
Error: Could not retrieve catalog from remote server: execution expired
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
opening connection to bar:2:8140...
Error: Could not send report: execution expired

Afterward, no report is saved on the agent:

oot@ubuntu16:~# puppet config print reportdir
/opt/puppetlabs/puppet/cache/reports
root@ubuntu16:~# ls /opt/puppetlabs/puppet/cache/
clientbucket  client_data  client_yaml  facts.d  lib  preview  state
root@ubuntu16:~# ls /opt/puppetlabs/puppet/cache/state/
classes.txt  graphs  last_run_summary.yaml  resources.txt  state.yaml  transactionstore.yaml
root@ubuntu16:~# find /opt/puppetlabs/ -name "last_run_*"
/opt/puppetlabs/puppet/cache/state/last_run_summary.yaml
root@ubuntu16:~#

We do, however, appear to still save last_run_summary.yaml. The contents of it after this run were:

root@ubuntu16:~# cat /opt/puppetlabs/puppet/cache/state/last_run_summary.yaml
---
version:
  config:
  puppet: 4.6.2
time:
  last_run: 1473975435
root@ubuntu16:~#

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Moses Mendoza (JIRA)

unread,
Sep 15, 2016, 7:22:15 PM9/15/16
to puppe...@googlegroups.com
Moses Mendoza updated an issue
Change By: Moses Mendoza
On an Ubuntu 16.04 VM running Puppet 1.6.2 agent:

The agent does not appear to save a run report if it fails to submit the report to its report server.

*Repro*
{code}

root@ubuntu16:~# puppet agent -t --server=foo:1 --report_server=bar:2 --http_connect_timeout=3s --http_debug
opening connection to foo:1:8140...
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: execution expired
Info: Retrieving pluginfacts
opening connection to foo:1:8140...
Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Failed to generate additional resources using 'eval_generate': execution expired
opening connection to foo:1:8140...
Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Could not evaluate: Could not retrieve file metadata for puppet:///pluginfacts: execution expired
Info: Retrieving plugin
opening connection to foo:1:8140...
Error: /File[/opt/puppetlabs/puppet/cache/lib]: Failed to generate additional resources using 'eval_generate': execution expired
opening connection to foo:1:8140...
Error: /File[/opt/puppetlabs/puppet/cache/lib]: Could not evaluate: Could not retrieve file metadata for puppet:///plugins: execution expired
Info: Loading facts
opening connection to foo:1:8140...
Error: Could not retrieve catalog from remote server: execution expired
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
opening connection to bar:2:8140...
Error: Could not send report: execution expired
{code}

# Afterward, no report is saved on the agent:
{code}

oot@ubuntu16:~# puppet config print reportdir
/opt/puppetlabs/puppet/cache/reports
root@ubuntu16:~# ls /opt/puppetlabs/puppet/cache/
clientbucket  client_data  client_yaml  facts.d  lib  preview  state
root@ubuntu16:~# ls /opt/puppetlabs/puppet/cache/state/
classes.txt  graphs  last_run_summary.yaml  resources.txt  state.yaml  transactionstore.yaml
root@ubuntu16:~# find /opt/puppetlabs/ -name "last_run_*"
/opt/puppetlabs/puppet/cache/state/last_run_summary.yaml
root@ubuntu16:~#
{code}

We do, however, appear to still save {{last_run_summary.yaml}}. The contents of it after this run were:
{code}

root@ubuntu16:~# cat /opt/puppetlabs/puppet/cache/state/last_run_summary.yaml
---
version:
  config:
  puppet: 4.6.2
time:
  last_run: 1473975435
root@ubuntu16:~#
{code}

Geoff Nichols (JIRA)

unread,
Sep 20, 2016, 7:30:03 PM9/20/16
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Sep 20, 2016, 7:31:03 PM9/20/16
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Oct 4, 2016, 7:29:03 PM10/4/16
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Oct 6, 2016, 12:45:04 AM10/6/16
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Oct 12, 2016, 12:42:10 PM10/12/16
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Oct 12, 2016, 12:42:51 PM10/12/16
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Oct 12, 2016, 12:43:07 PM10/12/16
to puppe...@googlegroups.com

Moses Mendoza (JIRA)

unread,
Oct 14, 2016, 5:48:02 PM10/14/16
to puppe...@googlegroups.com
Moses Mendoza commented on Bug PUP-6708
 
Re: Agent does not save local copy of last_run_report.yaml if submission to report server fails

After review on https://github.com/puppetlabs/puppet/pull/5283 it was determined that the initial PR for this was incomplete and needs to be reworked a bit. The original estimate of 3 is probably still accurate.

Geoff Nichols (JIRA)

unread,
Oct 21, 2016, 11:54:05 PM10/21/16
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Nov 16, 2016, 1:43:25 PM11/16/16
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Nov 29, 2016, 8:01:10 PM11/29/16
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Nov 30, 2016, 12:24:09 PM11/30/16
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Dec 13, 2016, 8:27:08 PM12/13/16
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Dec 14, 2016, 1:43:09 PM12/14/16
to puppe...@googlegroups.com

Kevin Corcoran (JIRA)

unread,
Jan 10, 2017, 12:43:02 PM1/10/17
to puppe...@googlegroups.com
Kevin Corcoran commented on Bug PUP-6708
 
Re: Agent does not save local copy of last_run_report.yaml if submission to report server fails

Moses Mendoza said that he thinks this is the cause of intermittent failures of ruby/puppet/acceptance/tests/reports.failover_master.rb in puppet server CI.

Moses Mendoza (JIRA)

unread,
Jan 10, 2017, 12:45:04 PM1/10/17
to puppe...@googlegroups.com
Moses Mendoza commented on Bug PUP-6708

well - I think the root cause of those failures is network issues, but the test ultimately fails because we can't read the report, because the report wasn't written because the report server was unreachable

Kevin Corcoran (JIRA)

unread,
Jan 10, 2017, 12:50:06 PM1/10/17
to puppe...@googlegroups.com

Kevin Corcoran (JIRA)

unread,
Jan 10, 2017, 12:53:03 PM1/10/17
to puppe...@googlegroups.com
Kevin Corcoran commented on CI Blocker PUP-6708
 
Re: Agent does not save local copy of last_run_report.yaml if submission to report server fails

If that was the cause, I would expect other tests to be failing in a similar way, but this is the only test I recall failing recently in that pipeline. But you know better than I do.

Geoff Nichols (JIRA)

unread,
Jan 11, 2017, 1:48:12 PM1/11/17
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Feb 8, 2017, 10:01:07 AM2/8/17
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Feb 8, 2017, 1:41:09 PM2/8/17
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Mar 8, 2017, 2:48:07 AM3/8/17
to puppe...@googlegroups.com
Geoff Nichols updated an issue
Change By: Geoff Nichols
Sprint: Agent  2017-03-22  Ready for Engineering

Kenn Hussey (JIRA)

unread,
Mar 20, 2017, 2:05:03 PM3/20/17
to puppe...@googlegroups.com
Kenn Hussey commented on CI Blocker PUP-6708
 
Re: Agent does not save local copy of last_run_report.yaml if submission to report server fails

Moses Mendoza should we perhaps convert this issue to a bug or is it still blocking CI?

Moses Mendoza (JIRA)

unread,
Mar 20, 2017, 2:19:02 PM3/20/17
to puppe...@googlegroups.com

Kenn Hussey (JIRA)

unread,
Mar 20, 2017, 2:22:15 PM3/20/17
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Mar 22, 2017, 10:20:04 AM3/22/17
to puppe...@googlegroups.com

Maggie Dreyer (JIRA)

unread,
May 16, 2017, 6:31:03 PM5/16/17
to puppe...@googlegroups.com

Jeremy Barlow (JIRA)

unread,
Jun 15, 2017, 2:00:02 AM6/15/17
to puppe...@googlegroups.com
Jeremy Barlow commented on Bug PUP-6708
 
Re: Agent does not save local copy of last_run_report.yaml if submission to report server fails

This one came up again in a recent puppetserver acceptance test run, here:

20:34:20         * master_field should not appear when no master could be conatacted
20:34:20           
20:34:20           rus6ehbzrplkj51.delivery.puppetlabs.net (redhat6-32-2) 03:34:20$ puppet agent -t --config /tmp/puppet_conf_test.vM9ww0 --server_list=badmaster:1 --http_connect_timeout=5s --report_server=f9sy80hlxm12sz1.delivery.puppetlabs.net
20:34:20             Warning: Could not select a functional puppet master
20:34:22             Warning: Unable to fetch my node definition, but the agent run will continue:
20:34:27             Warning: execution expired
20:34:27             Info: Retrieving pluginfacts
20:34:27             Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Failed to generate additional resources using 'eval_generate': execution expired
20:34:32             Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Could not evaluate: Could not retrieve file metadata for puppet:///pluginfacts: execution expired
20:34:37             Info: Retrieving plugin
20:34:37             Error: /File[/opt/puppetlabs/puppet/cache/lib]: Failed to generate additional resources using 'eval_generate': execution expired
20:34:42             Error: /File[/opt/puppetlabs/puppet/cache/lib]: Could not evaluate: Could not retrieve file metadata for puppet:///plugins: execution expired
20:34:47             Error: Could not retrieve catalog from remote server: execution expired
20:34:52             Warning: Not using cache on failed catalog
20:34:52             Error: Could not retrieve catalog; skipping run
20:34:52             Error: Could not send report: execution expired
20:34:57           
20:34:57           rus6ehbzrplkj51.delivery.puppetlabs.net (redhat6-32-2) executed in 36.96 seconds
20:34:57           Exited: 1
20:34:57           
20:34:57           rus6ehbzrplkj51.delivery.puppetlabs.net (redhat6-32-2) 03:34:57$ puppet agent --configprint node_name_value
20:34:57             rus6ehbzrplkj51.delivery.puppetlabs.net
20:34:58           
20:34:58           rus6ehbzrplkj51.delivery.puppetlabs.net (redhat6-32-2) executed in 0.85 seconds
20:34:58           
20:34:58           f9sy80hlxm12sz1.delivery.puppetlabs.net (redhat6-64-1) 03:34:58$ cat /tmp/report_dir.7PPKSO/rus6ehbzrplkj51.delivery.puppetlabs.net/*
20:34:58             cat: /tmp/report_dir.7PPKSO/rus6ehbzrplkj51.delivery.puppetlabs.net/*: No such file or directory

In that case, I didn't see any evidence from the puppetserver.log or puppetserver-access.log file for the target --report-server that it had actually received a report request from the agent – even though the agent appeared to hit the "execution expired" error for the report right after an expiration for the catalog request, both at 20:34:52. The report server was apparently running fine at the time the agent encountered the error, though.

Josh Cooper (Jira)

unread,
Mar 12, 2020, 1:25:03 AM3/12/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-6708

A related issue is that puppet doesn't even attempt to send the report (and doesn't cache one locally) if it exhausts the server_list. We should at least store the report locally. There's another ticket about trying to send the report later.

This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Josh Cooper (Jira)

unread,
Aug 18, 2021, 4:29:02 PM8/18/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-6708

This issue exists the agent uses the indirector to save to the report to the rest terminus and the yaml cache terminus. If the main terminus raises, then the cache terminus' save method is never called https://github.com/puppetlabs/puppet/blob/d567575ba8c5b2c903044b80b0adaab176c8da5d/lib/puppet/indirector/indirection.rb#L316-L319

The agent could decouple those by saving to the main terminus using ignore_cache_terminus: true and saving to the cache using ignore_terminus: true in an ensure block.

This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Josh Cooper (Jira)

unread,
Aug 18, 2021, 5:36:03 PM8/18/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Aug 18, 2021, 5:37:02 PM8/18/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 7.11.0
Fix Version/s: PUP 6.25.0

Josh Cooper (Jira)

unread,
Aug 18, 2021, 5:37:02 PM8/18/21
to puppe...@googlegroups.com

Gabriel Nagy (Jira)

unread,
Aug 19, 2021, 8:54:03 AM8/19/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Aug 20, 2021, 5:36:03 PM8/20/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes: Bug Fix
Release Notes Summary: The agent will now always save a local copy of its last run report, even if it fails to submit the report to the Puppet server.

Josh Cooper (Jira)

unread,
Aug 30, 2021, 2:39:03 AM8/30/21
to puppe...@googlegroups.com

Claire Cadman (Jira)

unread,
Sep 8, 2021, 5:31:02 AM9/8/21
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages