Issue #17053 has been reported by Ken Johnson.
----------------------------------------
Bug #17053: Broken handling of facts that look like dates
https://projects.puppetlabs.com/issues/17053
Author: Ken Johnson
Status: Unreviewed
Priority: Normal
Assignee:
Category:
Target version:
Affected Puppet version:
Keywords:
Branch:
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.
--START--
Last night around 01:30 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("Nets_LastUpgrade") do
setcode do
if File.exists?("/usr/local/bap/var/status")
file = File.open("/usr/local/bap/var/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 /usr/local/bap/var/status
3. execute a new puppet run.
The client will fail with the error message above.
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.