Skip to content

setup-proxy fails when katana is run via symlink (setcap does not follow symlinks) #76

@JGillam

Description

@JGillam

Description

katana setup-proxy (or manual setcap) fails when the katana binary is invoked through a symlink.

Steps to Reproduce

  1. Provision the Vagrant VM (the provisioning script creates /usr/local/bin/katana as a symlink to ~/katana/bin/katana)
  2. Build the binary: bun run build:ui && bun run build
  3. Run sudo katana setup-proxy

Error

Invalid file '/usr/local/bin/katana' for capability operation

Root Cause

setcap does not follow symlinks — it requires the path of the actual binary, not a symlink pointing to it. The setup-proxy command resolves the binary path via something like which katana, which returns the symlink path (/usr/local/bin/katana) rather than the real path (/home/vagrant/katana/bin/katana).

Workaround

Run setcap directly on the real binary path:

sudo setcap cap_net_bind_service=+ep ~/katana/bin/katana

Fix

In the setup-proxy implementation, resolve the binary path using readlink -f (or equivalent) before passing it to setcap, so symlinks are followed correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions