Hello, I have deployment.py script. Created follo...
# prefect-community
a
Hello, I have deployment.py script. Created following steps here https://link.medium.com/wk3Q25foxtb and docs. I am getting strange error its not from prefect but from shutil.copytree it complains: mkdir(name, mode) fileexistserror: [errno 17] file exists: '.' Has anyone encounter this before?
c
HI Amol - that’s a very generic error, and without a traceback there is no way of telling where this error occurred, or what operations was being called other than the literal “shutil.copytree”
a
I am following exact steps in medium post. Using Prefect version: 2.3.2 below is stack trace
c
Where is your agent running, and what version of prefect is it running? Where did you create the deployment for this flow, and what storage block did you use to create it? It looks like it’s checking deployment.path locally
a
Prefect version is 2.3.2. Agent is running on same host as prefect server. I have not configured any storage block. Python version I am using 3.7.5
j
Hi Amol. There are a few different examples in that post are you able to share your code and more information about the deployment environment in a code block?
a
Code is the same example as in post github, my_deploy.py. I have prefect server in linux host, using sqlite3 as db. Both prefect server and agent run on same host and same venv.
j
Hi Amol. It’s still a bit hard to tell what’s going on. Is the file in the same location with your flow code in it? It seems like the error is saying it can’t find the file with the flow code.
a
Its in same location, have cloned the git project
j
Hmm. I just cloned the repo locally, and cd’d into the folder.
Copy code
python my_deployment.py
prefect deployment run "pipeline/Python Deployment Example"
Copy code
prefect agent start -q default
No issues.
a
Will python version matter I am using 3.7.5
j
It shouldn’t. 3.7+ are supported.
a
Executing code from mounted AFS path could be a problem?
j
That sounds plausible.
a
@Jeff Hale Below is what I observe: On error file exists ".". This is coming from file: /prefect/filesystems.py Line 54, in load_flow_from_flow_run await storage block.get_directory(from_path-deployment.path, local_path=".") Issue is here: shutil.copytree(from_path, local_path) Error is when shutil tries to create folder "." It fails as it already exist. Since in linux there are hidden folders "." Or ".." Replacing "." With different name this error goes away.
My flow runs only if I replace the local_path from "." Something else. e.g. local_path="flowstore"
Can we have fix for this?
j
Hi Amol. Thank you for the info. What’s the exact command you run to see the error?
a
Hi Jeff, In linux. If you try using shutil simply in IDLE you will get error. Provided you have "." And ".." Refer attached.
j
Thank you. I’m not sure what command you are running that is throwing that error, though.
a
It ia when you are running flow via agent
I have deployed flow and trigger it from UI and start agent to pick it up
Deployment file is quite standard please refer
And then I am starting agent as: prefect agent start -q work_queue_name
j
Thank you. Was your entrypoint just
.
previously when it was giving you an error?
a
No the entry point is absolute path. The flow only works if I modify prefect to replace local_path = "." Some thing else
Do you need more details?
j
Hi Amol. I’ve linked to the conversation in this GitHub issue that you can track. If you want to add details or think the issue is distinct, please open another issue at the Prefect GitHub repo. 🙂
a
Sure thanks will add details there
a
sorry I'm randomly jumping into this thread, but I'm having similar problem on a linux machine with Python 3.7. The problem disappears when I upgrade to python 3.8, so I don't think it's a platform issue.
j
That sounds like it might be a different Aaron. I'd you could open a new issue with the bug report at the GitHub repo that would be great.