Skip to content

fix: use env bash in host scripts for NixOS support - #10030

Merged
sriramveeraghanta merged 1 commit into
makeplane:previewfrom
asinglesprinkle:fix-nixos-bash-shebangs
Oct 16, 2026
Merged

sriramveeraghanta merged 1 commit into
makeplane:previewfrom
asinglesprinkle:fix-nixos-bash-shebangs

Conversation

@asinglesprinkle

@asinglesprinkle asinglesprinkle commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Description

The scripts that run on the host hardcode /bin/bash. NixOS and other non-FHS systems don't have /bin/bash, so these scripts fail with No such file or directory before they run.

This PR changes the shebang to #!/usr/bin/env bash in the following host scripts:

  • setup.sh
  • deployments/cli/community/install.sh
  • deployments/cli/community/restore.sh
  • deployments/cli/community/restore-airgapped.sh
  • deployments/cli/community/migration-0.13-0.14.sh
  • deployments/swarm/community/swarm.sh
  • deployments/aio/community/build.sh

install.sh also runs /bin/bash -c "$COMPOSE_CMD ..." for every Docker Compose call, so those become bash -c. Without that, the installer still fails at its first Compose call.

Container entrypoints (apps/api/bin/docker-entrypoint-*.sh and the AIO start.sh) keep /bin/bash, since they run inside Plane's images.

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)

N/A

Test Scenarios

I ran the scripts in a bwrap sandbox laid out like stock NixOS: only /bin/sh and /usr/bin/env, with bash on PATH and a stub docker that prints its arguments.

Version ./install.sh stop
preview bwrap: execvp ./install.sh: No such file or directory
Shebang fixed, /bin/bash -c kept ./install.sh: line 422: /bin/bash: No such file or directory
This PR [stub docker] compose -f .../plane-app/docker-compose.yaml --env-file=.../plane-app/plane.env down

./setup.sh fails the same way on preview and runs with this PR. All changed scripts pass bash -n, and ShellCheck reports no errors.

References

Closes #4597

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated deployment, setup, migration, and restore scripts to locate Bash through the system environment.
    • Docker Compose operations in the community installer now use the same Bash invocation approach. Build, migration, restore, service-management, and backup workflows remain unchanged.

The setup, install, restore, migration, swarm, and AIO build scripts
hardcode /bin/bash, which doesn't exist on NixOS and other non-FHS
systems, so they fail with "No such file or directory" before running.
Use `#!/usr/bin/env bash`, and call `bash -c` in install.sh, so bash
resolves from PATH. Container entrypoints keep /bin/bash, since they
run inside Plane's images.

Closes #4597

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@CLAassistant

CLAassistant commented Oct 15, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 95e3da50-72bc-49cc-adec-c01dc8496bfb
📥 Commits

Reviewing files that changed from the base of the PR and between 2f2b981 and a9bbba9.

📒 Files selected for processing: 7
  • deployments/aio/community/build.sh
  • deployments/cli/community/install.sh
  • deployments/cli/community/migration-0.13-0.14.sh
  • deployments/cli/community/restore-airgapped.sh
  • deployments/cli/community/restore.sh
  • deployments/swarm/community/swarm.sh
  • setup.sh

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

Deployment scripts now locate Bash through /usr/bin/env. CLI installer commands that previously invoked /bin/bash now invoke Bash resolved from PATH. The build, migration, restore, and service-management logic remains unchanged.

Changes: Bash path resolution

Layer / File(s) Summary
Script interpreter resolution
deployments/aio/community/build.sh, deployments/cli/community/install.sh, deployments/cli/community/migration-0.13-0.14.sh, deployments/cli/community/restore-airgapped.sh, deployments/cli/community/restore.sh, deployments/swarm/community/swarm.sh, setup.sh
The scripts now use #!/usr/bin/env bash to locate Bash.
CLI installer command shells
deployments/cli/community/install.sh
Build, pull, start, stop, status, log, and backup-container lookup commands now run through bash resolved from PATH.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: akshat5302

Merge Risk: ⚪ Minimal · up to a9bbb

The scripts now locate Bash through PATH instead of requiring /bin/bash, improving compatibility on non-FHS hosts. No concrete merge-blocking risk remains.

Pre-merge checks: Passed 4 · Failed 1

Failed 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the main change: using environment-resolved Bash in host scripts to support NixOS.
Description check Passed The description is complete and follows the repository template. It explains the problem, lists the affected scripts, identifies the bug fix, documents test scenarios and results, and references issue…
Linked Issues check Passed Issue #4597 requires the self-hosting install script to run when Bash is not available at /bin/bash. The PR changes install.sh to #!/usr/bin/env bash and changes all seven Docker Compose invocat…
Out of Scope Changes check Passed The changes stay within issue #4597. They update Bash resolution in host scripts and in the install script's Compose calls. The PR does not change container entrypoints or unrelated script logic. The …
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@sriramveeraghanta
sriramveeraghanta merged commit 4e0e403 into makeplane:preview Oct 16, 2026
13 checks passed
dheeru0198 added a commit that referenced this pull request Oct 21, 2026
- getEnvValue reads everything after the first "=", and updateEnvFile writes
  values literally (awk from the environment instead of sed), so syncEnvFile
  keeps existing values containing "=", "&", "|", "/" or "\" on upgrade.
  generateInstallSecrets uses updateEnvFile, and setEnvValueLiteral is removed.
- The merge with preview keeps the "#!/usr/bin/env bash" shebangs and
  "bash -c" from #10030, generateStorageCredentials from #10074, and
  preview's AIO README text (AIO requires both keys and exits when missing).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
dheeru0198 added a commit that referenced this pull request Oct 22, 2026
- getEnvValue reads everything after the first "=", and updateEnvFile writes
  values literally (awk from the environment instead of sed), so syncEnvFile
  keeps existing values containing "=", "&", "|", "/" or "\" on upgrade.
  generateInstallSecrets uses updateEnvFile, and setEnvValueLiteral is removed.
- The merge with preview keeps the "#!/usr/bin/env bash" shebangs and
  "bash -c" from #10030, generateStorageCredentials from #10074, and
  preview's AIO README text (AIO requires both keys and exits when missing).
szymczag added a commit to szymczag/hangar that referenced this pull request Nov 17, 2026
Backport of upstream makeplane/plane 4e0e403 (makeplane#10030).

setup.sh, the Compose and Swarm installers, restore, the 0.13-0.14
migration and the all-in-one build script hard-coded /bin/bash, which
does not exist on NixOS and other non-FHS systems. They now use
`#!/usr/bin/env bash`, and install.sh runs `bash -c`. Applied with sed
over the fork's scripts rather than cherry-picked, since install.sh has
diverged; the fork-only migrate-object-storage.sh already used env.
Container entrypoints keep /bin/bash.
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.

[bug]: Install script won't work on NixOS because of absolute path /bin/bash

4 participants