https://prefect.io logo
t

Tony Yun

02/09/2022, 8:21 PM
Hi, I see a weird issue when registering the flow. Do I have to change anything to make it work? (please see exception logs in this thread)
Copy code
#!/bin/bash -eo pipefail
cd ~/project/dbt_automation && poetry run prefect register -p ./flow.py --project "Data Operations"
Collecting flows...
Processing './flow.py':
  Building `Docker` storage...
    Error building storage:
      Traceback (most recent call last):
        File "/home/circleci/.cache/pypoetry/virtualenvs/dbt-automation-jStoVgX5-py3.7/lib/python3.7/site-packages/docker/api/client.py", line 268, in _raise_for_status
    response.raise_for_status()
        File "/home/circleci/.cache/pypoetry/virtualenvs/dbt-automation-jStoVgX5-py3.7/lib/python3.7/site-packages/requests/models.py", line 960, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
      requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: <http://35.237.164.225:2376/version>
k

Kevin Kho

02/09/2022, 8:26 PM
Not sure immediately what is causing this but it looks like a docker-py is raising this. Is it happening when you push the image?
t

Tony Yun

02/09/2022, 8:27 PM
it failed when registering the flow at
Building Docker storage...
step
k

Kevin Kho

02/09/2022, 8:32 PM
Do you have a longer traceback?
t

Tony Yun

02/09/2022, 8:42 PM
yes:
Copy code
During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/home/circleci/.cache/pypoetry/virtualenvs/dbt-automation-jStoVgX5-py3.7/lib/python3.7/site-packages/docker/api/client.py", line 214, in _retrieve_server_version
    return self.version(api_version=False)["ApiVersion"]
        File "/home/circleci/.cache/pypoetry/virtualenvs/dbt-automation-jStoVgX5-py3.7/lib/python3.7/site-packages/docker/api/daemon.py", line 181, in version
    return self._result(self._get(url), json=True)
        File "/home/circleci/.cache/pypoetry/virtualenvs/dbt-automation-jStoVgX5-py3.7/lib/python3.7/site-packages/docker/api/client.py", line 274, in _result
    self._raise_for_status(response)
        File "/home/circleci/.cache/pypoetry/virtualenvs/dbt-automation-jStoVgX5-py3.7/lib/python3.7/site-packages/docker/api/client.py", line 270, in _raise_for_status
    raise create_api_error_from_http_exception(e)
        File "/home/circleci/.cache/pypoetry/virtualenvs/dbt-automation-jStoVgX5-py3.7/lib/python3.7/site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
      docker.errors.APIError: 400 Client Error for <http://35.237.164.225:2376/version>: Bad Request ("b'Client sent an HTTP request to an HTTPS server.'")
      
During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/home/circleci/.cache/pypoetry/virtualenvs/dbt-automation-jStoVgX5-py3.7/lib/python3.7/site-packages/prefect/cli/build_register.py", line 451, in build_and_register
    storage.build()
        File "/home/circleci/.cache/pypoetry/virtualenvs/dbt-automation-jStoVgX5-py3.7/lib/python3.7/site-packages/prefect/storage/docker.py", line 303, in build
    self._build_image(push=push)
        File "/home/circleci/.cache/pypoetry/virtualenvs/dbt-automation-jStoVgX5-py3.7/lib/python3.7/site-packages/prefect/storage/docker.py", line 333, in _build_image
    self.pull_image()
        File "/home/circleci/.cache/pypoetry/virtualenvs/dbt-automation-jStoVgX5-py3.7/lib/python3.7/site-packages/prefect/storage/docker.py", line 558, in pull_image
    client = self._get_client()
        File "/home/circleci/.cache/pypoetry/virtualenvs/dbt-automation-jStoVgX5-py3.7/lib/python3.7/site-packages/prefect/storage/docker.py", line 545, in _get_client
    base_url=self.base_url, version="auto", tls=self.tls_config
        File "/home/circleci/.cache/pypoetry/virtualenvs/dbt-automation-jStoVgX5-py3.7/lib/python3.7/site-packages/docker/api/client.py", line 197, in __init__
    self._version = self._retrieve_server_version()
        File "/home/circleci/.cache/pypoetry/virtualenvs/dbt-automation-jStoVgX5-py3.7/lib/python3.7/site-packages/docker/api/client.py", line 222, in _retrieve_server_version
    f'Error while fetching server API version: {e}'
      docker.errors.DockerException: Error while fetching server API version: 400 Client Error for <http://35.237.164.225:2376/version>: Bad Request ("b'Client sent an HTTP request to an HTTPS server.'")

  Registering 'DBT flow'... Error
================== 0 registered, 1 errored ==================
k

Kevin Kho

02/09/2022, 8:46 PM
Yeah ok this looks like your issue. Maybe you need to pass your tls_config to the Docker storage?
t

Tony Yun

02/09/2022, 8:52 PM
got it. Thanks!!
7 Views