https://prefect.io logo
Docs
Join the conversationJoin Slack
Channels
announcements
ask-marvin
best-practices-coordination-plane
data-ecosystem
data-tricks-and-tips
events
find-a-prefect-job
geo-australia
geo-bay-area
geo-berlin
geo-boston
geo-chicago
geo-colorado
geo-dc
geo-israel
geo-japan
geo-london
geo-nyc
geo-seattle
geo-texas
gratitude
introductions
marvin-in-the-wild
prefect-ai
prefect-aws
prefect-azure
prefect-cloud
prefect-community
prefect-contributors
prefect-dbt
prefect-docker
prefect-gcp
prefect-getting-started
prefect-integrations
prefect-kubernetes
prefect-recipes
prefect-server
prefect-ui
random
show-us-what-you-got
Powered by Linen
prefect-community
  • d

    Dan Zhao

    08/05/2021, 9:27 AM
    Hi community, I notice the schedule flow runs come with funny names (e.g. melodic-donkey). Is it possible to template the flow run names? Looked through the docs but it's not mentioned anywhere.
    j
    z
    • 3
    • 2
  • c

    Chhaya Vankhede

    08/05/2021, 11:05 AM
    Hey, I'm new to prefect and have a question regarding sharing objects between different flows. I have two different flows,
    flow_1
    initializes the object and
    flow_2
    uses that object, but I'm not able to achieve this. This is the example code not exact but similar to what I'm trying to achieve. adding code to thread
    k
    • 2
    • 7
  • p

    Pierre Monico

    08/05/2021, 12:42 PM
    Hi there! Using Prefect for a few weeks now on one of my consulting jobs (in prod). Just started to get into using Prefect Server and have a few questions - that’s why I’m here 🙂
    k
    • 2
    • 1
  • t

    Tim Enders

    08/05/2021, 1:18 PM
    Can anyone tell me what
    KeyError: 110
    is? I think it is a Prefect error, though it may be Dask. The stack trace has it coming out of the executor.py code. (trace to follow in thread)
    k
    • 2
    • 34
  • j

    Jai Deo

    08/05/2021, 1:52 PM
    I have cloud server, kubernetes AKS agent and a flow in Azure storage with a customised container image in azure container registry. When I run the flow it fails on authorisation 401. I have supplied the password to the image in the imagepullsecrets env variable. The error is : Kubernetes Error: rpc error: code = Unknown desc = failed to pull and unpack image "prefregistry.azurecr.io/mstools:v1": failed to resolve reference "prefregistry.azurecr.io/mstools:v1": failed to authorize: failed to fetch anonymous token: unexpected status: 401 Unauthorized.
    k
    • 2
    • 13
  • h

    haven

    08/05/2021, 3:48 PM
    Currently wrapping a function with
    @task
    removes all type signatures that the function was given and a bare
    FunctionTask
    is returned. Any thoughts of improving the
    @task
    decorator such that all type signatures persist? That would help tremendously with type-checking for flows. Happy to contribute too, if such a proposal is somewhat sensible.
    k
    m
    • 3
    • 2
  • c

    Constantino Schillebeeckx

    08/05/2021, 5:28 PM
    I'm having some issues using the
    Github
    storage. I'm configuring it like
    GitHub(
            repo="some_org/repo_name",
            path="path/to/flow.py",
            access_token_secret="secret_name", 
            ref="stg"
    )
    When I execute the flow I get the following failure:
    Failed to load and execute Flow's environment: GithubException(422, {'message': 'No commit found for SHA: stg', 'documentation_url': '<https://docs.github.com/rest/reference/repos#get-a-commit'}>).
    That repo definitely has the branch, do I need to reference it in a special way?
    k
    j
    • 3
    • 17
  • m

    Mehdi Nazari

    08/05/2021, 6:08 PM
    Hi All, I’m having a strange problem executing SQL command within tasks in a Flow. To summerise, I’m using sqlalchemy to execute those commands for me on the database. the issue is that commands are getting executed with no error returned, but later looking at the database, none of those commands went into effect (as if the were not executed at all). Surprsingly, another task within the same Flow is able to successfully utilize the engine (instantiated the same way), when pandas is using that to dump a dataframe into the database. I did a test on the docker environment, where the tasks are executed, and surprisigly, all those sql command are getting executed successfully. I’m a little puzzled as to why a task can utilize sqlalchemy engine and another task fails to do so? please help.
    k
    • 2
    • 18
  • l

    Lauri Makinen

    08/05/2021, 6:09 PM
    Hi all, I want to make a Flow where I run certain tasks on different agents (some on Local, some on Kubernetes). For this purpose I've understood I need to wrap my Tasks in Flows, which have different run_configs depending on where they are run. I now have one parent Flow from which I launch child Flows using StartFlowRun. My question is how do I pass Parameters to these child Flows?
    extract_flow_task = StartFlowRun(flow_name=extract_flow.name, wait=True, project_name=PROJECT_NAME)
    transform_flow_task = StartFlowRun(flow_name=transform_flow.name, wait=True, project_name=PROJECT_NAME)
    
    #
    # Parent flow, executed on Kubernetes agent
    #
    with Flow("parent_flow", storage=storage, run_config=KubernetesRun(labels=["kubernetes"])) as parent_flow:
        date_YYYYmmdd = Parameter("date_YYYYmmdd")
        extract_task = extract_flow_task() # How to pass date_YYYYmmdd to this flow/task?
        transform_flow_task(upstream_tasks=[extract_task]) # How to pass date_YYYYmmdd to this flow/task?
    k
    • 2
    • 2
  • b

    Ben Muller

    08/05/2021, 10:26 PM
    Hey community, would there be a way to set an
    Automation
    for notifications for all flows except
    flow_name
    as an option ? Or would I need to do something custom to do that?
    j
    m
    • 3
    • 5
  • f

    Fina Silva-Santisteban

    08/05/2021, 11:02 PM
    Hi everyone! I’d like to mark that a task is dependent from the successful completion of another task. The docs (https://docs.prefect.io/core/concepts/tasks.html#triggers) only show examples about how to add a
    trigger
    in the
    run()
    method, but these tasks are written using the task decorator only.
    @task
    def parent():
    
    @task
    def child():
    What are the best next steps?
    k
    • 2
    • 3
  • l

    Luuk

    08/06/2021, 6:23 AM
    Hi Everyone, I'm using the prefect-agent (Docker agent) within Azure as VM. And I connected it to my Prefect Cloud, but I'm unsure how to send my flow triggers to the Docker Agent. So far all my registered flows still go to the Local Agent, but when I'm not inside my VM the Local Agent goes offline, while it looks like the Docker Agent is always online (keeps pinging it every 10-ish seconds with heartbeat) My simple flow is inside the 2nd image. I also tried using, but the flow still went to my Local agent My DockerAgent is using the 'prod' label.
    from prefect import task, Flow
    from prefect.run_configs import DockerRun
    
    
    @task
    def say_hello(x=1):
        return f"Test {x}'
    
    
    with Flow("hello-world") as flow:
        first = say_hello()
        second = say_hello(2)
    
    flow.config_run = DockerRun()
    flow.register(project_name='test', labels=['prod'])
    So question: How do I send the flow created inside my Azure VM to the VM's DockerAgent using the Prefect Cloud orchestration?
    k
    • 2
    • 2
  • f

    flavienbwk

    08/06/2021, 8:32 AM
    Hi, I have a question about Prefect agents and Flows : is there something in Prefect such as Kubernetes'
    resources
    parameters to specify resource affinities (RAM, CPU cores, GPU environment) a Flow requires to be run ? Ex (Kubernetes) :
    resources:
          requests:
            memory: "64Mi"
            cpu: "250m"
          limits:
            memory: "128Mi"
            cpu: "500m"
    Thanks !
    k
    m
    • 3
    • 18
  • a

    Adam Everington

    08/06/2021, 8:35 AM
    Hey all, i'm struggling to connect to our Azure Devops Repo using the GIT storage class. I keep getting an HTTP Unauthorized error. I've tried connecting with git credentials and with a PAT and neither work. Has anyone else managed to connect to AZ Devops?
    k
    m
    • 3
    • 8
  • a

    Arun Giridharan

    08/06/2021, 5:24 PM
    Does anyone know if it is possible to kick off a script in a different git repo in a prefect flow?
    a
    • 2
    • 6
  • c

    Constantino Schillebeeckx

    08/06/2021, 5:56 PM
    hi prefect! I"m struggling to use the
    DbtShellTask
    along with secrets (more details in thread)
    e
    k
    • 3
    • 8
  • d

    Daniel Bast

    08/06/2021, 5:58 PM
    Hi. we are using prefect agents with dask executors... after some time (<1day) log streaming from tasks (logger = prefect.context.get("logger"); logger.info(text)) stops to appear in the cloud flow log.... the log can be still seen in the dask worker log on the machine ... is streaming breaking? is it a rate limit? any pointer how to debug that? (cc @Connor Martin )... though there is a tiny bit of log until it runs on dask ... Flow successfully downloaded. Using commit: YYY Beginning Flow run for 'XXX' Connecting to an existing Dask cluster at tcp://localhost:8786 ... no content here which is the problem ... Flow run FAILED: some reference tasks failed.
    a
    k
    f
    • 4
    • 25
  • j

    joshua mclellan

    08/06/2021, 6:25 PM
    Hi there, im trying to build a flow where at the beginning of the flow I have a task that creates a new database then I want to pass that to all of the remaining tasks. (ie one task preps the stage and then all other tasks use that) Is there a way to do this with the context? Can have that task write to the context and then have all my other tasks reference that?
    e
    k
    • 3
    • 13
  • r

    Riley Hun

    08/06/2021, 9:04 PM
    Hi everyone, There is an issue where the first task in the flow is re-running before finishing. This happens 3-4 times and then the run fails with
    KilledWorker
    error. It keeps restarting the first task. Do you know what the issue could be?
    k
    • 2
    • 8
  • n

    Nelson Griffiths

    08/07/2021, 8:13 PM
    I have a quick question about logging that I can't quite find in the docs. I have a private package that I pip install into my docker environment that runs my Prefect flows. I want to see the logging output from the code run inside that private package on the UI for prefect cloud. It currently shows up on the agent side, but I can't seem to figure out how to get it to log to the UI. Since it is in another package that is used other places it doesn't make sense to use the Prefect logger like I do for code running in the flows. I am using loguru and just writing to stdout. Any easy way to make these logs appear in the UI?
    c
    k
    • 3
    • 2
  • h

    Hugo Shi

    08/08/2021, 12:11 AM
    I have a flow that runs every minute - at one point my agent went down and now there are 15 that are in "running" state. Is there a way to cancel them all?
    c
    • 2
    • 3
  • n

    Nivi Mukka

    08/08/2021, 1:35 AM
    Hi everyone, All my prefect runs are failing with a same error when interacting with any Google Python APIs (ex:
    google-cloud-secret-manager
    ,
    google-cloud-logging
    , etc.). All the Google python packages are running into a grpc transport error. It may be a package version issue or maybe some conflict.
    k
    • 2
    • 27
  • k

    Kien Nguyen

    08/08/2021, 3:27 AM
    Hi, anyone have an example using prefect to extract batches of data without knowing the size of the data? Kind of recursive fetching until no more?
    k
    • 2
    • 13
  • s

    Scott Vermillion

    08/08/2021, 6:16 PM
    Hello Prefect Land! Simple request. I have a notification (new file upload) set up in AWS S3 that goes to SNS. From there, it branches to send an e-mail and also kick off a lambda function that kicks off a flow in Prefect. When I receive the e-mail, I can see the entire file path in S3. How can I get that same info over to my Prefect flow so I can parameterize? I hope I’m making sense… Best All!
    k
    • 2
    • 4
  • n

    Nadav

    08/09/2021, 12:38 AM
    Hi, I deployed an ECS agent as a fargate service, i use run_config as ECSRun but when the agent creates the task definition it creates it with EC2 compatibility, and flow fails with exception “task not support fargate launc type” Any suggestions? Am i missing something?
    b
    • 2
    • 2
  • j

    Jelle Vegter

    08/09/2021, 9:22 AM
    Does anyone else have an issue where the dashboard isn't properly rendering in Google Chrome?
    j
    • 2
    • 2
  • b

    Ben Collier

    08/09/2021, 10:22 AM
    Hi all - we’ve got one system on which the workflows which we’re kicking go into a state of “submitted” but don’t seem to go any further. It just started happening recently, and I’m not sure what might have caused it. Will investigate today but are there any immediate gotchas that we should be looking for?
    k
    • 2
    • 1
  • l

    Lauri Makinen

    08/09/2021, 12:27 PM
    Hi! My Flow schematic looks funny. I am using StartFlowRun to launch sub-flows. Basically everything works, but the schematic and logs look... funny. Am I doing something wrong?
    k
    • 2
    • 9
  • s

    Samuel Hinton

    08/09/2021, 12:39 PM
    Hey all, I was wondering if anyone had experience with the
    local_agent
    slowly leaking memory? Over a day or two the memory usage of our local agent service will grow until its out and then we run into exceptions when new flows try to be scheduled. It might not be a memory error, but our 3GB memory cap on the service seems to be not be sufficient.
    k
    k
    • 3
    • 35
  • s

    Samuel Hinton

    08/09/2021, 2:30 PM
    @Kevin Kho another different question from me - but is this a known bug in prefect? My dashboard commonly shows inaccurate numbers. 12 failed flows in the past 24 hours, but also 50.3% of 559 failed, which is >>12. The confusing part is we have slack notifications turned on for all flows, and we’ve received only 2 notifications in the last 24 hours, and Im not sure who to trust. 2 failures, 12 failures, or 281 failures.
    j
    m
    • 3
    • 12
Powered by Linen
Title
s

Samuel Hinton

08/09/2021, 2:30 PM
@Kevin Kho another different question from me - but is this a known bug in prefect? My dashboard commonly shows inaccurate numbers. 12 failed flows in the past 24 hours, but also 50.3% of 559 failed, which is >>12. The confusing part is we have slack notifications turned on for all flows, and we’ve received only 2 notifications in the last 24 hours, and Im not sure who to trust. 2 failures, 12 failures, or 281 failures.
j

Jenny

08/09/2021, 3:18 PM
Hi @Samuel Hinton - Thanks for the question. For the dashboard: The failed flows tile shows flows that have failed. Each flow may well have many runs that failed. So the dashboard shows you have 12 failed flows and 281 failed flow runs. (You can click into the failed flows to see which and how many runs failed if needed.) The 2 slack notifications sounds like you are potentially missing some failed flows in your notifications - how do you have those set up? (Cloud hook? Slack notifier? SlackTask?)
s

Samuel Hinton

08/09/2021, 3:30 PM
Hi Jenny. To clarify, if I have a Flow “FlowA” and its scheduled to run every hour and it fails for the entire day, I would have 24 Flow run failures on the left, and 1 failed flow on the right? Or is it only counting the reruns/retries? Re the notifications we have this set up for all flows
handler = slack_notifier(_only_states_=[Failed])
Of those, only two flow runs for our
M7 Polling
flow were received. (I note that prior days have notifications for all our different flows). Maybe its related to the memory issues I was discussing with Kevin, and the notifications failed silently
j

Jenny

08/09/2021, 3:33 PM
Thanks @Samuel Hinton - Yes "Flow A" would show in your failed flow tile and the 24 run failures would be counted in your flow run total. The notifier issue sounds like something didn't work - let me check your conversation with Kevin...
s

Samuel Hinton

08/09/2021, 3:35 PM
Ah okay, thats good to know, apologies for misunderstanding the dashboard. A TLDR is that both my local-agent and dask-workers were running out of memory due to accumulating results that I wasnt aware of. Until I get a bucket setup, Ive just turned off checkpointing and will monitor those services
j

Jenny

08/09/2021, 3:42 PM
Ah - do you know if those failed flow runs actually ran? If they failed before they could get into a running state the state handler wouldn't have been fired.
s

Samuel Hinton

08/09/2021, 3:44 PM
Yeah that might be it, I can see osmething about a Lazarus process so that makes sense - if it never kicked off properly then the notifier wouldnt have triggered
j

Jenny

08/09/2021, 4:26 PM
A Cloud Hook (or automation if using Cloud) would catch those for you if you need alerts for those in the future.
s

Samuel Hinton

08/10/2021, 8:02 AM
Ah, Cloud hooks look good. We have quite a number of flows, is it possible to configure the cloud hooks the same way as the state handler (by defining something attached to the flow using the python API?)
j

Jenny

08/10/2021, 1:00 PM
Good question! I haven't done this but I think you could set one using the
create_cloud_hook
mutation and possibly setting the version_group_id for your flow or querying for it. There's an old issue here with comments from one of our users about how they set this up: https://github.com/PrefectHQ/prefect/issues/2457
s

Samuel Hinton

08/10/2021, 1:03 PM
Hi Jenny, I agree that in the register isnt a good place as per the discussion, but its a shame there isnt another python API. From the comments it looks like we’d need at least graphql queries to set this up, and I have no experience with those. Is it possible to add a request for example queries added to the documentation. For now Ill go through and make them all manually as thatll be faster than trying to figure out graphql structure 🙂
j

Jenny

08/10/2021, 2:26 PM
Great suggestion on updating the docs there. I think there's one example but it's pretty basic: https://docs.prefect.io/orchestration/concepts/api.html#getting-started @Marvin open "Add more python client query examples to the docs"
🙏 1
m

Marvin

08/10/2021, 2:26 PM
https://github.com/PrefectHQ/prefect/issues/4853
View count: 1