Skip to content

[BUG]: make pre-commit fails on check-shebang-scripts-are-executable for multiple files #2732

@brian-hussey

Description

@brian-hussey

🐞 Bug Summary

The make pre-commit task fails with the check-shebang-scripts-are-executable hook, reporting that multiple files have shebangs but are not marked as executable. This occurs on both Mac and Linux platforms.


🧩 Affected Component

Select the area of the project impacted:

  • mcpgateway - API
  • mcpgateway - UI (admin panel)
  • mcpgateway.wrapper - stdio wrapper
  • Federation or Transports
  • CLI, Makefiles, or shell scripts
  • Container setup (Docker/Podman/Compose)
  • Other (explain below)

🔁 Steps to Reproduce

  1. Run make pre-commit on Mac or Linux
  2. Observe the failure in the check-shebang-scripts-are-executable hook

🤔 Expected Behavior

Files with shebangs that are intended to be executable should have the executable bit set. The pre-commit hook should pass without errors.


📓 Logs / Error Output

✅ Check Shebang Scripts Are Executable..................................Failed
- hook id: check-shebang-scripts-are-executable
- exit code: 1

infra/nginx/docker-entrypoint.sh: has a shebang but is not marked executable!
  If it is supposed to be executable, try: `chmod +x infra/nginx/docker-entrypoint.sh`
  If on Windows, you may also need to: `git add --chmod=+x infra/nginx/docker-entrypoint.sh`
  If it not supposed to be executable, double-check its shebang is wanted.

mcpgateway/plugins/framework/external/mcp/server/runtime.py: has a shebang but is not marked executable!
  If it is supposed to be executable, try: `chmod +x mcpgateway/plugins/framework/external/mcp/server/runtime.py`
  If on Windows, you may also need to: `git add --chmod=+x mcpgateway/plugins/framework/external/mcp/server/runtime.py`
  If it not supposed to be executable, double-check its shebang is wanted.

scripts/set-backup-completed.sh: has a shebang but is not marked executable!
  If it is supposed to be executable, try: `chmod +x scripts/set-backup-completed.sh`
  If on Windows, you may also need to: `git add --chmod=+x scripts/set-backup-completed.sh`
  If it not supposed to be executable, double-check its shebang is wanted.

tests/performance/test_parallel_cleanup.py: has a shebang but is not marked executable!
  If it is supposed to be executable, try: `chmod +x tests/performance/test_parallel_cleanup.py`
  If on Windows, you may also need to: `git add --chmod=+x tests/performance/test_parallel_cleanup.py`
  If it not supposed to be executable, double-check its shebang is wanted.

plugins/examples/simple_token_auth/token_cli.py: has a shebang but is not marked executable!
  If it is supposed to be executable, try: `chmod +x plugins/examples/simple_token_auth/token_cli.py`
  If on Windows, you may also need to: `git add --chmod=+x plugins/examples/simple_token_auth/token_cli.py`
  If it not supposed to be executable, double-check its shebang is wanted.

scripts/benchmark_middleware.py: has a shebang but is not marked executable!
  If it is supposed to be executable, try: `chmod +x scripts/benchmark_middleware.py`
  If on Windows, you may also need to: `git add --chmod=+x scripts/benchmark_middleware.py`
  If it not supposed to be executable, double-check its shebang is wanted.

scripts/cleanup_orphaned_resources.py: has a shebang but is not marked executable!
  If it is supposed to be executable, try: `chmod +x scripts/cleanup_orphaned_resources.py`
  If on Windows, you may also need to: `git add --chmod=+x scripts/cleanup_orphaned_resources.py`
  If it not supposed to be executable, double-check its shebang is wanted.

tests/jmeter/render_fragments.py: has a shebang but is not marked executable!
  If it is supposed to be executable, try: `chmod +x tests/jmeter/render_fragments.py`
  If on Windows, you may also need to: `git add --chmod=+x tests/jmeter/render_fragments.py`
  If it not supposed to be executable, double-check its shebang is wanted.

tests/integration/test_a2a_sdk_integration.py: has a shebang but is not marked executable!
  If it is supposed to be executable, try: `chmod +x tests/integration/test_a2a_sdk_integration.py`
  If on Windows, you may also need to: `git add --chmod=+x tests/integration/test_a2a_sdk_integration.py`
  If it not supposed to be executable, double-check its shebang is wanted.

Command executed:

uv run --active pre-commit run --config .pre-commit-lite.yaml check-shebang-scripts-are-executable --all-files

🧠 Environment Info

Key Value
Version or commit main
Runtime Python 3.11+
Platform / OS macOS, Linux
Container none

🧩 Additional Context (optional)

The following files have shebangs but are missing executable permissions:

Shell scripts:

  • infra/nginx/docker-entrypoint.sh
  • scripts/set-backup-completed.sh

Python scripts:

  • mcpgateway/plugins/framework/external/mcp/server/runtime.py
  • tests/performance/test_parallel_cleanup.py
  • plugins/examples/simple_token_auth/token_cli.py
  • scripts/benchmark_middleware.py
  • scripts/cleanup_orphaned_resources.py
  • tests/jmeter/render_fragments.py
  • tests/integration/test_a2a_sdk_integration.py

Recommended fix:

chmod +x infra/nginx/docker-entrypoint.sh
chmod +x mcpgateway/plugins/framework/external/mcp/server/runtime.py
chmod +x scripts/set-backup-completed.sh
chmod +x tests/performance/test_parallel_cleanup.py
chmod +x plugins/examples/simple_token_auth/token_cli.py
chmod +x scripts/benchmark_middleware.py
chmod +x scripts/cleanup_orphaned_resources.py
chmod +x tests/jmeter/render_fragments.py
chmod +x tests/integration/test_a2a_sdk_integration.py

git add --chmod=+x infra/nginx/docker-entrypoint.sh
git add --chmod=+x mcpgateway/plugins/framework/external/mcp/server/runtime.py
git add --chmod=+x scripts/set-backup-completed.sh
git add --chmod=+x tests/performance/test_parallel_cleanup.py
git add --chmod=+x plugins/examples/simple_token_auth/token_cli.py
git add --chmod=+x scripts/benchmark_middleware.py
git add --chmod=+x scripts/cleanup_orphaned_resources.py
git add --chmod=+x tests/jmeter/render_fragments.py
git add --chmod=+x tests/integration/test_a2a_sdk_integration.py

Alternatively, if any of these files are not intended to be executable scripts, their shebangs should be removed.

Metadata

Metadata

Assignees

Labels

SHOULDP2: Important but not vital; high-value items that are not crucial for the immediate releasebugSomething isn't working

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions