Vadym Dytyniak
11/30/2022, 2:46 PMl1 = task1.map([1, 2, 3])
l2 = task2.map(l1)
task3.map(l1=l1, l2=l2)
Prefect does not guarantee that in task3
list l1
elements will be passed with corresponding l2
elements?Anna Geller
11/30/2022, 5:46 PM@flow(log_prints=True)
Nate Roberts
11/30/2022, 6:28 PMAshley Felber
11/30/2022, 7:06 PMKevin McCraney
11/30/2022, 8:15 PMis_successful()
method in an assert in our testing, and to move that to Prefect 2, we were thinking we might call get_run_context()
to get the flow run state and return some value (likely 'Completed' from the state_name
parameter). We've observed that calling get_run_context()
within a flow's context causes the flow to hang. Has anyone observed this, or does anyone have any suggestions for remedy?Simon Macklin
11/30/2022, 8:20 PMSean Conroy
11/30/2022, 9:34 PMis_successful()
method from Prefect 1 for Prefect 2?
In other words, is testing the state name = 'Completed' the best way to check for success?
myflow_state = my_flow(return_state=True)
# Test if state is successfull:
if not myflow_state.name == 'Completed':
raise Exception("myflow failed")
Michael Kahan
11/30/2022, 10:00 PMprefect-airbyte
to trigger syncs on Airbyte Cloud? Or is it only for open source hosted instances?Boggdan Barrientos
11/30/2022, 10:07 PMrun_deployment
for execute two deployments that has to be completed the next subflow.
I'm having issues in the execution of the seconds subflows, the agent dies after one hour of waiting.
How can I apply this logic successfully? I need to execute n deployments and when the n deployments has been completed, execute another flow.
Image 1: The deployments runs properly.
Image 2: The tasks that runs the deployments never ends.wonsun
12/01/2022, 4:09 AMKhyaati Jindal
12/01/2022, 5:01 AMThe above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ubuntu/5c-ed-sumary-telegram-bot/env/lib/python3.10/site-packages/prefect/agent.py", line 154, in get_and_submit_flow_runs
queue_runs = await self.client.get_runs_in_work_queue(
File "/home/ubuntu/5c-ed-sumary-telegram-bot/env/lib/python3.10/site-packages/prefect/client/orion.py", line 763, in get_runs_in_work_queue
response = await <http://self._client.post|self._client.post>(
File "/home/ubuntu/5c-ed-sumary-telegram-bot/env/lib/python3.10/site-packages/httpx/_client.py", line 1848, in post
return await self.request(
File "/home/ubuntu/5c-ed-sumary-telegram-bot/env/lib/python3.10/site-packages/httpx/_client.py", line 1533, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
File "/home/ubuntu/5c-ed-sumary-telegram-bot/env/lib/python3.10/site-packages/prefect/client/base.py", line 160, in send
await super().send(*args, **kwargs)
File "/home/ubuntu/5c-ed-sumary-telegram-bot/env/lib/python3.10/site-packages/httpx/_client.py", line 1620, in send
response = await self._send_handling_auth(
File "/home/ubuntu/5c-ed-sumary-telegram-bot/env/lib/python3.10/site-packages/httpx/_client.py", line 1648, in _send_handling_auth
File "/home/ubuntu/5c-ed-sumary-telegram-bot/env/lib/python3.10/site-packages/httpx/_client.py", line 1685, in _send_handling_redirects
response = await self._send_single_request(request)
File "/home/ubuntu/5c-ed-sumary-telegram-bot/env/lib/python3.10/site-packages/httpx/_client.py", line 1722, in _send_single_request
response = await transport.handle_async_request(request)
File "/home/ubuntu/5c-ed-sumary-telegram-bot/env/lib/python3.10/site-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 "/home/ubuntu/5c-ed-sumary-telegram-bot/env/lib/python3.10/site-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
Any idea why this is happening ? I have deployed lot of deployments before, and never had such a issueRussell Brooks
12/01/2022, 6:09 AMArnoldas Bankauskas
12/01/2022, 12:26 PMJoshua Greenhalgh
12/01/2022, 5:25 PMJoshua Grant
12/01/2022, 7:04 PMget_run_context()
from within a flow. MRE in 🧵Michael Kahan
12/01/2022, 7:52 PMdeployment build
I get the following errors (in thread).
Perhaps they are related, but at this point I'm stumped. Not sure why it runs but cant be deployed.
Any help would be appreciated and I'm happy to provide more info as needed. Thanks!Sam Cook
12/01/2022, 8:25 PMmap
to pass those items/results to follow on tasks. Consistently, if I have a large number of items (50+) then the entire process will lock up during the follow on tasks and fail to terminate cleanly. In the UI the root job is marked as crashed
but the tasks are always stuck in a running state. I'm running in a Kubernetes environment as well so the stuck jobs have to be manually cleaned up whenever this occurs as they never reach completion.
I think this might possibly be related to @Boggdan Barrientos question from yesterday.Ben Muller
12/01/2022, 9:45 PMState message: Submission failed. IndexError: list index out of range
Unfortunately there are no logs in the agent with any failures either 🤷
This did lead me to see some other errors in the agent 🧵Scott Walsh
12/01/2022, 11:09 PMprefect kubernetes manifest agent
command seems to only take in one queue. I'd like the agent to read from multiple queues, is there syntax I can change or is this a bug?
using prefect==2.6.7
(scott/CD-562-prefect-poc) prefect kubernetes manifest agent -q test1 -q test2
apiVersion: apps/v1
kind: Deployment
metadata:
name: prefect-agent
namespace: default
labels:
app: prefect-agent
spec:
selector:
matchLabels:
app: prefect-agent
replicas: 1
template:
metadata:
labels:
app: prefect-agent
spec:
containers:
- name: agent
image: prefecthq/prefect:2.6.7-python3.9
command: ["prefect", "agent", "start", "-q", "test2"]
imagePullPolicy: "IfNotPresent"
env:
- name: PREFECT_API_URL
Faheem Khan
12/02/2022, 1:06 AMBen Muller
12/02/2022, 3:35 AMimport time
from prefect import flow, get_run_logger
from prefect.deployments import run_deployment
@flow
def run():
x = run_deployment(name="dro-gallops-fields/default", idempotency_key=str(int(time.time())), timeout=0)
while x:
time.sleep(5)
get_run_logger().info(x.state)
get_run_logger().info(x.state_name)
get_run_logger().info(x.state_type)
get_run_logger().info(x.state.message)
get_run_logger().info(x.state.result)
if __name__ == "__main__":
run()
This does everything I expect in Prefect Cloud but the logs on the parent flow "run" show something like this ( forever - it never exits the Scheduled state and updates in line with its actual state ? ) :
While the subflow run has the flow makred as Complete
- is there a different way to ping the state in prefect 2 ?Andreas Nigg
12/02/2022, 7:29 AMCrash detected! Execution was interrupted by an unexpected exception: PrefectHTTPStatusError: Server error '500 Internal Server Error' for url '<https://api.prefect.cloud/api/accounts/bd169b15-9cf0-41df-9e46-2233ca3fcfba/workspaces/f507fe51-4c9f-400d-8861-ccfaf33b13e4/task_runs/5d8fc4a8-5ce7-444d-8749-135dce75d9be/set_state>'
Response: {'detail': {'exception_message': 'Internal Server Error'}}
For more information check: <https://httpstatuses.com/500>
EDIT: Ok I found a thread in the best-practices-coordination - channel - there it was confirmed that there was a small service interruption. Therefore this question is obsolete.Deepanshu Aggarwal
12/02/2022, 8:30 AMSylvain Hazard
12/02/2022, 9:49 AMSlackbot
12/02/2022, 2:14 PMBraun Reyes
12/02/2022, 3:45 PMXavier Babu
12/02/2022, 3:49 PMPatrick Alves
12/02/2022, 4:19 PMKubernetesJobs
.
I’ve experiencing an issue when I run workflows from UI.
1. I select a Flow -> RUN
2. It schedules a Flow for the next seconds.
3. But the flow keep on pending forever.
4. It actually creates another flow that runs (with no tags, see the images)
On the image every squared are actually the same RUN created twice. The original never run, and it creates a new one that runs.jack
12/02/2022, 4:44 PMSean Conroy
12/02/2022, 5:12 PMTraceback (most recent call last):
ERROR | asyncio - Task exception was never retrieved
"future: <Task finished name='Task-36' coro=<<async_generator_athrow without __name__>()> exception=KeyError(139836083032272)>"
File "/usr/local/lib/python3.8/dist-packages/prefect/utilities/asyncutils.py", line 263, in on_shutdown yield
GeneratorExit
During handling of the above exception, another exception occurred:
File "/usr/local/lib/python3.8/dist-packages/prefect/utilities/asyncutils.py", line 267, in on_shutdown
EVENT_LOOP_GC_REFS.pop(key)
KeyError: 139836083032272"
Sean Conroy
12/02/2022, 5:12 PMTraceback (most recent call last):
ERROR | asyncio - Task exception was never retrieved
"future: <Task finished name='Task-36' coro=<<async_generator_athrow without __name__>()> exception=KeyError(139836083032272)>"
File "/usr/local/lib/python3.8/dist-packages/prefect/utilities/asyncutils.py", line 263, in on_shutdown yield
GeneratorExit
During handling of the above exception, another exception occurred:
File "/usr/local/lib/python3.8/dist-packages/prefect/utilities/asyncutils.py", line 267, in on_shutdown
EVENT_LOOP_GC_REFS.pop(key)
KeyError: 139836083032272"
Bianca Hoch
12/02/2022, 5:18 PMSean Conroy
12/02/2022, 5:19 PMMichael Adkins
12/02/2022, 6:29 PMprefect orion start
?Sean Conroy
12/02/2022, 6:32 PMprefect orion start
anywhere.import os
import json
from flask import Flask, request
import logging
import traceback
from prefect.orion.schemas.states import StateType
app = Flask(__name__)
#################################################
#
# Flask routes
#
#################################################
@app.route('/', methods=['POST'])
def default_route_main():
force_exception = location_success = False
try:
# Run flow
flow_state = my_flow(return_state=True)
force_exception = flow_state.result()
flow_success = flow_state.type == (StateType.COMPLETED)
Michael Adkins
12/02/2022, 6:44 PMSean Conroy
12/02/2022, 6:45 PMMichael Adkins
12/02/2022, 6:48 PMprefect orion start
then set the PREFECT_API_URL
to localhost in your config.. let me seeSean Conroy
12/02/2022, 6:49 PMMichael Adkins
12/02/2022, 6:50 PMSean Conroy
12/02/2022, 6:51 PMMichael Adkins
12/02/2022, 6:52 PMprefect kubernetes manifest orion