Looker query task results 404

Hi everyone,

Currently I am using the python sdk to create async query tasks and wait for the results. Like 95% of the time it is working fine, but sometimes I get a 404 Not Found error even tho the query task info endpoint says the query is complete. 

example:
GET(https://company.api.looker.com/api/4.0/query_tasks/a61e81f983d6572be0d49aabd60d1739) returns 200, and the status = 'complete'

but if I call the result endpoint immediately

GET(https://company.api.looker.com/api/4.0/query_tasks/a61e81f983d6572be0d49aabd60d1739/results) returns 404

I would really appreciate it if someone could help me with this problem.
Thank you

1 2 225
2 REPLIES 2

Nev
Bronze 1
Bronze 1

I have a similar enough issue that it probably doesn't warrant starting a new thread, which started on the same day my time (Wednesday, this post says Wednesday). Mine is just getting a user's scheduled plans.

Here are minimal steps to reproduce.

> conda create -yqn temp python=3.10 
> conda activate temp # For the env.
> pip install looker_sdk # pip to ensure the latest from pypi, not something different from Conda.
> export LOOKERSDK_CLIENT_ID=<id>
> export LOOKERSDK_CLIENT_SECRET=<secret>
> python
>>> import looker_sdk
>>> plans = looker_sdk.init40().all_scheduled_plans(user_id=125)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/nevd/miniconda3/envs/lookersftp/lib/python3.10/site-packages/looker_sdk/sdk/api40/methods.py", line 10612, in all_scheduled_plans
self.get(
File "/home/nevd/miniconda3/envs/lookersftp/lib/python3.10/site-packages/looker_sdk/rtl/api_methods.py", line 141, in get
response = self.transport.request(
File "/home/nevd/miniconda3/envs/lookersftp/lib/python3.10/site-packages/looker_sdk/rtl/requests_transport.py", line 66, in request
headers.update(authenticator(transport_options or {}))
File "/home/nevd/miniconda3/envs/lookersftp/lib/python3.10/site-packages/looker_sdk/rtl/auth_session.py", line 100, in authenticate
token = self._get_token(transport_options)
File "/home/nevd/miniconda3/envs/lookersftp/lib/python3.10/site-packages/looker_sdk/rtl/auth_session.py", line 87, in _get_token
self._login(transport_options)
File "/home/nevd/miniconda3/envs/lookersftp/lib/python3.10/site-packages/looker_sdk/rtl/auth_session.py", line 148, in _login
response = self._ok(
File "/home/nevd/miniconda3/envs/lookersftp/lib/python3.10/site-packages/looker_sdk/rtl/auth_session.py", line 240, in _ok
raise error.SDKError(response.value.decode(encoding="utf-8"))
looker_sdk.error.SDKError: <!DOCTYPE html>
<html>
<head>
<title>Looker Not Found (404)</title>

 

 

Nev
Bronze 1
Bronze 1

I've sent their support screenshots showing it working in the Looker API Explorer, not working in using the SDK, and showing that it fails with HTML instead of a JSON response regardless of whether the user exists, and particularly, that instead of returning 404 and a JSON response when the user it not found, for a non-existent user (in the API Explorer) it completes with an 200 and an empty response (no plans), that is, it doesn't do what the API doco says it should when it is working. (Both the good user and the non-existent user are failing with the SDK at the moment.)