letsencrypt-dcos
letsencrypt-dcos copied to clipboard
ValueError: No JSON object could be decoded
When launching the container, it fails with:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/json/__init__.py", line 290, in load
**kw)
File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Is there any more context in the log? This isn't enough for me to even guess at what's happening.
I have the same problem, and no more logs in the stack ;/
@brndnmtthws did you manage to resolve it?
I haven't seen the problem myself, but I'll see what I can do.
@brndnmtthws in my case that was being hooked to the wrong marathon api endpoint.
I had it pointed to marathon-user API end point, so python could not find the app id.
false hopes.. still erroring in the same manner... and no certs... just app not crashing now.. :P
This is my test if that helps:
command: curl -sLIv https://registry.xyz.co.uk 2>&1 | cat
- Rebuilt URL to: https://registry.xyz.co.uk/
- Hostname was NOT found in DNS cache
- Trying 34.250.243.100...
- Connected to registry.xyz.co.uk (34.250.243.105) port 443 (#0)
- successfully set certificate verify locations:
- CAfile: none CApath: /etc/ssl/certs
- SSLv3, TLS handshake, Client hello (1): } [data not shown]
- SSLv3, TLS alert, Client hello (1): { [data not shown]
- SSLv3, TLS handshake, Server hello (2): { [data not shown]
- SSLv3, TLS handshake, CERT (11): { [data not shown]
- SSLv3, TLS alert, Server hello (2): } [data not shown]
- SSL certificate problem: self signed certificate
- Closing connection 0
- SSLv3, TLS alert, Client hello (1): } [data not shown]
The line of code that's failing is presumably here: https://github.com/mesosphere/letsencrypt-dcos/blob/master/run.sh#L8
Can you try running that line of code with your arguments set?
OK, I am pretty sure I know what the problem is...
I have forked the repo and did some debugging... and managed to replicate this locally...
The error is shown when the response returns as non json (obvious from the error message too)..
tried locally with auth token and return was my domain name!
curl -s -H "Authorization: token=mytoken" http://xyz.eu-west-1.elb.amazonaws.com/service/marathon/v2/apps/letsencrypt-dcos | python -c 'import sys, json; print(json.load(sys.stdin)["app"]["labels"]["HAPROXY_0_VHOST"])'
So solution would be to provide a token within curl request. I think!
Ah, you're using auth. I didn't bother to add auth support to this.
I made a PR ;) would be good to consider this for merge so i am not using my forked version but default to main lib ;)