Skip to content

fix(dre): parse plaintext output for blessed replica versions#227

Open
pietrodimarco-dfinity wants to merge 1 commit into
mainfrom
pmarco/fix-blessed-replica-versions-parsing
Open

fix(dre): parse plaintext output for blessed replica versions#227
pietrodimarco-dfinity wants to merge 1 commit into
mainfrom
pmarco/fix-blessed-replica-versions-parsing

Conversation

@pietrodimarco-dfinity

Copy link
Copy Markdown
Contributor

Summary

  • The wait_for_revision_to_be_elected sensor in the mainnet GuestOS rollout DAG was failing with JSONDecodeError: Extra data: line 1 column 7 (char 6).
  • Root cause: DRE.get_blessed_replica_versions() ran dre get blessed-replica-versions --json, which forwards to ic-admin get-blessed-replica-versions. That subcommand is now an alias of GetElectedGuestosVersions, whose handler ignores --json and prints one Git revision per line. json.loads then parsed the first hash's leading digits as an integer and choked on the 7th character.
  • Fix: drop --json and parse newline-separated revisions with the same hex-validation already used by get_elected_hostos_versions().

Test plan

  • Re-run the failed wait_for_revision_to_be_elected mapped task in rollout_ic_os_to_mainnet_subnets after deploy; it should read the elected versions and proceed.
  • python3 -c "import ast; ast.parse(...)" syntax check passes.

ic-admin's get-blessed-replica-versions (alias of get-elected-guestos-versions)
ignores --json and prints one Git revision per line. The previous code passed
--json and ran json.loads(...)["value"]["blessed_version_ids"], which crashed
with "JSONDecodeError: Extra data: line 1 column 7 (char 6)" because the first
hash's leading digits parsed as an integer.

Drop --json and parse newline-separated revisions, mirroring the existing
get_elected_hostos_versions. This unblocks the wait_for_revision_to_be_elected
sensor in the mainnet GuestOS rollout DAG.
@pietrodimarco-dfinity pietrodimarco-dfinity requested a review from a team as a code owner June 9, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant