Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARNING Error posting to https://api.500px.com/graphql Expecting value ERROR Unclosed client session #120

Open
tonypalacios opened this issue Jan 4, 2025 · 1 comment

Comments

@tonypalacios
Copy link

Greetings.
The problem is that Clairvoyance is unable to generate the schema from https://api.500px.com/graphql.

Execution environment

  • Alpine Linux 3.21
  • Python 3.13.1
  • Clairvoyance 2.5.2

Clairvoyance execution parameters

$ clairvoyance --output schema.json --wordlist ./dictionary.txt --progress https://api.500px.com/graphql > allout.txt 2>&1

Where dictionary.txt contains the words resulting from combining the following sources:

That is, this:

$ { \
curl --location --silent https://github.com/Escape-Technologies/graphql-wordlist/raw/refs/heads/main/wordlists/wordlist.csv | awk -F "\"*,\"*" '{print $1}'; \
curl --location --silent https://github.com/first20hours/google-10000-english/raw/refs/heads/master/google-10000-english.txt; \
} \
| sort --unique \
> dictionary.txt

Clairvoyance execution result log: the problem

allout.txt file contains this (the complete allout.txt file is attached):

2025-01-04 09:28:14     INFO    | Starting blind introspection on https://api.500px.com/graphql...
2025-01-04 09:28:14     INFO    | Iteration 1
Fetching root typenames          ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
2025-01-04 09:28:51     WARNING | Error posting to https://api.500px.com/graphql: Expecting value: line 1 column 1 (char 0)
2025-01-04 09:28:51     WARNING | Error posting to https://api.500px.com/graphql: Expecting value: line 1 column 1 (char 0)
...
Traceback (most recent call last):
  File "/home/usuario1/.local/bin/clairvoyance", line 8, in <module>
    sys.exit(cli())
             ~~~^^
  File "/home/usuario1/.local/lib/python3.13/site-packages/clairvoyance/cli.py", line 142, in cli
    asyncio.run(
    ~~~~~~~~~~~^
        blind_introspection(
        ^^^^^^^^^^^^^^^^^^^^
    ...<12 lines>...
        )
        ^
    )
    ^
  File "/usr/local/lib/python3.13/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
 File "/usr/local/lib/python3.13/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/local/lib/python3.13/asyncio/base_events.py", line 720, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/home/usuario1/.local/lib/python3.13/site-packages/clairvoyance/cli.py", line 89, in blind_introspection
    schema = await oracle.clairvoyance(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
    )
    ^
  File "/home/usuario1/.local/lib/python3.13/site-packages/clairvoyance/oracle.py", line 578, in clairvoyance
    valid_fields = await probe_valid_fields(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
    )
    ^
  File "/home/usuario1/.local/lib/python3.13/site-packages/clairvoyance/oracle.py", line 209, in probe_valid_fields
    result = await task
             ^^^^^^^^^^
  File "/usr/local/lib/python3.13/asyncio/tasks.py", line 634, in _wait_for_one
    return f.result() if resolve else f
           ~~~~~~~~^^
  File "/home/usuario1/.local/lib/python3.13/site-packages/clairvoyance/oracle.py", line 176, in __probation
    errors = response['errors']
             ~~~~~~~~^^^^^^^^^^
KeyError: 'errors'
2025-01-04 09:29:02     ERROR   | Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x70a8d5302270>
2025-01-04 09:29:02     ERROR   | Task exception was never retrieved
future: <Task finished name='Task-4610' coro=<probe_valid_fields.<locals>.__probation() done, defined at /home/usu
ario1/.local/lib/python3.13/site-packages/clairvoyance/oracle.py:167> exception=KeyError('errors')>
Traceback (most recent call last):
  File "/home/usuario1/.local/lib/python3.13/site-packages/clairvoyance/oracle.py", line 176, in __probation
    errors = response['errors']
             ^^^^^^^^^^^^^^^^^^
...

And https://api.500px.com/graphql works

curl --request POST --header 'Content-Type: application/json' --data '@payload.json' https://api.500px.com/graphql \
| python3 -m json.tool \
| less -S

Where payload.json contains this,

{
   "operationName": "OnboadingCategoriesQueryRenderQuery",
   "variables": {
      "showNude": true
   },
   "query": "
      query OnboadingCategoriesQueryRenderQuery($showNude: Boolean) {
         categories: getTopCategories(isViewAll: true, showNude: $showNude) {
            id
            legacyId
            category
            backgroundImage { 
               images(sizes: [32]) {url id}
               id
            }
         }
      }
   "
}

Response:

{
    "data": {
        "categories": [
            {
                "id": "dXJpOm5vZGU6T25ib2FyZGluZ0NhdGVnb3J5Ojg=",
                "legacyId": "8",
                "category": "Landscapes",
                "backgroundImage": {
                    "images": [
                        {
                            "url": "https://drscdn.500px.org/photo/1104849699/q%3D80_h%3D300/v2?sig=5fde9ec58d99e55ba1b457d60d8dbea13359f9633a0dd1201c91bd82800c267d",
                            "id": "dXJpOm5vZGU6UGhvdG9SZXNpemVJbWFnZToxMTA0ODQ5Njk5LS0tMTE2OTUwNjctLS1mYWxzZS0tLTMy"
                        }
                    ],
                    "id": "dXJpOm5vZGU6UGhvdG86MTEwNDg0OTY5OQ=="
                }
            },
            ...
        ]
    }
}
@r1pu5u
Copy link

r1pu5u commented Jan 12, 2025

i have same issue, any solution?

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

No branches or pull requests

2 participants