Description
katana setup-proxy (or manual setcap) fails when the katana binary is invoked through a symlink.
Steps to Reproduce
- Provision the Vagrant VM (the provisioning script creates
/usr/local/bin/katana as a symlink to ~/katana/bin/katana)
- Build the binary:
bun run build:ui && bun run build
- 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.
Description
katana setup-proxy(or manualsetcap) fails when thekatanabinary is invoked through a symlink.Steps to Reproduce
/usr/local/bin/katanaas a symlink to~/katana/bin/katana)bun run build:ui && bun run buildsudo katana setup-proxyError
Root Cause
setcapdoes not follow symlinks — it requires the path of the actual binary, not a symlink pointing to it. Thesetup-proxycommand resolves the binary path via something likewhich katana, which returns the symlink path (/usr/local/bin/katana) rather than the real path (/home/vagrant/katana/bin/katana).Workaround
Run
setcapdirectly on the real binary path:sudo setcap cap_net_bind_service=+ep ~/katana/bin/katanaFix
In the
setup-proxyimplementation, resolve the binary path usingreadlink -f(or equivalent) before passing it tosetcap, so symlinks are followed correctly.