I'm trying to follow the Prefect Quickstart guide. I'm using a GitHub codespace. I was able to clone and run 01_getting_started.py without trouble. however when I run step 3
uvx prefect-cloud deploy 01_getting_started.py:main \
--name my_first_deployment \
--from https://github.com/PrefectHQ/quickstart
when I follow that it opens a webpage that says
"To continue, please run the following in your terminal:"
but in the terminal it doesn't have an option to enter the key. So the codespace hangs indefinitely.
I've also tried going line by line, using the login and the key. which says
prefect cloud login --key <<my_key>>
It looks like you're already authenticated on this profile.
? Would you like to reauthenticate? [y/N]: N
Authenticated with Prefect Cloud! Using workspace 'username/default'.
If I choose no, it says everything is fine. which it is, until I run
prefect-cloud deploy 01_getting_started.py:main
where it then inevitably asks to open the authorization window and the cycle repeats.
I think the simple workaround of course would be finding out why it's not opening a space to open this in the codespace, but I can't square it. In my cloud console it shows that the first flow has succeeded
"Task Runs
51
51
Completed
100%"
Other fun bits and bobs: If I tell it I do want to re-authenticate, the following happens:
@user ➜ /workspaces/Prefect (main) $ prefect cloud login
It looks like you're already authenticated on this profile.
? Would you like to reauthenticate? [y/N]: y
? How would you like to authenticate? [Use arrows to move; enter to select]
Log in with a web browser
> Paste an API key
Paste your API key:
Authenticated with Prefect Cloud! Using workspace 'user/default'.
@user ➜ /workspaces/Prefect (main) $ ls
LICENSE README.md prefect_01_getting_started.py quickstart
@user ➜ /workspaces/Prefect (main) $ prefect-cloud deploy 01_getting_started.py:main \
> --name my_first_deployment \
> --from https://github.com/PrefectHQ/quickstart
same hanging. Feeling like I'm losing my mind in this loop. Please help.
1 Answer 1
I'm sorry you're running into this.
Could you try running prefect-cloud login --key <key>(note the - in prefect-cloud) and see if that works instead? Additionally would you mind sharing your browser version?
In case that doesn't work here are some other workarounds:
1: Try Chrome (if you're not already)
2: Manually create/edit ~/.prefect/profiles.toml to look like:
active = "prefect-cloud"
[profiles.prefect-cloud]
PREFECT_API_URL = "https://api.prefect.cloud/api/accounts/<your account id>/workspaces/<your workspace id>"
PREFECT_API_KEY = "<your api key>"
3: Use environment variables:
export PREFECT_API_URL="https://api.prefect.cloud/api/accounts/<your account id>/workspaces/<your workspace id>"
export PREFECT_API_KEY="<your api key>"