Failed when searching for node <fqdn>

Server said:
Failed when searching for node <fqdn>: Failed to find <fqdn> via exec:
Execution of '/etc/puppet/node.rb <fqdn>' returned 1

The client said:
Error 400 on SERVER: Failed when searching for node <hostname>

Just wanted you guys to know a possible solution for this error. We
experienced this error in the following environment:

Ubuntu 14.04 64-Bit LTS
Foreman 1.7
Puppet 3.7.3

Windows 8.1 German
Puppet 3.7.3 Agent

We realized it has something to do with the facts our Windows Clients was
sending to the server. Manually executing /etc/puppet/node.rb <fqdn> on the
server side displayed proper results. did not solve it for us. We
ended up by editing the code of C:\Program Files\Puppet
Labs\Puppet\facter\lib\facter\timezone.rb to:

Facter.add("timezone") do
setcode do[^\d\sa-zA-Z.-]/, '')

gsub and regex that allows only a-z, A-Z, 0-9, underscore, dot, hyphen or
whitespace other characters will be replaced by underscore.

\d any digit
\s any whitespace

By this workaround we replaced all German Umlauts äöü (and more)… with an
underscore. This replaced the timezone facter string "Mitteleuropäische
Zeit" to
Zeit" which is ok for us and everything is working fine again with our
Windows Puppet Agents.

Hope this information helps to save some time if you ever experience a
similar behavior.