nikitastupin / clairvoyance

Obtain GraphQL API schema even if the introspection is disabled
Apache License 2.0
968 stars 87 forks source link

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) #48

Open abl3s1 opened 1 year ago

abl3s1 commented 1 year ago

this happening all the time Also can't import headers, how do I import them correctly?

nullswan commented 1 year ago

Hello @pythonicable

You did not received json document. If you had problem with authentication, this must be related.

The error is catchable here https://github.com/nikitastupin/clairvoyance/blob/main/clairvoyance/client.py#L59, however this forward an error at the runtime.

I assume you are running the program in CLI, you will import headers like curl does.

clairvoyance -o schema.json -H "Authorization: Bearer Token" -H "AnotherHeader: Placeholder" http://example.com

Can you update the issue once you tried with correct headers?

abl3s1 commented 1 year ago

yes. I imported the correct headers, and it throws me the same error after a bit.

d-kar commented 1 year ago

Have the same problem. The issue is that server starts blocking requests with 403 error at some point. Probably just too many at the same time (default is 50 threads). Might try to reduce threads to 1 with '-c' option. clairvoyance only handles 500+ errors to retry, might want to handle 403 errors more gracefully.