Thet Naing
12/27/2022, 6:37 PMGcpCredentials
block in both the Prefect UI and the Python API. I am able to save the credentials on the UI, but when I load the credentials, I get a Pydantic JSONDecodeError
. When I try to save the credentials from Python, I get the same error. Anybody know a solution or workaround?Bianca Hoch
12/27/2022, 6:43 PMThet Naing
12/27/2022, 6:43 PMAndrew Huang
12/27/2022, 7:28 PMBianca Hoch
12/27/2022, 8:36 PMprefect==2.7.3
and prefect-gcp==0.2.1
• Their team just switched over to an org from a personal workspace, and the PREFECT_API_URL and PREFECT_API_KEY were updated accordingly
• Problem: The profile was pulling incorrect environment variables, resulting in the JSONDecodeError
below when trying to run something from the CLI
(Thet, feel free to add or correct me if I'm missing something)Traceback (most recent call last):
File "/Users/thet/SystemInternal/information-extraction-pipeline/venv/lib/python3.10/site-packages/prefect/cli/_utilities.py", line 41, in wrapper
return fn(*args, **kwargs)
File "/Users/thet/SystemInternal/information-extraction-pipeline/venv/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 205, in coroutine_wrapper
return run_async_in_new_loop(async_fn, *args, **kwargs)
File "/Users/thet/SystemInternal/information-extraction-pipeline/venv/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 156, in run_async_in_new_loop
return anyio.run(partial(__fn, *args, **kwargs))
File "/Users/thet/SystemInternal/information-extraction-pipeline/venv/lib/python3.10/site-packages/anyio/_core/_eventloop.py", line 70, in run
return asynclib.run(func, *args, **backend_options)
File "/Users/thet/SystemInternal/information-extraction-pipeline/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 292, in run
return native_run(wrapper(), debug=debug)
File "/Users/thet/.pyenv/versions/3.10.9/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/Users/thet/.pyenv/versions/3.10.9/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/Users/thet/SystemInternal/information-extraction-pipeline/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 287, in wrapper
return await func(*args)
File "/Users/thet/SystemInternal/information-extraction-pipeline/venv/lib/python3.10/site-packages/prefect/cli/agent.py", line 163, in start
async with anyio.create_task_group() as tg:
File "/Users/thet/SystemInternal/information-extraction-pipeline/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 662, in __aexit__
raise exceptions[0]
File "/Users/thet/SystemInternal/information-extraction-pipeline/venv/lib/python3.10/site-packages/prefect/utilities/services.py", line 46, in critical_service_loop
await workload()
File "/Users/thet/SystemInternal/information-extraction-pipeline/venv/lib/python3.10/site-packages/prefect/agent.py", line 163, in get_and_submit_flow_runs
async for work_queue in self.get_work_queues():
File "/Users/thet/SystemInternal/information-extraction-pipeline/venv/lib/python3.10/site-packages/prefect/agent.py", line 124, in get_work_queues
work_queue = await self.client.read_work_queue_by_name(name)
File "/Users/thet/SystemInternal/information-extraction-pipeline/venv/lib/python3.10/site-packages/prefect/client/orion.py", line 720, in read_work_queue_by_name
return schemas.core.WorkQueue.parse_obj(response.json())
File "/Users/thet/SystemInternal/information-extraction-pipeline/venv/lib/python3.10/site-packages/httpx/_models.py", line 752, in json
return jsonlib.loads(self.text, **kwargs)
File "/Users/thet/.pyenv/versions/3.10.9/lib/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/Users/thet/.pyenv/versions/3.10.9/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Users/thet/.pyenv/versions/3.10.9/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
An exception occurred.
Thet Naing
12/29/2022, 5:11 PM