Skip to content

Comments

fix ARCH detection and normalization#8658

Open
mubix wants to merge 1 commit intomakeplane:previewfrom
mubix:preview
Open

fix ARCH detection and normalization#8658
mubix wants to merge 1 commit intomakeplane:previewfrom
mubix:preview

Conversation

@mubix
Copy link

@mubix mubix commented Feb 24, 2026

Description

Fixes two bugs in the community self-hosted install script (deployments/cli/community/install.sh) that cause installation to fail on x86_64 systems:

Bug 1: checkLatestRelease failure not caught by parent script

When checkLatestRelease() fails (e.g., due to GitHub API rate limiting or no network access), it calls exit 1 — but because it runs inside a $(...) command substitution, that exit only terminates the subshell, not the parent script. The result is APP_RELEASE gets set to an empty string, which cascades into a broken docker manifest inspect call (invalid reference format) and eventually an offer to build images locally against a blank release tag.

Fix: Added a guard after the command substitution to check for an empty APP_RELEASE and exit cleanly with a clear error message.

Bug 2: UPPER_CPU_ARCH set before CPU architecture normalization

UPPER_CPU_ARCH is derived from CPU_ARCH at the top of the script, where uname -m returns the raw value (e.g., x86_64). The normalization block that maps x86_64amd64 and aarch64arm64 runs later near the bottom of the script, but UPPER_CPU_ARCH is never recalculated. This causes:

  • The docker manifest inspect grep to search for x86_64 instead of amd64, which never matches since Docker manifests use amd64
  • User-facing messages to display X86_64 instead of the correct AMD64

Fix: Moved the UPPER_CPU_ARCH assignment to after the normalization block so it reflects the corrected architecture name.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Before (x86_64 system):

--------------------------------------------
 ____  _                          /////////
|  _ \| | __ _ _ __   ___         /////////
| |_) | |/ _` | '_ \ / _ \   /////    /////
|  __/| | (_| | | | |  __/   /////    /////
|_|   |_|\__,_|_| |_|\___|        ////
                                  ////
--------------------------------------------
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 ().

Do you want to continue with building the Docker images locally?
Continue? [y/N]:

Summary by CodeRabbit

  • Bug Fixes
    • Added error handling when determining the latest stable release to prevent installation failures.
    • Improved CPU architecture detection to ensure proper compatibility across different systems and Docker configurations.

@CLAassistant
Copy link

CLAassistant commented Feb 24, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 24, 2026

📝 Walkthrough

Walkthrough

The installation script now includes a defensive check for failed release lookups and normalizes CPU architecture values (x86_64/aarch64 variants) to Docker manifest standards (amd64/arm64), with UPPER_CPU_ARCH computation repositioned for consistency.

Changes

Cohort / File(s) Summary
Release & Architecture Handling
deployments/cli/community/install.sh
Added error handling when APP_RELEASE lookup yields empty value; normalized CPU architecture naming (x86_64/amd64 → amd64, aarch64/arm64 → arm64) and moved UPPER_CPU_ARCH computation to ensure consistency with Docker manifest expectations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A rabbit's whisper to the architects so keen,
"Now we normalize the paths that haven't been seen!
Docker's blessed names, x86 to amd64,
Error checks stand guard—no crashes anymore!"
With 9 lines of care and 2 lines retired,
The install script's stability is surely inspired! 🏗️

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix ARCH detection and normalization' directly addresses the main purpose of the PR and accurately summarizes both bugs fixed in the install script.
Description check ✅ Passed The description is comprehensive and well-structured, covering all required sections including detailed explanation of both bugs, fixes, type of change checkbox, and before/after screenshots demonstrating the issue.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@deployments/cli/community/install.sh`:
- Around line 218-223: The upgrade() flow still assigns APP_RELEASE via command
substitution without checking for empty results, so a failed checkLatestRelease
can propagate an empty tag; update upgrade() to call checkLatestRelease into
APP_RELEASE (or a temp var) and validate it's non-empty before proceeding,
logging an error and exiting (similar to the install path) if the release lookup
failed; reference the upgrade() function and the checkLatestRelease/APP_RELEASE
symbols when making the change.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9425c66 and 89e19f3.

📒 Files selected for processing (1)
  • deployments/cli/community/install.sh

Comment on lines 218 to +223
if [ "$APP_RELEASE" == "stable" ]; then
export APP_RELEASE=$(checkLatestRelease)
if [ -z "$APP_RELEASE" ]; then
echo "Failed to determine the latest release. Exiting..."
exit 1
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Also guard upgrade() against empty release tags.

The new check prevents the install path from continuing with an empty tag, but upgrade() (Line 430) still uses a command substitution without this guard, so a failed lookup can still propagate an empty tag and trigger the same downstream errors. Consider reusing the guard there too.

🔧 Suggested fix for upgrade()
 function upgrade() {
-    local latest_release=$(checkLatestRelease)
+    local latest_release
+    latest_release=$(checkLatestRelease)
+    if [ -z "$latest_release" ]; then
+        echo "Failed to determine the latest release. Exiting..."
+        exit 1
+    fi
🧰 Tools
🪛 Shellcheck (0.11.0)

[warning] 219-219: Declare and assign separately to avoid masking return values.

(SC2155)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@deployments/cli/community/install.sh` around lines 218 - 223, The upgrade()
flow still assigns APP_RELEASE via command substitution without checking for
empty results, so a failed checkLatestRelease can propagate an empty tag; update
upgrade() to call checkLatestRelease into APP_RELEASE (or a temp var) and
validate it's non-empty before proceeding, logging an error and exiting (similar
to the install path) if the release lookup failed; reference the upgrade()
function and the checkLatestRelease/APP_RELEASE symbols when making the change.

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.

2 participants