Slackbot
06/19/2024, 11:32 PMMarvin
06/19/2024, 11:33 PMPrefect Agent and Flow Deployment Issue SummaryI have a Prefect project on a Remote Desktop Server (RDP). Initially, I started the Prefect agent using this script: @echo off cd "C:\Users\sebastian-app-svr\AppData\Local\Programs\Python\Python312\Scripts>" prefect cloud logout prefect cloud login -k xxxxxxxxxx prefect agent start --pool "default-agent-pool" --work-queue "test" cmd This setup worked fine, allowing me to create and push code directly from the RDP. Prefect Cloud retrieved the code from GitHub. After a server crash and reboot, I changed the agent's directory to the project folder due to missing virtual environment libraries: cd "C:\Users\sebastian-app-svr\Desktop\SBA Projects\prefect-sba" Since then, flows intermittently fail with this error: shutil.Error: [('C:\\Users\\SEBAST~1\\AppData\\Local\\Temp\\2\\tmp5e3w4rv7prefect\\flows\\check_cert_client.py', '.\\flows\\check_cert_client.py', '[WinError 32] The process cannot access the file because it is being used by another process')] This error occurs when the deployment's working_dir is set to the same route as the Prefect agent. Deployments without a working directory work normally. Here's an example of a failing deployment: name: ghl