Skip to content

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

Open
SumzCol/orbit
#6

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

Activity

  1. added
    🐛bug
    plane
    on Mar 19, 2026
  2. makeplane commented on Mar 19, 2026

    @makeplane
  3. dynnian commented on Mar 24, 2026

    @dynnian

    The install script for the community edition is broken because of this bug. The solution proposed by @uncoden works flawlessly. By default the setup.sh script always fails like this:

     --------------------------------------------
     ____  _                          ///////// 
    |  _ \| | __ _ _ __   ___         ///////// 
    | |_) | |/ _` | '_ \ / _ \   /////    ///// 
    |  __/| | (_| | | | |  __/   /////    ///// 
    |_|   |_|\__,_|_| |_|\___|        ////      
                                      ////      
    --------------------------------------------
    Project management tool from the future
    --------------------------------------------
    
    Select a Action you want to perform:
       1) Install
       2) Start
       3) Stop
       4) Restart
       5) Upgrade
       6) View Logs
       7) Backup Data
       8) Exit
    
    Action [2]: 1
    
    Begin Installing Plane
    
    Checking for the latest release...
    
    Failed to check for the latest release. Exiting...
    
    Please wait while we check the availability of Docker images for the selected release () with X86_64 support.invalid reference format
    
    X86_64 images are not available for selected release ().
    
    Syncing environment variables...
    
    Updating custom variables...
    
    Invalid arguments supplied 
    
  4. added 2 commits that reference this issue on Mar 27, 2026
    8be000c
    107d840
  5. GrandNewbien commented on Apr 9, 2026

    @GrandNewbien

    I can also confirm that the fix by @uncoden is working

    It's a bit of a dark pattern to make the community edition harder to install when an install script could easily do all the same steps. Even putting the whole thing under a drop down menu is a dark pattern.

  6. sjsadowski commented on Aug 4, 2026

    @sjsadowski

    #8911 isn't merged, but also would break under some circumstances. I ran into this today and the problem here is that GitHub does not consistently return the json formatted in such a way that this regex: grep -o '"tag_name": "[^"]*"' would catch it, as sometimes it returns: '"tag_name":"[^"]*"' - which is the fix supplied. I suggest instead grep -o '"tag_name":\s*"[^"]*"' which would catch both.

    This is a problem and I had time to spin my wheels on this one a bit, so I'll supply the fix as well.

  7. daib-elbuzarov commented on Aug 8, 2026

    @daib-elbuzarov

    Confirming this on a fresh v1.4.1 self-host install (macOS, Apple Silicon, Docker 29.2.1). setup.sh install aborts right away with Failed to check for the latest release. Exiting....

    Since there are now three open PRs fixing the same line, here is a comparison of what each one actually produces, plus the reason the bug is repo dependent.

    Why it reproduces on Plane and not everywhere

    The REST API returns minified JSON for this repo's releases/latest payload, so there is no space after the colon and '"tag_name": "' never matches:

    $ curl -sSL https://api.github.com/repos/makeplane/plane/releases/latest | head -c 60
    {"url":"https://api.github.com/repos/makeplane/plane/releases/366666730"
    
    $ curl -sSL https://api.github.com/repos/facebook/react/releases/latest | head -c 60
    {
      "url": "https://api.github.com/repos/react/react/releases/356654919"

    The Plane payload is ~15 KB (long changelog plus 6 assets), the React one is ~2.3 KB. Adding -H "Accept: application/vnd.github+json" returns pretty printed JSON for the very same Plane URL. So the response shape is not stable, and a fix should handle both rather than swap one hardcoded shape for the other.

    Affected lines on preview:

    • deployments/cli/community/install.sh:60
    • deployments/swarm/community/swarm.sh:41

    Worth noting that checkLatestRelease is called from two places, so this blocks both a fresh install and upgrade on an existing instance.

    Comparison of the three open PRs

    Run on macOS with the system BSD grep 2.6.0-FreeBSD and BSD sed, against a compact and a pretty fixture:

    variant compact input pretty input
    current preview no match, script exits v1.4.1
    #9548 install.sh tag_name:v1.4.1 tag_name: v1.4.1
    #9548 swarm.sh v1.4.1 tag_name: v1.4.1
    #9555 v1.4.1 v1.4.1
    #8911 v1.4.1 v1.4.1

    Two problems in #9548:

    1. install.sh has a typo in the sed expression. s/"tag_name":\*"// is a literal \* rather than \s*, so the prefix is never stripped and APP_RELEASE ends up as tag_name:v1.4.1 on both input shapes.
    2. swarm.sh uses \s inside sed. That is a GNU extension, and BSD sed on macOS does not honor it, so the pretty case regresses from currently working to tag_name: v1.4.1.

    #9555 and #8911 both use POSIX safe patterns (: * and :[ ]*) and return the correct value on both shapes. #9555 only patches install.sh, which leaves swarm.sh broken. #8911 is the only one that is both correct and complete, so that looks like the one to merge.

    Reproducing the table

    printf '%s' '{"tag_name":"v1.4.1"}' > compact.json
    printf '%s\n' '{' '  "tag_name": "v1.4.1"' '}' > pretty.json

    then run each grep and sed pair against both files.

    Workaround until a fix lands

    Patch the downloaded script before running it, which fixes the grep pattern and the sed expression in one pass:

    curl -fsSL -o setup.sh https://github.com/makeplane/plane/releases/latest/download/setup.sh
    sed -i '' 's/"tag_name": "/"tag_name": *"/g' setup.sh   # drop the '' on GNU sed
    chmod +x setup.sh && ./setup.sh install

    Verified: checkLatestRelease returns v1.4.1 after the patch, and the install then completes normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

plane🐛bug

Type

Fields

Edition

None yet

Version

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions