Liliya Angelova
10/16/2025, 11:59 AMprefect work-pool get-default-base-job-template --type kubernetes > base-job-template.json. However the update (prefect work-pool update k8s-pool --base-job-template .\base-job-template.json) fails with the following error although the file is a valid json:
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
An exception occurred.Marvin
10/16/2025, 11:59 AMMarvin
10/16/2025, 12:00 PM> redirection, it can write the file with an encoding (often UTF-16) that doesn’t parse cleanly when Prefect reads it as JSON, leading to json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0).
- It can also silently produce an empty file if something went wrong upstream, which triggers the same error.
Two easy fixes
1) Generate the file using the built-in --file flag (recommended)
This avoids shell redirection and writes the correct encoding.
prefect work-pool get-default-base-job-template --type kubernetes --file base-job-template.json
prefect work-pool update k8s-pool --base-job-template .\base-job-template.json
2) If you already have a file, re-save it as UTF-8
In PowerShell:
Get-Content .\base-job-template.json | Set-Content -Encoding utf8 .\base-job-template-utf8.json
prefect work-pool update k8s-pool --base-job-template .\base-job-template-utf8.json
Quick checks
- Ensure the file isn’t empty:
Get-Content -Head 1 .\base-job-template.json
- You can validate it parses as JSON:
python -c "import json,sys; json.load(open('base-job-template.json', encoding='utf-8')); print('OK')"
If that still errors, please let me know:
- Which shell/OS you’re using (PowerShell, CMD, Bash, etc.)
- Whether prefect work-pool get-default-base-job-template --type kubernetes prints JSON directly in your terminal
- The first few non-sensitive characters of the file (e.g., does it start with {)
For reference, the CLI has a --file option specifically for this use case:
prefect work-pool get-default-base-job-template --help
Shows:
- --file -f TEXT If set, write the output to a file.
Once the file is UTF-8 JSON, prefect work-pool update should accept it without issue.Liliya Angelova
10/16/2025, 12:04 PMMarvin
10/16/2025, 12:04 PMMarvin
10/16/2025, 12:05 PMprefect deployment run <FLOW_NAME>/<DEPLOYMENT_NAME> --watch
Then inspect the created Kubernetes Job to confirm it reflects your changes (image, env, resources, etc.).
Background on the workers model in Prefect 3.x: Prefect 3 GA