https://prefect.io logo
#prefect-community
Title
# prefect-community
h

Ha Pham

08/05/2022, 9:53 AM
Hi all, I'm trying to deploy a flow in prefect 2.0 but keep encountering this "flow not found" error, even when the flow is clearly there. Is there anything in the .py file that can possibly prevent the flow from being detected?
m

Mason Menges

08/05/2022, 2:43 PM
Hey @Ha Pham For the sake of argument can you try inputting the full path to your file instead of the relative path and see if that helps?
h

Ha Pham

08/06/2022, 4:34 AM
Still does not work @Mason Menges
So I figured out how to make
deployment
works, but this is a strange behavior. I have a few lines of code to interact with a Secret block. If these lines are placed on top of the file (outside of the flow function) then
prefect deployment
will report that my flow function is not found. However, if I put it inside the flow function (
sync_circleci
), it can create the deployment. Not sure if this behavior is documented anywhere.
m

Mason Menges

08/08/2022, 9:48 PM
Hey @Ha Pham generally speaking blocks need to be referenced in the context of the flow, the flow serves as the entry point for your code so it wouldn't have been able to recognize the secrets you were defining when they existed as variables in the code separate from the flow so the flow would have failed to run even if it was successfully deployed, that said I think it is odd that it wasn't able to identify the flow in that instance.
h

Ha Pham

08/09/2022, 1:36 AM
Yeah I realized that, but I think the error message could be clearer, instead of saying the flow is not detected.
2 Views