Karanveer Mohan
07/26/2022, 9:04 PMprefect cloud login -k KEY -w WORKSPACE
now asks for "Creating a profile for this Prefect Cloud login. Please specify a profile name:"
This breaks my deployment flow since I need it to be programmatic. I also tried running prefect profile create
before but that doesn't seem to help. I also can't give the name of an existing profile. Could someone help explain what I'm doing wrong? I tried searching in the docs but maybe I'm missing something
2/ I was able to just hit enter locally and got the following message "Logged in to Prefect Cloud using profile ''." However, if I try to do prefect cloud login
or prefect profile inspect
after this, it throws the following error. I had to fix this by manually deleting profiles.toml
. Code in threadAnna Geller
07/26/2022, 9:29 PMKaranveer Mohan
07/26/2022, 9:31 PMTraceback (most recent call last):
File "/Users/kvm/Desktop/cvf/venv/bin/prefect", line 5, in <module>
from prefect.cli import app
File "/Users/kvm/Desktop/cvf/venv/lib/python3.9/site-packages/prefect/__init__.py", line 81, in <module>
prefect.context.enter_root_settings_context()
File "/Users/kvm/Desktop/cvf/venv/lib/python3.9/site-packages/prefect/context.py", line 486, in enter_root_settings_context
profiles = prefect.settings.load_profiles()
File "/Users/kvm/Desktop/cvf/venv/lib/python3.9/site-packages/prefect/settings.py", line 1078, in load_profiles
user_profiles = _read_profiles_from(user_profiles_path)
File "/Users/kvm/Desktop/cvf/venv/lib/python3.9/site-packages/prefect/settings.py", line 1049, in _read_profiles_from
contents = toml.loads(path.read_text())
File "/Users/kvm/Desktop/cvf/venv/lib/python3.9/site-packages/toml/decoder.py", line 463, in loads
raise TomlDecodeError("Can't have a keygroup with an empty "
toml.decoder.TomlDecodeError: Can't have a keygroup with an empty name (line 3 column 1 char 13)
Dustin Ngo
07/26/2022, 9:38 PM.
is not a valid profile name (we should have better checking here). The second time you use prefect cloud login
you will switch to the profile associated with that key. The last workspace you used is remembered, so if you're changing workspaces you can change the workspace with prefect cloud workspace set -w <WORKSPACE>
. Setting both the PREFECT_API_URL
and PREFECT_API_KEY
environment variables like Anna mentioned above works also!Karanveer Mohan
07/27/2022, 12:10 AMRUN bash -c 'prefect cloud login -k KEY -w WORKSPACE <<< "profile_name"'
The documentation on https://orion-docs.prefect.io/ui/cloud-getting-started/ also says "The command then sets PREFECT_API_KEY and PREFECT_API_URL for the current profile.",
so I was quite confused why I need to create a new one. I tried running prefect profile use default
right before but prefect cloud login
still asked for a profile name. Anyway, just thought I'd share my experience. Maybe I'm just being an idiot and missing something obvious. But I hope it's helpful!Benny Warlick
07/27/2022, 12:44 AMAnna Geller
07/27/2022, 7:23 AM