The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com
https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:
Broken handling of facts that look like dates
|Status:||Needs Decision||Start date:|
|Affected Puppet version:||2.7.19||Branch:||https://github.com/puppetlabs/puppet/pull/1281|
Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com
Received the following report from a user about unusual behavior with custom facts whose value looks like a date. I was able to replicate this with PE 2.5.3 under Ubuntu 12.04 and PE 2.6.0 under Ubuntu 10.04 (it’s what I had handy!) by following the steps detailed.
Last night a few of our clients (not all) started reporting as failed in our dashboard. When checking a bit closer the client spits out the following error message when executing a puppet run:
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not intern from b64_zlib_yaml: invalid date warning: Not using cache on failed catalog err: Could not retrieve catalog; skipping run
There was no changes to our puppet manifests at this time. There has been changes to a couple of facts, but this the clients was running just fine with these facts earlier on.
When running with debug and verbose enabled i get the following:
debug: Using cached certificate_revocation_list for ca debug: file_metadata supports formats: b64_zlib_yaml pson raw yaml; using pson debug: Finishing transaction 70037384342420 info: Loading facts in LastUpgrade ...... info: Loading facts in Location info: Loading facts in facter_dot_d debug: catalog supports formats: b64_zlib_yaml dot pson raw yaml; using pson err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not intern from b64_zlib_yaml: invalid date warning: Not using cache on failed catalog err: Could not retrieve catalog; skipping run debug: Using cached certificate for ca debug: Using cached certificate for node1 debug: Using cached certificate_revocation_list for ca debug: Value of 'preferred_serialization_format' (pson) is invalid for report, using default (b64_zlib_yaml) debug: report supports formats: b64_zlib_yaml raw yaml; using b64_zlib_yaml
We found the cause of the problem and this relates to a fact:
Facter.add("LastUpgrade") do setcode do if File.exists?("/tmp/status") file = File.open("/tmp/status") content = file.read content.chomp else content = "Unknown" content.chomp end end end
This fact should read the content of the file as a string. Puppet some how interpret this as a date and fails when the format is wrong.
How to reproduce: 1. add the facts to a client 2. add a line containing “2012-16-10” to /tmp/status 3. execute a new puppet run.
The client will fail with the error message above.
#7 Updated by eric sorenson over 3 years ago
- Status changed from Unreviewed to Needs Decision
- Assignee set to Anonymous
- Branch set to https://github.com/puppetlabs/puppet/pull/1281
David thanks for working on this — from the last comments on the pull request, Jeff wants further tests around this and can be available to help you get started with writing them if you want. OTOH if it’s fixed already in newer versions maybe you don’t have to work to get it fully cleaned up. Feel free to close if that’s case.