Support #19261
closed
unexpected token JSON parse error when reading Puppet environment
Added by Iain Buclaw over 7 years ago.
Updated over 7 years ago.
Description
From web UI:
Error: ERF12-4115 [ProxyAPI::ProxyException]: Unable to get classes from Puppet for production ([RestClient::NotAcceptable]: 406 Not Acceptable) for proxy https://eu-40.sociomantic.com:8443/puppet
From proxy logs:
E, [2017-04-12T19:27:15.695451 ] ERROR -- : Failed to show puppet classes: 795: unexpected token at '�
��line�file�Y/etc/puppetlabs/code/environments/production/modules...'
There's more in the string, but it's all encoded in this manner, so I cannot see where "795" (line? character?) is supposed to be. But it for sure looks like a JSON parser error.
Iain Buclaw wrote:
From proxy logs:
E, [2017-04-12T19:27:15.695451 ] ERROR -- : Failed to show puppet classes: 795: unexpected token at '�
��line�file�Y/etc/puppetlabs/code/environments/production/modules...'
I've just noticed this a little earlier in the day in the same proxy log.
D, [2017-04-12T13:49:09.812987 ] DEBUG -- : signed puppet certificate for newhost
I, [2017-04-12T13:49:09.813669 ] INFO -- : 2a01:4f8:160:442f::2 - - [12/Apr/2017:13:49:09 +0000] "POST /puppet/ca/newhost HTTP/1.1" 200 - 1.2936
D, [2017-04-12T13:49:09.814577 ] DEBUG -- : close: 1234:123:123:1234::2:60380
D, [2017-04-12T13:49:10.258590 ] DEBUG -- : accept: 1234:123:123:1234::2:60382
D, [2017-04-12T13:49:10.261276 ] DEBUG -- : Rack::Handler::WEBrick is invoked.
D, [2017-04-12T13:49:10.261670 ] DEBUG -- : verifying remote client 1234:123:123:1234::2 against trusted_hosts ["foreman"]
E, [2017-04-12T13:49:10.263716 ] ERROR -- : "\xDC" from ASCII-8BIT to UTF-8
D, [2017-04-12T13:49:10.263744 ] DEBUG -- : "\xDC" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
Iain Buclaw wrote:
Iain Buclaw wrote:
From proxy logs:
E, [2017-04-12T19:27:15.695451 ] ERROR -- : Failed to show puppet classes: 795: unexpected token at '�
��line�file�Y/etc/puppetlabs/code/environments/production/modules...'
I've just noticed this a little earlier in the day in the same proxy log.
D, [2017-04-12T13:49:09.812987 ] DEBUG -- : signed puppet certificate for newhost
I, [2017-04-12T13:49:09.813669 ] INFO -- : 2a01:4f8:160:442f::2 - - [12/Apr/2017:13:49:09 +0000] "POST /puppet/ca/newhost HTTP/1.1" 200 - 1.2936
D, [2017-04-12T13:49:09.814577 ] DEBUG -- : close: 1234:123:123:1234::2:60380
D, [2017-04-12T13:49:10.258590 ] DEBUG -- : accept: 1234:123:123:1234::2:60382
D, [2017-04-12T13:49:10.261276 ] DEBUG -- : Rack::Handler::WEBrick is invoked.
D, [2017-04-12T13:49:10.261670 ] DEBUG -- : verifying remote client 1234:123:123:1234::2 against trusted_hosts ["foreman"]
E, [2017-04-12T13:49:10.263716 ] ERROR -- : "\xDC" from ASCII-8BIT to UTF-8
D, [2017-04-12T13:49:10.263744 ] DEBUG -- : "\xDC" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
Sadly, deleting the host does not fix the problem
- Project changed from Foreman to Smart Proxy
- Subject changed from [JSON::ParserError] Error: ERF12-4115 [ProxyAPI::ProxyException]: Unable to get classes from Puppet for production to unexpected token JSON parse error when reading Puppet environment
- Category set to Puppet
Which version of Puppet is the server running? If 4.4 or higher, it would be useful to see the original JSON by calling the Puppet Server's environment_classes
API, else if 4.0-4.3, the resource_types
API.
Also, which versions of smart-proxy and ruby are you using?
Dominic Cleal wrote:
Which version of Puppet is the server running? If 4.4 or higher, it would be useful to see the original JSON by calling the Puppet Server's environment_classes
API, else if 4.0-4.3, the resource_types
API.
- puppet --version
4.10.0
Dmitri Dolguikh wrote:
Also, which versions of smart-proxy and ruby are you using?
Using Foreman-proxy 1.14.3
- ruby --version
ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]
- Tracker changed from Bug to Support
- Status changed from New to Closed
This appears to be an issue with one of the puppet classes, not puppet or smart-proxy themselves. I'm closing the issue, please re-open or create a new should you see it again.
Also available in: Atom
PDF