<@ULVA73B9P> Getting the following error when I deploy a prefect worker using the helm chart, I made...
t

tvong

12 months ago
@Marvin Getting the following error when I deploy a prefect worker using the helm chart, I made sure that I filled out the helm chart values correctly so I don't think its an issue of misconfiguration
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/prefect/cli/_utilities.py", line 42, in wrapper
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/cli/_types.py", line 153, in sync_fn
    return asyncio.run(async_fn(*args, **kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/cli/worker.py", line 114, in start
    is_paused = await _check_work_pool_paused(work_pool_name)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/cli/worker.py", line 179, in _check_work_pool_paused
    work_pool = await client.read_work_pool(work_pool_name=work_pool_name)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/client/orchestration.py", line 2638, in read_work_pool
    response = await self._client.get(f"/work_pools/{work_pool_name}")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1814, in get
    return await self.request(
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1585, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/client/base.py", line 361, in send
    response.raise_for_status()
  File "/usr/local/lib/python3.11/site-packages/prefect/client/base.py", line 174, in raise_for_status
    raise PrefectHTTPStatusError.from_httpx_error(exc) from exc.__cause__
prefect.exceptions.PrefectHTTPStatusError: Client error '401 Unauthorized' for url '<https://api.prefect.cloud/api/accounts/f77cfc80-a3a6-49f7-9902-7cadf8393125/workspaces/8d0c18c7-2e0b-46ac-bf03-40351431e6c5/work_pools/analytics-platform-kube-prod>'
Response: {'detail': 'Unauthorized'}
<@ULVA73B9P> I'm getting unusual error when deploying to Prefect cloud. This flow is in prod and is ...
t

Tyson Chavarie

almost 2 years ago
@Marvin I'm getting unusual error when deploying to Prefect cloud. This flow is in prod and is running fine, we are just submitting a small change. Can you please assist? I've updated prefect and prefect-gcp and have confirmed I have connectivity to storage.googleapis.com as follows:
ping storage.googleapis.com         

PING storage.googleapis.com (142.250.80.59): 56 data bytes
64 bytes from 142.250.80.59: icmp_seq=0 ttl=115 time=25.909 ms
64 bytes from 142.250.80.59: icmp_seq=1 ttl=115 time=24.605 ms
64 bytes from 142.250.80.59: icmp_seq=2 ttl=115 time=24.590 ms
64 bytes from 142.250.80.59: icmp_seq=3 ttl=115 time=26.746 ms
^C
--- storage.googleapis.com ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 24.590/25.462/26.746/0.914 ms
nslookup storage.googleapis.com         

Server:         192.168.2.1
Address:        192.168.2.1#53

Non-authoritative answer:
Name:   storage.googleapis.com
Address: 142.250.81.251
Name:   storage.googleapis.com
Address: 142.250.65.251
Name:   storage.googleapis.com
Address: 142.250.65.219
Name:   storage.googleapis.com
Address: 142.250.65.187
Name:   storage.googleapis.com
Address: 142.251.40.251
Name:   storage.googleapis.com
Address: 142.251.40.219
Name:   storage.googleapis.com
Address: 142.250.176.219
Name:   storage.googleapis.com
Address: 142.250.80.123
Name:   storage.googleapis.com
Address: 142.250.80.91
Name:   storage.googleapis.com
Address: 142.250.80.59
Name:   storage.googleapis.com
Address: 142.250.80.27
Name:   storage.googleapis.com
Address: 142.250.72.123
Name:   storage.googleapis.com
Address: 142.250.64.91
Name:   storage.googleapis.com
Address: 142.251.40.187
Name:   storage.googleapis.com
Address: 142.251.40.155
Name:   storage.googleapis.com
Address: 142.251.40.123
curl <https://storage.googleapis.com>         

<?xml version='1.0' encoding='UTF-8'?><Error><Code>MissingSecurityHeader</Code><Message>Your request was missing a required header.</Message><Details>Authorization</Details></Error>%
Here is my deploy command and error:
prefect deployment build flow_02C_political_call_responses.py:get_political_call_responses \
    -n "Get Political Call Responses" \
    -sb gcs/gcs-livevox-prefect2 \
    -ib cloud-run-job/gcp-cloud-run-lead-management \
    -q default-agent-pool \
    -t dev \
    --apply


Found flow 'get-political-call-responses'
12:36:57.006 | ERROR   | GlobalEventLoopThread | prefect._internal.concurrency - Service 'EventsWorker' failed with 1 pending items.
12:36:57.350 | ERROR   | GlobalEventLoopThread | prefect._internal.concurrency - Service 'EventsWorker' failed with 1 pending items.
12:36:58.437 | ERROR   | GlobalEventLoopThread | prefect._internal.concurrency - Service 'EventsWorker' failed with 2 pending items.
12:37:41.284 | ERROR   | gcsfs - _request out of retries on exception: Cannot connect to host storage.googleapis.com:443 ssl:default [Network is unreachable]
Traceback (most recent call last):
  File "~/venv/lib/python3.10/site-packages/aiohttp/connector.py", line 980, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 1064, in create_connection
    raise exceptions[0]
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 1049, in create_connection
    sock = await self._connect_sock(
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 960, in _connect_sock
    await self.sock_connect(sock, address)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/selector_events.py", line 500, in sock_connect
    return await fut
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/selector_events.py", line 505, in _sock_connect
    sock.connect(address)
OSError: [Errno 51] Network is unreachable

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

Traceback (most recent call last):
  File "~/venv/lib/python3.10/site-packages/gcsfs/retry.py", line 114, in retry_request
    return await func(*args, **kwargs)
  File "~/venv/lib/python3.10/site-packages/gcsfs/core.py", line 409, in _request
    async with self.session.request(
  File "~/venv/lib/python3.10/site-packages/aiohttp/client.py", line 1141, in __aenter__
    self._resp = await self._coro
  File "~/venv/lib/python3.10/site-packages/aiohttp/client.py", line 536, in _request
    conn = await self._connector.connect(
  File "~/venv/lib/python3.10/site-packages/aiohttp/connector.py", line 540, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "~/venv/lib/python3.10/site-packages/aiohttp/connector.py", line 901, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "~/venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection
    raise last_exc
  File "~/venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "~/venv/lib/python3.10/site-packages/aiohttp/connector.py", line 988, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host storage.googleapis.com:443 ssl:default [Network is unreachable]
Traceback (most recent call last):
  File "~/venv/lib/python3.10/site-packages/aiohttp/connector.py", line 980, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 1064, in create_connection
    raise exceptions[0]
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 1049, in create_connection
    sock = await self._connect_sock(
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 960, in _connect_sock
    await self.sock_connect(sock, address)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/selector_events.py", line 500, in sock_connect
    return await fut
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/selector_events.py", line 505, in _sock_connect
    sock.connect(address)
OSError: [Errno 51] Network is unreachable

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

Traceback (most recent call last):
  File "~/venv/lib/python3.10/site-packages/prefect/cli/_utilities.py", line 41, in wrapper
    return fn(*args, **kwargs)
  File "~/venv/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 255, in coroutine_wrapper
    return call()
  File "~/venv/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 382, in __call__
    return self.result()
  File "~/venv/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 282, in result
    return self.future.result(timeout=timeout)
  File "~/venv/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 168, in result
    return self.__get_result()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/_base.py", line 391, in __get_result
    raise self._exception
  File "~/venv/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 345, in _run_async
    result = await coro
  File "~/venv/lib/python3.10/site-packages/prefect/cli/deployment.py", line 1172, in build
    deployment = await Deployment.build_from_flow(
  File "~/venv/lib/python3.10/site-packages/prefect/deployments/deployments.py", line 867, in build_from_flow
    await deployment.upload_to_storage(ignore_file=ignore_file)
  File "~/venv/lib/python3.10/site-packages/prefect/deployments/deployments.py", line 689, in upload_to_storage
    file_count = await self.storage.put_directory(
  File "~/venv/lib/python3.10/site-packages/prefect/filesystems.py", line 603, in put_directory
    return await self.filesystem.put_directory(
  File "~/venv/lib/python3.10/site-packages/prefect/filesystems.py", line 385, in put_directory
    self.filesystem.put_file(f, fpath, overwrite=True)
  File "~/venv/lib/python3.10/site-packages/fsspec/asyn.py", line 121, in wrapper
    return sync(self.loop, func, *args, **kwargs)
  File "~/venv/lib/python3.10/site-packages/fsspec/asyn.py", line 106, in sync
    raise return_result
  File "~/venv/lib/python3.10/site-packages/fsspec/asyn.py", line 61, in _runner
    result[0] = await coro
  File "~/venv/lib/python3.10/site-packages/gcsfs/core.py", line 1177, in _put_file
    await simple_upload(
  File "~/venv/lib/python3.10/site-packages/gcsfs/core.py", line 1782, in simple_upload
    j = await fs._call(
  File "~/venv/lib/python3.10/site-packages/gcsfs/core.py", line 430, in _call
    status, headers, info, contents = await self._request(
  File "~/venv/lib/python3.10/site-packages/decorator.py", line 221, in fun
    return await caller(func, *(extras + args), **kw)
  File "~/venv/lib/python3.10/site-packages/gcsfs/retry.py", line 144, in retry_request
    raise e
  File "~/venv/lib/python3.10/site-packages/gcsfs/retry.py", line 114, in retry_request
    return await func(*args, **kwargs)
  File "~/venv/lib/python3.10/site-packages/gcsfs/core.py", line 409, in _request
    async with self.session.request(
  File "~/venv/lib/python3.10/site-packages/aiohttp/client.py", line 1141, in __aenter__
    self._resp = await self._coro
  File "~/venv/lib/python3.10/site-packages/aiohttp/client.py", line 536, in _request
    conn = await self._connector.connect(
  File "~/venv/lib/python3.10/site-packages/aiohttp/connector.py", line 540, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "~/venv/lib/python3.10/site-packages/aiohttp/connector.py", line 901, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "~/venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection
    raise last_exc
  File "~/venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "~/venv/lib/python3.10/site-packages/aiohttp/connector.py", line 988, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host storage.googleapis.com:443 ssl:default [Network is unreachable]
An exception occurred.