Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

ValueError: No JSON object could be decoded #6

Open
willwnekowicz opened this issue Oct 29, 2016 · 10 comments
Open

ValueError: No JSON object could be decoded #6

willwnekowicz opened this issue Oct 29, 2016 · 10 comments

Comments

@willwnekowicz
Copy link

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
@brndnmtthws
Copy link
Contributor

Is there any more context in the log? This isn't enough for me to even guess at what's happening.

@sipsynergy
Copy link

sipsynergy commented Feb 17, 2017

I have the same problem, and no more logs in the stack ;/

@brndnmtthws did you manage to resolve it?

@brndnmtthws
Copy link
Contributor

I haven't seen the problem myself, but I'll see what I can do.

@sipsynergy
Copy link

@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.

@sipsynergy
Copy link

false hopes.. still erroring in the same manner... and no certs... just app not crashing now.. :P

@pawmart
Copy link

pawmart commented Feb 17, 2017

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]

@brndnmtthws
Copy link
Contributor

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?

@pawmart
Copy link

pawmart commented Feb 18, 2017

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!

pawmart added a commit to pawmart/letsencrypt-dcos that referenced this issue Feb 19, 2017
pawmart added a commit to pawmart/letsencrypt-dcos that referenced this issue Feb 19, 2017
echo output

dsfasfd

dsfasfd

dsfasfd

dsfasfd

dsfasfddsf

Added marathon API access token key support d2iq-archive#6 d2iq-archive#10

added support for missing  endpoints

typo
pawmart added a commit to pawmart/letsencrypt-dcos that referenced this issue Feb 19, 2017
pawmart added a commit to pawmart/letsencrypt-dcos that referenced this issue Feb 19, 2017
@brndnmtthws
Copy link
Contributor

Ah, you're using auth. I didn't bother to add auth support to this.

@pawmart
Copy link

pawmart commented Feb 21, 2017

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 ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants