Skip to content

[bug]: checkLatestRelease() fails when GitHub API returns compact JSON #8775

@uncoden

Description

@uncoden

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

This is related to #6162 which addressed a similar issue in checkLatestRelease() but did not fix the root cause.

The checkLatestRelease() function in deployments/cli/community/install.sh uses grep to extract the tag_name from the GitHub API response:

grep -o '"tag_name": "[^"]*"'

This assumes a space after the colon ("tag_name": "v1.2.3"), but the GitHub API sometimes returns compact JSON without spaces ("tag_name":"v1.2.3"), causing grep to match nothing and the upgrade to fail with:

Failed to check for the latest release. Exiting...

Fix: Replace the grep | sed pipeline with python3 which is available on all supported systems:

local latest_release=$(curl -sSL https://api.github.com/repos/$GH_REPO/releases/latest | python3 -c "import sys,json; print(json.load(sys.stdin)['tag_name'])")

Affected: setup.sh Option 5 (Upgrade)

Steps to reproduce

  1. Run ./setup.sh
  2. Select Option 5 (Upgrade)
  3. Script calls checkLatestRelease() which calls the GitHub API
  4. GitHub API returns compact JSON without spaces after colons
  5. grep -o '"tag_name": "[^"]*"' matches nothing
  6. Script exits with "Failed to check for the latest release. Exiting..."

Environment

Production

Browser

None

Variant

Self-hosted

Version

v1.2.3

Metadata

Metadata

Assignees

Labels

planesync issues to Plane🐛bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions