Error during flow deployment

Hello Everyone, Recently I’m facing the JSONDecodeError error when I deploy the flow. It starts happening when we change our plan from Personal to Organization and start using a service account for flow deployment. Just wondering if anyone come across this issue before.

Deployment Command: prefect deployment build -n DEV -sb azure/edw-flow-storage --path DEV -ib docker-container/prefect-edw-flows-dev flows/powerbi_flow.py:powerbi_flow -q DEV -a --pool Development

Found flow ‘PowerBI Dataset Refresh’
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 230, 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 181, 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/deployment.py”, line 898, in build
infrastructure = await Block.load(infra_block)
File “/usr/local/lib/python3.8/dist-packages/prefect/client/utilities.py”, line 47, in with_injected_client
return await fn(*args, **kwargs)
File “/usr/local/lib/python3.8/dist-packages/prefect/blocks/core.py”, line 714, in load
block_document = await client.read_block_document_by_name(
File “/usr/local/lib/python3.8/dist-packages/prefect/client/orchestration.py”, line 1293, in read_block_document_by_name
return BlockDocument.parse_obj(response.json())
File “/usr/local/lib/python3.8/dist-packages/httpx/_models.py”, line 756, in json
return jsonlib.loads(self.text, **kwargs)
File “/usr/lib/python3.8/json/init.py”, line 357, in loads
return _default_decoder.decode(s)
File “/usr/lib/python3.8/json/decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/lib/python3.8/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.

1 Like

Hi @Sohail.Ali, does that service account have collaborator access on the workspace you are deploying the flow to?

edit: I think it’s called developer role now and should be granted on a workspace by workspace basis