JSON object error during preflight

31 views
Skip to first unread message

Brian Call

unread,
Jul 8, 2015, 7:33:57 PM7/8/15
to simian-...@googlegroups.com
Hi there, 

Our team recently set up a couple of test instances of Simian after seeing a compelling demo by Ed & Clay. Thanks to all the devs in advance, this is a really cool piece of software.

After a few small hurdles in getting the app setup, we're getting comfortable, but I have a couple of remaining questions:

1. Icons for managed software center are still unsupported, correct?

2. It appears we have an error related to a json object in the LogintoServer function of preflight.py during preflight on our clients. I'm a python novice so I'm not quite sure what's going wrong there, but if someone could help me interpret this error I'd be grateful. Aside from the traceback seen in the log during preflight, everything seems functionally OK. Here's the output of sudo /usr/local/munki/preflight --debug 


Any advice on this error would be greatly appreciated. Thank you!

/usr/local/munki/simian/lib/python2.6/site-packages/simian-2.4-py2.6.egg/simian/client/gae_client.zip/google/appengine/tools/dev_appserver_login.py:33: DeprecationWarning: the md5 module is deprecated; use hashlib instead
/usr/local/munki/simian/lib/python2.6/site-packages/tlslite-0.3.8-py2.6.egg/tlslite/utils/cryptomath.py:9: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
DEBUG:root:SimianClient.__init__(https://pl-simian-test.appspot.com [default=False], 443, True)
DEBUG:root:LoadHost(https://pl-simian-test.appspot.com, 443)
DEBUG:root:LoadHost(): hostname = pl-simian-test.appspot.com, port = None, use_https = True
DEBUG:root:_LoadRootCertChain()
DEBUG:root:_Get(root_ca_cert_chain_pem_path)
DEBUG:root:_GetExternalValue(root_ca_cert_chain_pem_path)
DEBUG:root:_GetExternalConfiguration(settings)
WARNING:root:Root CA Cert Chain was EMPTY!
DEBUG:root:GetSystemRootCACertChain: Executing ['/usr/bin/security', 'find-certificate', '-a', '-p', '/System/Library/Keychains/SystemRootCertificates.keychain']
DEBUG:root:GetSystemRootCACertChain: returning 323284 bytes
DEBUG:root:LoadCaParameters
DEBUG:root:_Get(ca_id)
DEBUG:root:_GetExternalValue(ca_id)
DEBUG:root:_GetExternalConfiguration(settings)
DEBUG:root:_Get(ca_public_cert_pem)
DEBUG:root:_GetExternalPem(ca_public_cert_pem)
DEBUG:root:_GetExternalConfiguration(ca_public_cert.pem)
DEBUG:root:_Get(server_public_cert_pem)
DEBUG:root:_GetExternalPem(server_public_cert_pem)
DEBUG:root:_GetExternalConfiguration(server_public_cert.pem)
DEBUG:root:_Get(required_issuer)
DEBUG:root:_GetExternalValue(required_issuer)
DEBUG:root:Loaded ca_params
DEBUG:root:_Get(ca_public_cert_pem)
DEBUG:root:_GetExternalPem(ca_public_cert_pem)
DEBUG:root:_Get(server_public_cert_pem)
DEBUG:root:_GetExternalPem(server_public_cert_pem)
DEBUG:root:_Get(required_issuer)
DEBUG:root:_GetExternalValue(required_issuer)
DEBUG:root:Loaded default_ca_params
DEBUG:root:SimianAuthClient._GetPuppetSslDetails
DEBUG:root:GetFacter: facter cache mtime is 2015-07-08 16:27:45
DEBUG:root:GetFacter: reading recent facter cache
DEBUG:root:GetFacter: read 8 entities
DEBUG:root:Certname from facter: "foo-certname"
DEBUG:root:_GetPuppetSslDetails(foo-certname.pem)
DEBUG:root:_ValidatePuppetSslCert: required_issuer CN=Puppet CA generated on it-pemaster-opdx1-test.ops.puppetlabs.net at 2015-06-25 10:41:08 -0700
DEBUG:root:_ValidatePuppetSslCert: default_required_issuer CN=Puppet CA generated on it-pemaster-opdx1-test.ops.puppetlabs.net at 2015-06-25 10:41:08 -0700
DEBUG:root:_ValidatePuppetSslCert: /etc/puppetlabs/puppet/ssl/certs/foo-certname.pem
DEBUG:root:Skipped cert foo-certname.pem, IO Error [Errno 2] No such file or directory: '/etc/puppetlabs/puppet/ssl/certs/foo-certname.pem'
ERROR:root:Failed to harvest Puppet SSL cert facter specified.
DEBUG:root:_GetNewestPuppetSslCert found certs ca.pem clydes-mac.local.pem
DEBUG:root:_ValidatePuppetSslCert: required_issuer CN=Puppet CA generated on it-pemaster-opdx1-test.ops.puppetlabs.net at 2015-06-25 10:41:08 -0700
DEBUG:root:_ValidatePuppetSslCert: default_required_issuer CN=Puppet CA generated on it-pemaster-opdx1-test.ops.puppetlabs.net at 2015-06-25 10:41:08 -0700
DEBUG:root:_ValidatePuppetSslCert: /etc/puppetlabs/puppet/ssl/certs/clydes-mac.local.pem
DEBUG:root:Looking at issuer CN=Puppet CA generated on it-pemaster-opdx1-test.ops.puppetlabs.net at 2015-06-25 10:41:08 -0700
DEBUG:root:_GetPuppetSslDetails found cert clydes-mac.local.pem with timestamp 1435290208.0
DEBUG:root:_GetPuppetSslDetails priv should be /etc/puppetlabs/puppet/ssl/private_keys/clydes-mac.local.pem
DEBUG:root:_Get(ca_id)
DEBUG:root:_GetExternalValue(ca_id)
DEBUG:root:_GetExternalConfiguration(settings)
DEBUG:root:_Get(ca_public_cert_pem)
DEBUG:root:_GetExternalPem(ca_public_cert_pem)
DEBUG:root:_Get(server_public_cert_pem)
DEBUG:root:_GetExternalPem(server_public_cert_pem)
DEBUG:root:_Get(required_issuer)
DEBUG:root:_GetExternalValue(required_issuer)
DEBUG:root:Do(POST, /auth) try #1
DEBUG:root:Connecting to https://pl-simian-test.appspot.com:None
DEBUG:root:Loaded 323284 bytes of CA cert chain and configured ctx
DEBUG:root:SSL configuring with context
DEBUG:root:SSL connect(('pl-simian-test.appspot.com', 443))
DEBUG:root:IsValidCert() ok=0 cert=/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA, returning 0
DEBUG:root:SSL connected ('pl-simian-test.appspot.com', 443)
DEBUG:root:Requesting POST /auth
DEBUG:root:Waiting for response
DEBUG:root:Response status 200
DEBUG:root:Do(POST, /auth) try #1
DEBUG:root:Connecting to https://pl-simian-test.appspot.com:None
DEBUG:root:Loaded 323284 bytes of CA cert chain and configured ctx
DEBUG:root:SSL configuring with context
DEBUG:root:SSL connect(('pl-simian-test.appspot.com', 443))
DEBUG:root:IsValidCert() ok=0 cert=/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA, returning 0
DEBUG:root:SSL connected ('pl-simian-test.appspot.com', 443)
DEBUG:root:Requesting POST /auth
DEBUG:root:Waiting for response
DEBUG:root:Response status 200
INFO:root:headers = {'alternate-protocol': '443:quic,p=1', 'content-length': '10', 'expires': 'Wed, 08 Jul 2015 23:28:09 GMT', 'server': 'Google Frontend', 'cache-control': 'no-cache', 'date': 'Wed, 08 Jul 2015 23:28:09 GMT', 'content-type': 'text/html; charset=utf-8'}
DEBUG:root:Found cookie token.
DEBUG:root:Do(POST, /reports) try #1
DEBUG:root:Connecting to https://pl-simian-test.appspot.com:None
DEBUG:root:Loaded 323284 bytes of CA cert chain and configured ctx
DEBUG:root:SSL configuring with context
DEBUG:root:SSL connect(('pl-simian-test.appspot.com', 443))
DEBUG:root:IsValidCert() ok=0 cert=/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA, returning 0
DEBUG:root:SSL connected ('pl-simian-test.appspot.com', 443)
DEBUG:root:Requesting POST /reports
DEBUG:root:Waiting for response
DEBUG:root:Response status 200
DEBUG:root:Error parsing JSON
Traceback (most recent call last):
  File "/usr/local/munki/simian/lib/python2.6/site-packages/simian-2.4-py2.6.egg/simian/mac/client/preflight.py", line 144, in LoginToServer
    feedback = json.loads(response[len(JSON_PREFIX):])
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/__init__.py", line 307, in loads
    return _default_decoder.decode(s)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py", line 319, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py", line 338, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
DEBUG:root:WriteRootCaCerts
DEBUG:root:_Get(root_ca_cert_chain_pem_path)
DEBUG:root:_GetExternalValue(root_ca_cert_chain_pem_path)
DEBUG:root:_GetExternalConfiguration(settings)
WARNING:root:Root CA Cert Chain was EMPTY!
DEBUG:root:GetSystemRootCACertChain: Executing ['/usr/bin/security', 'find-certificate', '-a', '-p', '/System/Library/Keychains/SystemRootCertificates.keychain']
DEBUG:root:GetSystemRootCACertChain: returning 323284 bytes
DEBUG:root:WriteRootCaCerts: writing to tmp /Library/Managed Installs/certs/tmpyy4CqD
DEBUG:root:WriteRootCaCerts: success
DEBUG:root:Preflight completed successfully.

Any advice on this error would be greatly appreciated. Thank you!

(Repost due to poor log formatting on the original– sorry!) 

Justin McWilliams

unread,
Jul 13, 2015, 2:14:10 PM7/13/15
to simian-...@googlegroups.com
1) icons are not yet submitted, but there's a pending pull request to add the functionality: https://github.com/google/simian/pull/19



2) thankfully that's not a critical error, as you can see preflight is continuing, and completing successfully.  this would happen if your server is running an older version than the client (one that submits plaintext feedback, rather than JSON.


which defaults to an empty dict here (which would not cause this error): https://github.com/google/simian/blob/master/src/simian/mac/munki/handlers/reports.py#L96

so long as the client requests the feedback in json format, as seen here: https://github.com/google/simian/blob/master/src/simian/mac/client/preflight.py#L131


Can you confirm your server is running a Simian revision with the JSON feedback support linked above?

--
You received this message because you are subscribed to the Google Groups "Simian Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simian-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brian Call

unread,
Jul 30, 2015, 12:22:42 AM7/30/15
to Simian Discuss, og...@google.com
Justin,

Thanks for the clarification on what exactly that error meant. You were right that the client must have had an older build. I've upgraded the server and the client installer both through normal maintenance and testing and the message has gone away. Things are looking good!

Thanks again :)

Brian
Reply all
Reply to author
Forward
0 new messages