puppetdb can't delete reports in the future

170 views
Skip to first unread message

Ryan Anderson

unread,
Dec 30, 2014, 12:37:38 PM12/30/14
to puppet...@googlegroups.com
I have some systems that were deliberately changed to a time in the future for testing, then changed back to normal when done. They work with puppet fine now, but their puppetdb reports have timestamps in the future and new reports will not be added. They show up in puppetboard with the inaccurate status of their 'last' report (which is/was in the future), and I am unable to get rid of the reports with 'puppet node deactivate'. How can I get rid of these reports? Normally, one would toy around with the report-ttl setting, but that is not working for me. Will this require a postgresql command?

Wyatt Alt

unread,
Dec 31, 2014, 2:28:36 AM12/31/14
to puppet...@googlegroups.com, Ryan Anderson
Hey Ryan,

That makes sense, though I'd guess that new reports are being stored and
are available through the API, they just aren't reflected as "latest"
since that's determined by the end_time stamp. report-ttl will be
ineffective without resetting to the future, and then you'd be deleting
reports you may want to keep.

Best bet would be to clear them manually in psql:

delete from reports where end_time > current_timestamp;

Wyatt
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to puppet-users...@googlegroups.com
> <mailto:puppet-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/2c8fd749-b5f4-4736-9f32-2c8cd712ca51%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/2c8fd749-b5f4-4736-9f32-2c8cd712ca51%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

Ryan Anderson

unread,
Jan 5, 2015, 12:05:14 PM1/5/15
to puppet...@googlegroups.com, ryan.c....@gmail.com
Wow, thanks, this worked great for me. In case it helps others, here are the commands in more detail:

# Connect to postgresql
psql -h localhost -d puppetdb -U puppetdb -W
# The psql prompt
puppetdb=> delete from reports where end_time > current_timestamp;
# Disconnect
puppetdb=> \q
Reply all
Reply to author
Forward
0 new messages