nikitastupin / clairvoyance

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

simplejson.errors.JSONDecodeError #31

Open Seminko opened 2 years ago

Seminko commented 2 years ago
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\ProgramData\Anaconda3\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "G:\Python\clairvoyance-main\clairvoyance\__main__.py", line 96, in <module>
    schema = oracle.clairvoyance(
  File "G:\Python\clairvoyance-main\clairvoyance\oracle.py", line 447, in clairvoyance
    valid_mutation_fields = probe_valid_fields(wordlist, config, input_document)
  File "G:\Python\clairvoyance-main\clairvoyance\oracle.py", line 80, in probe_valid_fields
    errors = response.json()["errors"]
  File "C:\Users\Folder\AppData\Roaming\Python\Python38\site-packages\requests\models.py", line 910, in json
    return complexjson.loads(self.text, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\simplejson\__init__.py", line 525, in loads
    return _default_decoder.decode(s)
  File "C:\ProgramData\Anaconda3\lib\site-packages\simplejson\decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "C:\ProgramData\Anaconda3\lib\site-packages\simplejson\decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
ivonutar commented 2 years ago

For me this was caused by not setting all necessary Headers, such as Cookie etc.

Seminko commented 2 years ago

@ivonutar For me it ran for half an hour without an issue. Only then this exception was thrown.

cazzz commented 1 year ago

Having the same issue as @Seminko. Running with the authorization header with no issues at first.

d-kar commented 1 year ago

Having the same issue as @Seminko. Running with the authorization header with no issues at first.

server starts blocking your requests after some probing. This is especially true with multipple concurrent requests (it throws 403 error which is not handled by clairvoyance)

Seminko commented 1 year ago

server starts blocking your requests after some probing. This is especially true with multipple concurrent requests (it throws 403 error which is not handled by clairvoyance)

A separate exception would be nice to actually know what caused the JSONDecodeError.