New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefect Orion fails to start on Windows when there is a space in Prefect package's path #6821
Comments
Yep, that's definitely a bug, thanks for reporting it Ryan! |
Kindly allow me to fix this bug. |
Go for it! Let us know if you run into issues. |
Prefect Orion fails to start on Windows when there is a space in Prefect package's path. PrefectHQ#6821
Bug Fix - Issue PrefectHQ#6821
@madkinsz Let me know if there is something else you are expecting. Fixed this bug by updating the absolute path to the relative path. |
The code below converts the command to a string on the Windows platform and this is affecting how the command is interpreted in the shell. prefect/src/prefect/utilities/processutils.py Lines 24 to 28 in 9b5123c
The comment in the code says that "shell=True is generally required for Unix-like commands on Windows" but the submodule.Popen documentation treats it differently:
When converting the command to string, the function does not quote the path correctly: uvicorn --app-dir c:\users\halle\pycharm projects\prefect\src --factory prefect.orion.api.server:create_app --host 127.0.0.1 --port 4200 Without this conversion (I removed it from the code) the command runs correctly, both on POSIX and Windows systems: uvicorn --app-dir 'c:\users\halle\pycharm projects\prefect\src' --factory prefect.orion.api.server:create_app --host 127.0.0.1 --port 4200 I think to solve this problem, the conversion should not take place in that part of the code. This responsibility must be on the one who calls this function to pass the command correctly. |
First check
Bug summary
If the Prefect package is installed on Windows in a directory containing a space in the pathname, Prefect Orion fails to start because it cannot launch Uvicorn.
The problem happens when we set the
--app-dir
flag just before launching Uvicorn.Reproduction
prefect orion start
You can also observe the problem directly by running something like:
Error
Versions
Additional context
Place where this occurs in Prefect's code:
prefect/src/prefect/cli/orion.py
Line 127 in 2f27976
The text was updated successfully, but these errors were encountered: