https://prefect.io logo
Title
a

Amol Shirke

09/22/2022, 7:23 PM
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

Christopher Boyd

09/22/2022, 7:32 PM
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

Amol Shirke

09/22/2022, 9:48 PM
I am following exact steps in medium post. Using Prefect version: 2.3.2 below is stack trace
c

Christopher Boyd

09/22/2022, 10:05 PM
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

Amol Shirke

09/22/2022, 11:54 PM
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

Jeff Hale

09/23/2022, 12:14 AM
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

Amol Shirke

09/23/2022, 8:27 AM
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

Jeff Hale

09/23/2022, 1:50 PM
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

Amol Shirke

09/23/2022, 1:56 PM
Its in same location, have cloned the git project
j

Jeff Hale

09/23/2022, 2:13 PM
Hmm. I just cloned the repo locally, and cd’d into the folder.
python my_deployment.py
prefect deployment run "pipeline/Python Deployment Example"
prefect agent start -q default
No issues.
a

Amol Shirke

09/23/2022, 2:16 PM
Will python version matter I am using 3.7.5
j

Jeff Hale

09/23/2022, 2:18 PM
It shouldn’t. 3.7+ are supported.
a

Amol Shirke

09/23/2022, 2:20 PM
Executing code from mounted AFS path could be a problem?
j

Jeff Hale

09/23/2022, 2:25 PM
That sounds plausible.
a

Amol Shirke

09/27/2022, 8:03 AM
@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

Jeff Hale

09/27/2022, 11:59 AM
Hi Amol. Thank you for the info. What’s the exact command you run to see the error?
a

Amol Shirke

09/27/2022, 12:23 PM
Hi Jeff, In linux. If you try using shutil simply in IDLE you will get error. Provided you have "." And ".." Refer attached.
j

Jeff Hale

09/27/2022, 12:31 PM
Thank you. I’m not sure what command you are running that is throwing that error, though.
a

Amol Shirke

09/27/2022, 12:32 PM
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

Jeff Hale

09/27/2022, 12:58 PM
Thank you. Was your entrypoint just
.
previously when it was giving you an error?
a

Amol Shirke

09/27/2022, 1:49 PM
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

Jeff Hale

09/28/2022, 1:44 PM
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

Amol Shirke

09/28/2022, 1:53 PM
Sure thanks will add details there
a

Aaron Guan

10/12/2022, 2:18 AM
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

Jeff Hale

10/12/2022, 12:56 PM
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.