Hi all, I'm trying to deploy a flow in prefect 2.0...
# prefect-community
h
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
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
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
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
Yeah I realized that, but I think the error message could be clearer, instead of saying the flow is not detected.