GoshDarnedHero
09/19/2023, 3:54 PM12:51:35.373 | INFO | prefect.runner - Pausing schedules for all deployments...
12:52:40.797 | INFO | prefect.runner - All deployment schedules have been paused!
Traceback (most recent call last):
File "/app/scripts/jobs.py", line 140, in <module>
Failed the last 3 attempts. Please check your environment and configuration.
Examples of recent errors:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/h2/connection.py", line 224, in process_input
func, target_state = self._transitions[(self.state, input_)]
KeyError: (<ConnectionState.CLOSED: 3>, <ConnectionInputs.SEND_HEADERS: 0>)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/httpcore/_async/http2.py", line 106, in handle_async_request
await self._send_request_headers(request=request, stream_id=stream_id)
File "/usr/local/lib/python3.10/dist-packages/httpcore/_async/http2.py", line 203, in _send_request_headers
self._h2_state.send_headers(stream_id, headers, end_stream=end_stream)
File "/usr/local/lib/python3.10/dist-packages/h2/connection.py", line 766, in send_headers
self.state_machine.process_input(ConnectionInputs.SEND_HEADERS)
File "/usr/local/lib/python3.10/dist-packages/h2/connection.py", line 228, in process_input
raise ProtocolError(
h2.exceptions.ProtocolError: Invalid input ConnectionInputs.SEND_HEADERS in state ConnectionState.CLOSED
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions
d
File "/usr/local/lib/python3.10/dist-packages/httpx/_transports/default.py", line 353, in handle_async_request
resp = await self._pool.handle_async_request(req)
File "/usr/local/lib/python3.10/dist-packages/httpcore/_async/connection_pool.py", line 253, in handle_async_request
raise exc
File "/usr/local/lib/python3.10/dist-packages/httpcore/_async/connection_pool.py", line 237, in handle_async_request
response = await connection.handle_async_request(request)
serve(
File "/usr/local/lib/python3.10/dist-packages/prefect/utilities/asyncutils.py", line 255, in coroutine_wrapper
File "/usr/local/lib/python3.10/dist-packages/httpcore/_async/connection.py", line 90, in handle_async_request
return await self._connection.handle_async_request(request)
File "/usr/local/lib/python3.10/dist-packages/httpcore/_async/http2.py", line 142, in handle_async_request
raise LocalProtocolError(exc) # pragma: nocover
httpcore.LocalProtocolError: Invalid input ConnectionInputs.SEND_HEADERS in state ConnectionState.CLOSED
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/prefect/utilities/services.py", line 53, in critical_service_loop
await workload()
File "/usr/local/lib/python3.10/dist-packages/prefect/runner.py", line 501, in _get_and_submit_flow_runs
runs_response = await self._get_scheduled_flow_runs()
File "/usr/local/lib/python3.10/dist-packages/prefect/runner.py", line 614, in _get_scheduled_flow_runs
scheduled_flow_runs = await self._client.read_flow_runs(
File "/usr/local/lib/python3.10/dist-packages/prefect/client/orchestration.py", line 1778, in read_flow_runs
response = await <http://self._client.post|self._client.post>("/flow_runs/filter", json=body)
File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1848, in post
return await self.request(
File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1533, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
File "/usr/local/lib/python3.10/dist-packages/prefect/client/base.py", line 256, in send
response = await self._send_with_retry(
File "/usr/local/lib/python3.10/dist-packages/prefect/client/base.py", line 190, in _send_with_retry
response = await request()
File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1620, in send
response = await self._send_handling_auth(
return call()
File "/usr/local/lib/python3.10/dist-packages/prefect/_internal/concurrency/calls.py", line 382, in __call__
File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1648, in _send_handling_auth
response = await self._send_handling_redirects(
File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1685, in _send_handling_redirects
response = await self._send_single_request(request)
File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1722, in _send_single_request
response = await transport.handle_async_request(request)
File "/usr/local/lib/python3.10/dist-packages/httpx/_transports/default.py", line 352, in handle_async_request
with map_httpcore_exceptions():
File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/usr/local/lib/python3.10/dist-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.LocalProtocolError: Invalid input ConnectionInputs.SEND_HEADERS in state ConnectionState.CLOSED
return self.result()
File "/usr/local/lib/python3.10/dist-packages/prefect/_internal/concurrency/calls.py", line 282, in result
return self.future.result(timeout=timeout)
File "/usr/local/lib/python3.10/dist-packages/prefect/_internal/concurrency/calls.py", line 168, in result
return self.__get_result()
File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
File "/usr/local/lib/python3.10/dist-packages/prefect/_internal/concurrency/calls.py", line 345, in _run_async
result = await coro
File "/usr/local/lib/python3.10/dist-packages/prefect/runner.py", line 989, in serve
await runner.start()
File "/usr/local/lib/python3.10/dist-packages/prefect/runner.py", line 283, in start
async with self._loops_task_group as tg:
File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 597, in __aexit__
raise exceptions[0]
File "/usr/local/lib/python3.10/dist-packages/prefect/utilities/services.py", line 121, in critical_service_loop
raise RuntimeError("Service exceeded error threshold.")
RuntimeError: Service exceeded error threshold.
Chris White
.serve
? were there any errors that you saw leading up to this?GoshDarnedHero
09/19/2023, 4:03 PMGoshDarnedHero
09/19/2023, 4:04 PM11:23:41.654 | INFO | Flow run 'sassy-wildebeest' - Downloading flow code from storage at '/app'
11:23:46.133 | INFO | Flow run 'sassy-wildebeest' - Backing up database
11:23:46.135 | INFO | Flow run 'sassy-wildebeest' - About to dump mongo DB using command
11:23:47.279 | INFO | Flow run 'sassy-wildebeest' - Finished in state Completed()
11:23:49.686 | INFO | prefect.flow_runs.runner - Process 396 exited cleanly.
11:53:41.430 | INFO | prefect.flow_runs.runner - Runner 'runner-d736fb2b-970c-4d98-a12b-bc5a6f9b0bc5' submitting flow run '492c4242-da7a-41f8-88cc-76b9b3ed6a9b'
11:53:41.589 | INFO | prefect.flow_runs.runner - Opening process...
11:53:41.596 | INFO | prefect.flow_runs.runner - Completed submission of flow run '492c4242-da7a-41f8-88cc-76b9b3ed6a9b'
/usr/lib/python3.10/runpy.py:126: RuntimeWarning: 'prefect.engine' found in sys.modules after import of package 'prefect', but prior to execution of 'prefect.engine'; this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
11:53:43.844 | INFO | Flow run 'enormous-shrew' - Downloading flow code from storage at '/app'
11:53:47.882 | INFO | Flow run 'enormous-shrew' - Backing up database
11:53:47.883 | INFO | Flow run 'enormous-shrew' - About to dump mongo DB using command
11:53:49.028 | INFO | Flow run 'enormous-shrew' - Finished in state Completed()
11:53:51.454 | INFO | prefect.flow_runs.runner - Process 417 exited cleanly.
12:23:46.918 | INFO | prefect.flow_runs.runner - Runner 'runner-d736fb2b-970c-4d98-a12b-bc5a6f9b0bc5' submitting flow run 'c9c5faee-2272-45f7-9162-a587911119ee'
12:23:47.081 | INFO | prefect.flow_runs.runner - Opening process...
12:23:47.083 | INFO | prefect.flow_runs.runner - Completed submission of flow run 'c9c5faee-2272-45f7-9162-a587911119ee'
/usr/lib/python3.10/runpy.py:126: RuntimeWarning: 'prefect.engine' found in sys.modules after import of package 'prefect', but prior to execution of 'prefect.engine'; this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
12:23:49.646 | INFO | Flow run 'military-python' - Downloading flow code from storage at '/app'
12:23:54.008 | INFO | Flow run 'military-python' - Backing up database
12:23:54.011 | INFO | Flow run 'military-python' - About to dump mongo DB using command
12:23:55.025 | INFO | Flow run 'military-python' - Finished in state Completed()
12:23:57.450 | INFO | prefect.flow_runs.runner - Process 438 exited cleanly.
Chris White
httpcore
in your environment?
pip install -U httpcore
GoshDarnedHero
09/19/2023, 4:15 PMChris White
Chris White
PREFECT_API_ENABLE_HTTP2=False
in your environment, that should also resolve the issue; longer term i recommend upgrading the underlying library, but I totally understand that you'll need to approach that with more careGoshDarnedHero
09/19/2023, 4:20 PMGoshDarnedHero
09/19/2023, 4:20 PMGoshDarnedHero
09/19/2023, 4:25 PMserve().
GoshDarnedHero
09/19/2023, 4:26 PMGoshDarnedHero
09/20/2023, 5:51 PMPREFECT_API_ENABLE_HTTP2=False
nextGoshDarnedHero
09/20/2023, 5:52 PMprefect worker start --pool 'pool-1'
GoshDarnedHero
09/20/2023, 5:53 PMimport httpx
from prefect import flow
@flow(log_prints=True)
def get_repo_info(repo_name: str = "PrefectHQ/prefect"):
""" Demo flow """
url = f"<https://api.github.com/repos/{repo_name}>"
response = httpx.get(url)
response.raise_for_status()
repo = response.json()
print(f"{repo_name} repository statistics 🤓:")
print(f"Stars 🌠 : {repo['stargazers_count']}")
print(f"Forks 🍴 : {repo['forks_count']}")
GoshDarnedHero
09/20/2023, 5:55 PMTraceback (most recent call last):
File "/Users/johnsturgeon/.pyenv/versions/3.10.5/lib/python3.10/site-packages/h2/connection.py", line 224, in process_input
func, target_state = self._transitions[(self.state, input_)]
KeyError: (<ConnectionState.CLOSED: 3>, <ConnectionInputs.SEND_HEADERS: 0>)
GoshDarnedHero
09/20/2023, 5:57 PMGoshDarnedHero
09/20/2023, 5:57 PMChris White
GoshDarnedHero
09/20/2023, 8:21 PMChris White