nikitastupin / clairvoyance

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

client_session: <aiohttp.client.ClientSession object at 0x7f3307f050d0> #69

Open aliwjpi opened 1 year ago

aliwjpi commented 1 year ago

hello, when i run clairvoyance on some targets like this (https://ctm-cssit-ps3-dmz.us.dell.com/) i got and error, how can i fix it ? error :

root@aliwjpi:# clairvoyance "https://ctm-cssit-ps3-dmz.us.dell.com/graphql" -o schema.json -c 1 2023-04-21 05:12:24 INFO | Starting blind introspection on https://ctm-cssit-ps3-dmz.us.dell.com/graphql... 2023-04-21 05:12:24 INFO | Iteration 1 Traceback (most recent call last): File "/usr/local/bin/clairvoyance", line 8, in sys.exit(cli()) File "/usr/local/lib/python3.8/dist-packages/clairvoyance/cli.py", line 142, in cli asyncio.run( File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/usr/local/lib/python3.8/dist-packages/clairvoyance/cli.py", line 89, in blind_introspection schema = await oracle.clairvoyance( File "/usr/local/lib/python3.8/dist-packages/clairvoyance/oracle.py", line 568, in clairvoyance typename = await probe_typename(input_document) File "/usr/local/lib/python3.8/dist-packages/clairvoyance/oracle.py", line 487, in probe_typename return (match.group('typename').replace('[', '').replace(']', '').replace('!', '')) AttributeError: 'NoneType' object has no attribute 'group' 2023-04-21 05:12:25 ERROR | Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x7f651f7840d0>

ammaraskar commented 1 year ago

Run clairvoyance with LOG_LEVEL=debug set in your env, for example LOG_LEVEL=debug clairvoyance "https://ctm-cssit-ps3-dmz.us.dell.com/graphql" -o schema.json -c 1

It should print a message like:

2023-04-22 00:34:57     DEBUG   | Unkwon error in `probe_typename`: "[...]" does not match any known regexes.

before throwing that error. More than likely they're using a graphql backend whose error messages clairvoyance doesn't support out of the box.