spectacles-ci / spectacles

A continuous integration tool for Looker and LookML.
https://spectacles.dev
MIT License
216 stars 34 forks source link

spectacles lookml RemoteProtocolError #819

Open wsjk opened 3 weeks ago

wsjk commented 3 weeks ago

Running spectacles lookml --project my_project and getting following error:

Completed validation in .

Encountered unexpected RemoteProtocolError: "Server disconnected without sending a response."
Full error traceback logged to file.

For support, please create an issue at https://github.com/spectacles-ci/spectacles/issues

I'm currently trying to run this for first time in our staging Looker instance. The cmd works for our Production instance just fine. Is there some setting we need to update in our staging instance for this to work?

DylanBaker commented 3 weeks ago

Hi @wsjk! Would you mind running the command with the -v flag? I'm interested in seeing the full logs to understand which endpoint is failing.

Thanks!

wsjk commented 3 weeks ago

Output when i run spectacles lookml -v --project looker_proj

Authenticating to the Looker as client ID 'xxxxxxxxxx'
Completed content validation in .

Server disconnected without sending a response.
Traceback (most recent call last):
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/httpx/_transports/default.py", line 67, in map_httpcore_exceptions
    yield
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/httpx/_transports/default.py", line 231, in handle_request
    resp = self._pool.handle_request(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/httpcore/_sync/connection_pool.py", line 216, in handle_request
    raise exc from None
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/httpcore/_sync/connection_pool.py", line 196, in handle_request
    response = connection.handle_request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/httpcore/_sync/connection.py", line 101, in handle_request
    return self._connection.handle_request(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/httpcore/_sync/http11.py", line 143, in handle_request
    raise exc
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/httpcore/_sync/http11.py", line 113, in handle_request
    ) = self._receive_response_headers(**kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/httpcore/_sync/http11.py", line 186, in _receive_response_headers
    event = self._receive_event(timeout=timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/httpcore/_sync/http11.py", line 238, in _receive_event
    raise RemoteProtocolError(msg)
httpcore.RemoteProtocolError: Server disconnected without sending a response.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/spectacles/cli.py", line 187, in wrapper
    return function(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/spectacles/cli.py", line 347, in main
    asyncio.run(
  File "/Users/xxxx/anaconda3/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/Users/xxxx/anaconda3/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxx/anaconda3/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/spectacles/utils.py", line 65, in timed_function
    result = await fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/spectacles/cli.py", line 844, in run_content
    client = LookerClient(
             ^^^^^^^^^^^^^
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/spectacles/client.py", line 101, in __init__
    self.authenticate()
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/spectacles/client.py", line 117, in authenticate
    response = httpx.post(url=url, data=body, timeout=TIMEOUT_SEC)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/httpx/_api.py", line 317, in post
    return request(
           ^^^^^^^^
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/httpx/_api.py", line 104, in request
    return client.request(
           ^^^^^^^^^^^^^^^
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/httpx/_client.py", line 828, in request
    return self.send(request, auth=auth, follow_redirects=follow_redirects)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/httpx/_client.py", line 915, in send
    response = self._send_handling_auth(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/httpx/_client.py", line 943, in _send_handling_auth
    response = self._send_handling_redirects(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/httpx/_client.py", line 980, in _send_handling_redirects
    response = self._send_single_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/httpx/_client.py", line 1016, in _send_single_request
    response = transport.handle_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/httpx/_transports/default.py", line 230, in handle_request
    with map_httpcore_exceptions():
  File "/Users/xxxx/anaconda3/lib/python3.11/contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/Users/xxxx/anaconda3/lib/python3.11/site-packages/httpx/_transports/default.py", line 84, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.RemoteProtocolError: Server disconnected without sending a response.

Encountered unexpected RemoteProtocolError: "Server disconnected without sending a response."
Full error traceback logged to file.

For support, please create an issue at https://github.com/spectacles-ci/spectacles/issues
DylanBaker commented 3 weeks ago

Thanks. It seems we're failing at the very first API call when we try to authenticate.

Do you have access tot he API explorer in your Looker instance? I'd want to test whether you are able to make the /login API call with the same credentials.

Is all your config in a config file? i.e. host, port, etc.

wsjk commented 3 weeks ago

yep just ran the ApiAuth.Login method via API explorer in our staging instance with creds and got status 200

I'm running passing creds via env vars LOOKER_BASE_URL, LOOKER_CLIENT_ID, LOOKER_CLIENT_SECRET

Running spectacles==2.4.7 btw

DylanBaker commented 2 weeks ago

This probably isn't the issue, but mind bumping to the newest version to check? Allows us to rule out any issues with other packages.

wsjk commented 2 weeks ago

yea same issue on 2.4.10.