Anyone able to assist me on this: after I updated ...
# prefect-community
t
Anyone able to assist me on this: after I updated to 2.7.6, all my scheduled flow is not able to run by the local agent.....they will show as Pending forever. I've posted my issue here as well: https://discourse.prefect.io/t/prefect-2-7-5-2-7-6-flow-stuck-at-pending-forever/2149
1
z
Hi. Previously you said that you were using a hosted API but your logs there show a client running with an ephemeral API talking to a database in your home directory.
Are the flow runs communicating with the same API / database as your agent?
t
Hi @Zanie, i didn't aware of this. What's the difference between the hosted and ephemeral API? I connected to the one established by
prefect orion start
which should be http://127.0.0.1:4200/api that hosted locally.
z
In this image you can see it is using the “ephemeral application” rather than “API at …”
Is the
PREFECT_API_URL
set?
t
doesn't seem so....what should I do now?
z
You’ll want to set the API URL to your API (looks like 127..?)
Then your flow run should contact the correct API and report its state
t
@Zanie I changed it to 127.0.0.1:4200/api However, my scheduled flow run is still showing 'Pending' state and agent shows 'frozen runpy'
message has been deleted
z
Interesting
The runpy warning is safe to ignore
You see that “running command: …” text?
What happens if you go to the directory that it says there and run the prefect engine command it displays?
t
let me try that command directly
@Zanie
z
mm you’ll need to pass the flow run id to it (just as the first argument)
t
like
python -m prefect.engine 9bcee788-6e55-4c99-8e86-cce0c66a58d8
?
z
yep!
👍 1
t
@Zanie It hangs in this state.....
z
🙂 Wonderful. That’s roughly what I expected but it’s good to be sure.
Probably retrieving your flow from storage
t
great that we have a clue here 🙂 any idea how can i fix that?
z
Here’s a branch with more logs
pip install git+<https://github.com/PrefectHQ/prefect@log-load>
then run that engine command again
(You can see the diff at https://github.com/PrefectHQ/prefect/pull/8075/files if you want)
t
Here's the result......btw, I stopped the previous prefect orion and prefect agent before pip install
wait, after i initiate a new orion api by
prefect orion start
and execute that
python -m prefect.engine 9bcee788-6e55-4c99-8e86-cce0c66a58d8
, now it shows the similar log as before:
basically stuck at connecting to API at | DEBUG | prefect.client - Connecting to API at http://127.0.0.1:4200/api/
z
Ah but it’s stuck there on the downloading from storage
And the storage path there is “K:\\” — A whole disk!
t
that's not good 🤕 how comes.....my code actually stored in that K drive
z
Is your code in some subdirectory directory of that drive? This might be a problem with how the deployment is defined or created.
t
yes
z
Are the contents of K:// being copied to the temporary directory where the flow is trying to run?
t
this is how the flow is built.....i built it right from the python code
z
cc @Peyton Runyan can you hop in here?
Can you share the output of
prefect deployment inspect
for that deployment?
t
message has been deleted
z
It looks like we set the path to the directory you run the code from https://github.com/PrefectHQ/prefect/blob/main/src/prefect/deployments.py#L720
Can you create your deployment again but call
python
from the directory your flow is in?
t
i see....let me try run the deployment code from the detailed drive path
z
Do you know if you ran it from
K://
before?
t
@Zanie It's working! Thank you sooooooo much
z
Np! We’ll look into some safeguards for this
❤️ 1
t
It's my bad not checking the working directory before running the script.....VS Code used to use the directory where the code resides 🙁