Chris McClellan
03/29/2023, 12:23 AMDavid Salgado
03/29/2023, 5:42 AMjpuris
03/29/2023, 6:39 AMFlow stuck in PENDING state. Please fix me!
Flow run <redacted>/accurate-leech entered stateat 2023-03-28T220040.649242+00:00.Completed
Flow ID: 82fbf550-6938-4f85-83f8-e279fd4ac048
Flow run ID: cfe1b7d8-e858-4399-983a-fa1dfffa4d0d
Flow run URL: https://app.prefect.cloud/account/c1397d5f-b9f3-49e8-abb6-bce7d7b1412e/workspace/32dfe242-315b-4405-b06d-8b6308d6b631/flow-runs/flow-run/cfe1b7d8-e858-4399-983a-fa1dfffa4d0d
State message: All states completed.• scheduled to run at 220000 UTC • actual start at 220003 UTC • completed at 220040 UTC Why did we get a flow stuck in PENDING state around the time of flow's completion time? Even more curious is the fact we have set the alert to trigger when a flow has remained in pending state for 15 minutes 🤷 Automation's Trigger settings • Trigger Type: Flow Run State • Flows: All flows • Flow Run Tags: All tags • Flow Run: Stays in = (pending) • For: 15 Minutes Automation in question: https://app.prefect.cloud/account/c1397d5f-b9f3-49e8-abb6-bce7d7b1412e/workspace/32df[…]/automations/automation/0284734c-53f9-4a72-8351-fbe3ad50d19b
Михаил Бараковский
03/29/2023, 8:12 AMRobin
03/29/2023, 9:30 AMRobin
03/29/2023, 9:31 AMS3->Lambda->GRAPHQL API call
appropriate?Robin
03/29/2023, 9:31 AM[ERROR] ConnectionError: HTTPSConnectionPool(host='api.prefect.cloud', port=443): Max retries exceeded with url: /api/accounts/{ACCOUNT_ID}/workspaces/{WORKSPACE_ID} (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f04a5873310>: Failed to establish a new connection: [Errno 110] Connection timed out'))
3. Any tips what could cause the error?Robin
03/29/2023, 5:58 PMPENDING
.
I successfully submitted it with deployment_id
, but it still remains in PENDING
😕
I tried to submit it with work_pool
but that does not seem to be a valid request?
I read the docs but it is not clear to me, which role
work_pool
, deployment
and work queue
have 🤔
PS: The successful run was triggered in UI, without setting anything different than the flow defaults.Robin
03/30/2023, 9:25 AMTypeError: task() got an unexpected keyword argument 'result_storage_key'
🤔
Are the docs outdated? Do I miss something?Robin
03/31/2023, 2:28 PMDominik Jagoda
04/03/2023, 7:43 AMstart_date
and end_date
. The default is set to today's date using the function datetime.today().strftime("%Y-%m-%d")
. When I create a deployment, the above function executes and sets the date as today's date, e.g. 03-04-2023
. The problem is that this date will be set all the time every time I run the flow tomorrow, next week and next month. Is there any functionality in prefect where I could specify a parameter e.g. prefect.today() which would set the current date each time the flow is executed.
Flow params set in deployment
{
"symbols": [
"USD",
"EUR",
"GBP",
"CHF",
"PLN",
"DKK",
"COP",
"CZK",
"SEK",
"NOK",
"ISK"
],
"currency": "USD",
"end_date": "2023-03-24",
"if_exists": "replace",
"start_date": "2023-03-24",
"databricks_table": "exchange_rates",
}
Hùng Trần Tuấn
04/04/2023, 1:56 AMLeela Surya Teja Mangamuri
04/04/2023, 10:22 PMLeela Surya Teja Mangamuri
04/04/2023, 10:23 PMjack
04/05/2023, 6:36 PMflow_run.name
from inside a task?
From inside a flow this works:
from prefect.context import get_run_context
get_run_context().flow_run.name
but inside a task, it throws
AttributeError: 'TaskRunContext' object has no attribute 'flow_run'
Santiago Gonzalez
04/05/2023, 7:05 PM/job/update
API)
4- Run a job
The problem I am facing is on step 2, when I call Add Block
Endpoint (through async method execute_endpoint
), when I got a Time Out (no matter which timeout I set). Can you show me an sample of how can this get done with Prefect 2??? thanks in advanceAmit Mukherjee
04/06/2023, 7:08 PMLeela Surya Teja Mangamuri
04/07/2023, 12:16 AMLeela Surya Teja Mangamuri
04/07/2023, 12:18 AMSantiago Gonzalez
04/07/2023, 3:02 AMAndy Dienes
04/10/2023, 2:46 AMunhealthy
. is there anything I can do to fix this, or is it just because I have a very new / unpaid account?Federico Zambelli
04/10/2023, 4:28 PMlog_prints=True
, as well as get_run_logger
, and neither case worked. What am I missing?
for the record, this is my .py module:
from prefect import flow, get_run_logger
@flow(log_prints=True)
def hi():
logger = get_run_logger()
logger.warning("Hit from Prefect! 😅")
if __name__ == "__main__":
hi()
Andy Dienes
04/10/2023, 5:49 PMcannot deploy project with work pool of type 'prefect-agent'
(main) $ prefect deploy flows/modeling.py:foo -n test_deployment -p default-agent-pool
17:00:16.247 | WARNING | ray._private.worker - Failed to set SIGTERM handler, processes mightnot be cleaned up properly on exit.
Cannot deploy project with work pool of type 'prefect-agent'.
Scott Cressi
04/10/2023, 5:50 PM│ prefect.exceptions.PrefectHTTPStatusError: Client error '405 Method Not Allowed' for url '<http://prefect-server.prefect:4200/api/work_pools/>' │
Scott Cressi
04/10/2023, 5:50 PMSantiago Gonzalez
04/11/2023, 3:05 PMshell_run_command
task. When this task is called, I have the following error:
Encountered exception during execution:
Traceback (most recent call last):
File "/home/sgonzalez/venv/lib/python3.7/site-packages/prefect/engine.py", line 669, in orchestrate_flow_run
result = await flow_call.aresult()
File "/home/sgonzalez/venv/lib/python3.7/site-packages/prefect/_internal/concurrency/calls.py", line 181, in aresult
return await asyncio.wrap_future(self.future)
File "/home/sgonzalez/venv/lib/python3.7/site-packages/prefect/_internal/concurrency/calls.py", line 194, in _run_sync
result = self.fn(*self.args, **self.kwargs)
File "flows/flows/landbaron.py", line 149, in generate_lb_sites_flow
ps_details_timestamp = shell_run_command(command=get_ps_details_timestamp_command(export_version))
File "/home/sgonzalez/venv/lib/python3.7/site-packages/prefect/tasks.py", line 491, in __call__
mapped=False,
File "/home/sgonzalez/venv/lib/python3.7/site-packages/prefect/engine.py", line 972, in enter_task_run_engine
return from_sync.wait_for_call_in_loop_thread(begin_run)
File "/home/sgonzalez/venv/lib/python3.7/site-packages/prefect/_internal/concurrency/api.py", line 137, in wait_for_call_in_loop_thread
return call.result()
File "/home/sgonzalez/venv/lib/python3.7/site-packages/prefect/_internal/concurrency/calls.py", line 173, in result
return self.future.result(timeout=timeout)
File "/usr/lib/python3.7/concurrent/futures/_base.py", line 428, in result
return self.__get_result()
File "/usr/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/home/sgonzalez/venv/lib/python3.7/site-packages/prefect/_internal/concurrency/calls.py", line 218, in _run_async
result = await coro
File "/home/sgonzalez/venv/lib/python3.7/site-packages/prefect/engine.py", line 1137, in get_task_call_return_value
return await future._result()
File "/home/sgonzalez/venv/lib/python3.7/site-packages/prefect/futures.py", line 241, in _result
return await final_state.result(raise_on_failure=raise_on_failure, fetch=True)
File "/home/sgonzalez/venv/lib/python3.7/site-packages/prefect/states.py", line 91, in _get_state_result
raise await get_state_exception(state)
File "/home/sgonzalez/venv/lib/python3.7/site-packages/prefect/engine.py", line 1551, in orchestrate_task_run
result = await call.aresult()
File "/home/sgonzalez/venv/lib/python3.7/site-packages/prefect/_internal/concurrency/calls.py", line 181, in aresult
return await asyncio.wrap_future(self.future)
File "/home/sgonzalez/venv/lib/python3.7/site-packages/prefect/_internal/concurrency/calls.py", line 218, in _run_async
result = await coro
File "/home/sgonzalez/venv/lib/python3.7/site-packages/prefect_shell/commands.py", line 98, in shell_run_command
shell_command, env=current_env, cwd=cwd
File "/home/sgonzalez/venv/lib/python3.7/site-packages/anyio/_core/_subprocesses.py", line 135, in open_process
start_new_session=start_new_session,
File "/home/sgonzalez/venv/lib/python3.7/site-packages/anyio/_backends/_asyncio.py", line 1112, in open_process
start_new_session=start_new_session,
File "/usr/lib/python3.7/asyncio/subprocess.py", line 217, in create_subprocess_exec
stderr=stderr, **kwds)
File "/usr/lib/python3.7/asyncio/base_events.py", line 1544, in subprocess_exec
bufsize, **kwargs)
File "/usr/lib/python3.7/asyncio/unix_events.py", line 193, in _make_subprocess_transport
self._child_watcher_callback, transp)
File "/usr/lib/python3.7/asyncio/unix_events.py", line 941, in add_child_handler
"Cannot add child handler, "
RuntimeError: Cannot add child handler, the child watcher does not have a loop attached
Santiago Gonzalez
04/11/2023, 8:01 PMAndy Dienes
04/11/2023, 5:58 PMray.JobSubmissionClient
. how do I install ray
(or pip packages more generally?) I tried a variety of things:
1. importing prefect.settings
in my flow directly and setting `prefect.settings.EXTRA_PIP_PACKAGES = ["list", "of", "packages"]
2. adding it to the requires
field of push
and pull
in my prefect.yaml
3. adding EXTRA_PIP_PACKAGES: ray
under job_variables
in the deployment.yaml
none of these worked. what is the recommended way to install packages for flows without burning a whole new image every timeLeela Surya Teja Mangamuri
04/11/2023, 8:34 PMSantiago Gonzalez
04/11/2023, 6:10 PM