https://prefect.io logo
Title
a

Aaron Goebel

12/15/2022, 11:52 PM
I'm getting a weird error even though my flow exists
prefect.exceptions.MissingFlowError: Flow 'tool' not found in script 'flows/tool.py'. Found the following flows: 'monolithic-tool-flow'. Check to make sure that your flow function is decorated with `@flow`.
I have the flow defined as
flows/tool.py
-------
@flow(name="monolithic-tool-flow")
def process_tool()...
and deploy like
prefect deployment build flows/tool.py:process_tool -n process_tool  -q test -ib docker-container/local --override image=sha256:4e3346168cs3a3c6c0fb256d6e705c6629a41f0f6f23405c33a0bbc3deb964690   --apply
1
Deployment works. Running does not
I'm packaging my flow with docker. This was working yesterday
Weirdly, renaming the flow worked.
m

Mike Grabbe

12/16/2022, 4:12 AM
I think this might be related to the 2.7.2 release. I just updated my images and I'm getting these errors as well
prefect.exceptions.MissingFlowError: Flow 'opsjira_extract_flow' not found in script 'flows/opsjira_extract_flow.py'. Found the following flows: 'dbt-cli-command' 'opsjira-extract-flow'. Check to make sure that your flow function is decorated with `@flow`.
I'm guessing it has to do with the changes introduced in this PR: https://github.com/PrefectHQ/prefect/pull/7817 I reverted back to 2.7.1 on my flow run images, and things are back to normal.
:gratitude-thank-you: 1
r

Rajeshwar Agrawal

12/16/2022, 10:52 AM
I am seeing the same issue with 2.7.2
1
its seems that flow name with underscore in the function name do not work, as deployment build command tries to find the flow with dashed case instead of underscores
:gratitude-thank-you: 1
my_flow
throws an error saying throws an error
Flow 'my_flow' not found in script 'flow/flow.py'. Found the following flows: 'my-flow'. Check to make sure that your flow function is decorated with `@flow`.
but
myflow
worked
a

Anna Geller

12/16/2022, 12:24 PM
thanks everyone for reporting, I was able to reproduce and opened a ticket, we'll fix that asap https://github.com/PrefectHQ/prefect/issues/7918
ofc it had to be the line 42 that causes the issue :42:
:42: 2
🤣 1
p

Peyton Runyan

12/16/2022, 2:35 PM
Thanks for the help yall! https://prefect-community.slack.com/archives/C01TK7XSLT0/p1671201324084329
❤️ 1
:gratitude-thank-you: 1