https://prefect.io logo
Title
j

Jason Noxon

12/19/2022, 9:54 PM
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/prefect/cli/_utilities.py", line 41, in wrapper
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/prefect/utilities/asyncutils.py", line 205, in coroutine_wrapper
    return run_async_in_new_loop(async_fn, *args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/prefect/utilities/asyncutils.py", line 156, in run_async_in_new_loop
    return anyio.run(partial(__fn, *args, **kwargs))
  File "/usr/local/lib/python3.8/dist-packages/anyio/_core/_eventloop.py", line 70, in run
    return asynclib.run(func, *args, **backend_options)
  File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 292, in run
    return native_run(wrapper(), debug=debug)
  File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 287, in wrapper
    return await func(*args)
  File "/usr/local/lib/python3.8/dist-packages/prefect/cli/cloud.py", line 429, in login
    workspace = current_workspace or workspaces[0]
IndexError: list index out of range
1
m

Marwan Sarieddine

12/19/2022, 10:21 PM
looks like you need to create a workspace from what I can tell
workspace = current_workspace or workspaces[0]
IndexError: list index out of range
j

Jason Noxon

12/20/2022, 12:34 PM
But I have a cloud workspace - and there is no where to specify a workspace, that I can see. Maybe in the setting up of the API key? I'll look.
I just saw that there is a --workspace flag, so that's good. However, it says my workspace doesn't exist.
r

Rob Freedy

12/20/2022, 3:20 PM
Hey @Jason Noxon!! Are you able to see your workspace in the Cloud UI (you can see workspaces in the UI by clicking this logo on the left side)? What Prefect version are you on? You can see this by running
prefect version
j

Jason Noxon

12/20/2022, 3:20 PM
Hi, @Rob Freedy - Yes, I am.
And the handles are correct.
r

Rob Freedy

12/20/2022, 3:24 PM
I am able to recreate this error by attempting to login to an account that doesn't have any workspaces. Are you able to create another API Key from the account that has access to that workspace and attempt to login using this command
prefect cloud login -k <new_key>
j

Jason Noxon

12/20/2022, 3:30 PM
I am not convinced that I set up the key correctly - so yes... 🙂
@Rob Freedy Thank you, Rob - that did it.
:party-parrot: 1
👍 1
🔥 1
r

Rob Freedy

12/20/2022, 3:33 PM
My pleasure!
1