Nelson Griffiths
01/27/2023, 2:01 PMSubmission failed. Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 703, in urlopen httplib_response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 398, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/local/lib/python3.11/http/client.py", line 1282, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/local/lib/python3.11/http/client.py", line 1328, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/local/lib/python3.11/http/client.py", line 1277, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/local/lib/python3.11/http/client.py", line 1037, in _send_output self.send(msg) File "/usr/local/lib/python3.11/http/client.py", line 975, in send self.connect() File "/usr/local/lib/python3.11/site-packages/docker/transport/unixconn.py", line 30, in connect sock.connect(self.unix_socket) FileNotFoundError: [Errno 2] No such file or directory During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 489, in send resp = conn.urlopen( ^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 787, in urlopen retries = retries.increment( ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 703, in urlopen httplib_response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 398, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/local/lib/python3.11/http/client.py", line 1282, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/local/lib/python3.11/http/client.py", line 1328, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/local/lib/python3.11/http/client.py", line 1277, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/local/lib/python3.11/http/client.py", line 1037, in _send_output self.send(msg) File "/usr/local/lib/python3.11/http/client.py", line 975, in send self.connect() File "/usr/local/lib/python3.11/site-packages/docker/transport/unixconn.py", line 30, in connect sock.connect(self.unix_socket) urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/docker/api/client.py", line 214, in _retrieve_server_version return self.version(api_version=False)["ApiVersion"] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/docker/api/daemon.py", line 181, in version return self._result(self._get(url), json=True) ^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/docker/utils/decorators.py", line 46, in inner return f(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/docker/api/client.py", line 237, in _get return self.get(url, **self._set_request_timeout(kwargs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 600, in get return self.request("GET", url, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 587, in request resp = self.send(prep, **send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 701, in send r = adapter.send(request, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 547, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/prefect/infrastructure/docker.py", line 541, in _get_client docker_client = docker.from_env() ^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/docker/client.py", line 96, in from_env return cls( ^^^^ File "/usr/local/lib/python3.11/site-packages/docker/client.py", line 45, in __init__ self.api = APIClient(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/docker/api/client.py", line 197, in __init__ self._version = self._retrieve_server_version() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/docker/api/client.py", line 221, in _retrieve_server_version raise DockerException( docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory')) The above exception was the direct cause of the following exception: RuntimeError: Could not connect to Docker.
Christopher Boyd
01/27/2023, 2:18 PMself.connect() File "/usr/local/lib/python3.11/site-packages/docker/transport/unixconn.py", line 30, in connect sock.connect(self.unix_socket) FileNotFoundError: [Errno 2] No such file or directory
Nelson Griffiths
01/27/2023, 2:36 PMprefect agent start --work-queue dev
Christopher Boyd
01/27/2023, 2:43 PMNelson Griffiths
01/27/2023, 2:43 PMChristopher Boyd
01/27/2023, 2:48 PM3.10.6
but all the tracebacks are /usr/local/lib/python3.11
Nelson Griffiths
01/27/2023, 2:51 PMChristopher Boyd
01/27/2023, 2:57 PMNelson Griffiths
01/27/2023, 4:00 PMChristopher Boyd
01/27/2023, 4:01 PMNelson Griffiths
01/27/2023, 4:06 PMChristopher Boyd
01/27/2023, 4:19 PMNelson Griffiths
01/27/2023, 4:19 PMChristopher Boyd
01/27/2023, 7:30 PMNelson Griffiths
01/27/2023, 7:34 PMStarting v2.7.10 agent
And those paths don't seem to exist...
Here is what does exist in `/usr/local/lib`:
nelsongriffiths_doubleriver_com@prefect-agent:~$ ls /usr/local/lib
python2.7 python3.9
Christopher Boyd
01/27/2023, 7:38 PMNelson Griffiths
01/27/2023, 7:39 PMChristopher Boyd
01/27/2023, 7:40 PMNelson Griffiths
01/27/2023, 7:40 PMChristopher Boyd
01/27/2023, 7:41 PMNelson Griffiths
01/27/2023, 7:42 PMpython:3.10.7-slim-buster
Christopher Boyd
01/27/2023, 7:47 PMstrace -o output.txt <whatever command you used to apply the deployment>
and attachNelson Griffiths
01/27/2023, 7:49 PMChristopher Boyd
01/27/2023, 7:49 PMNelson Griffiths
01/27/2023, 7:52 PMChristopher Boyd
01/27/2023, 7:57 PMNelson Griffiths
01/27/2023, 7:57 PMChristopher Boyd
01/27/2023, 7:58 PMNelson Griffiths
01/27/2023, 7:58 PMChristopher Boyd
01/27/2023, 7:59 PMPrefect automatically sets a Docker image matching the Python and Prefect version you're using at deployment time. You can see all available images at Docker Hub.
Nelson Griffiths
01/27/2023, 8:02 PM"""Deploy our flow."""
from prefect.deployments import Deployment
from prefect.filesystems import GCS
from prefect.orion.schemas.schedules import CronSchedule
from prefect_gcp.cloud_run import CloudRunJob
from prefect.infrastructure.docker import DockerContainer
from data_pipelines.falcon_cap_iq.falcon_cap_iq_flow import falcon_cap_iq_dbt_flow
if __name__ == "__main__":
docker = DockerContainer.load("data-pipelines-image")
storage: GCS = GCS.load("prefect-flow-storage")
deployment = Deployment.build_from_flow(
name="falcon_cap_iq_dbt_deployment",
description=(
"Deployment for triggering DBT for transforming CapIQ data "
"for use with falcon."
),
version="1",
tags=["dev", "falcon", "dbt", "snowflake"],
schedule=CronSchedule(
cron="0 6 * * 1,2,3,4,5", timezone="America/Denver"
), # Cron schedule to run weekdays at 6:00 AM MST
flow=falcon_cap_iq_dbt_flow,
work_queue_name="dev",
infrastructure=docker,
storage=storage,
skip_upload=False,
)
deployment.apply()
Christopher Boyd
01/27/2023, 8:03 PMNelson Griffiths
01/27/2023, 8:04 PMChristopher Boyd
01/27/2023, 8:05 PM###
### A complete description of a Prefect Deployment for flow 'my-flow'
###
name: my-flow-deployment
description: null
tags:
- test
schedule: null
parameters: {}
infrastructure:
type: docker-container
env: {}
labels: {}
name: null
command:
- python
- -m
- prefect.engine
image: prefecthq/prefect:dev-python3.9
image_pull_policy: null
networks: []
network_mode: null
auto_remove: false
volumes: []
stream_output: true
###
### DO NOT EDIT BELOW THIS LINE
###
flow_name: my-flow
manifest_path: my_flow-manifest.json
storage:
bucket_path: bucket-full-of-sunshine
aws_access_key_id: '**********'
aws_secret_access_key: '**********'
_is_anonymous: true
_block_document_name: anonymous-xxxxxxxx-f1ff-4265-b55c-6353a6d65333
_block_document_id: xxxxxxxx-06c2-4c3c-a505-4a8db0147011
_block_type_slug: s3
parameter_openapi_schema:
title: Parameters
type: object
properties: {}
required: null
definitions: null
Nelson Griffiths
01/27/2023, 8:07 PMChristopher Boyd
01/27/2023, 8:09 PMNelson Griffiths
01/27/2023, 8:12 PMChristopher Boyd
01/27/2023, 8:18 PMstorage: GCS = GCS.load("prefect-flow-storage")
Nelson Griffiths
01/27/2023, 8:24 PMChristopher Boyd
01/27/2023, 8:31 PMNelson Griffiths
02/01/2023, 3:57 PMDockerContainer
infrastructure and run _create_and_start_container
and it pulls and runs the image without throwing any errors. I am running all of this in poetry. So it is the exact same environment that I use to run the agent. And it is still throwing 3.11 errors which I do not have on my machine. Is there a better way to step through what the agent is doing and debug it?Christopher Boyd
02/01/2023, 4:01 PMNelson Griffiths
02/01/2023, 4:02 PM