mirror of
https://github.com/juanfont/headscale.git
synced 2026-01-13 12:50:32 +01:00
failed to set up a HTTP server error="listen tcp :80: bind: permission denied" #473
Closed
opened 2025-12-29 01:30:00 +01:00 by adam
·
16 comments
No Branch/Tag Specified
main
update_flake_lock_action
gh-pages
kradalby/release-v0.27.2
dependabot/go_modules/golang.org/x/crypto-0.45.0
dependabot/go_modules/github.com/opencontainers/runc-1.3.3
copilot/investigate-headscale-issue-2788
copilot/investigate-visibility-issue-2788
copilot/investigate-issue-2833
copilot/debug-issue-2846
copilot/fix-issue-2847
dependabot/go_modules/github.com/go-viper/mapstructure/v2-2.4.0
dependabot/go_modules/github.com/docker/docker-28.3.3incompatible
kradalby/cli-experiement3
doc/0.26.1
doc/0.25.1
doc/0.25.0
doc/0.24.3
doc/0.24.2
doc/0.24.1
doc/0.24.0
kradalby/build-docker-on-pr
topic/docu-versioning
topic/docker-kos
juanfont/fix-crash-node-id
juanfont/better-disclaimer
update-contributors
topic/prettier
revert-1893-add-test-stage-to-docs
add-test-stage-to-docs
remove-node-check-interval
fix-empty-prefix
fix-ephemeral-reusable
bug_report-debuginfo
autogroups
logs-to-stderr
revert-1414-topic/fix_unix_socket
rename-machine-node
port-embedded-derp-tests-v2
port-derp-tests
duplicate-word-linter
update-tailscale-1.36
warn-against-apache
ko-fi-link
more-acl-tests
fix-typo-standalone
parallel-nolint
tparallel-fix
rerouting
ssh-changelog-docs
oidc-cleanup
web-auth-flow-tests
kradalby-gh-runner
fix-proto-lint
remove-funding-links
go-1.19
enable-1.30-in-tests
0.16.x
cosmetic-changes-integration
tmp-fix-integration-docker
fix-integration-docker
configurable-update-interval
show-nodes-online
hs2021
acl-syntax-fixes
ts2021-implementation
fix-spurious-updates
unstable-integration-tests
mandatory-stun
embedded-derp
prtemplate-fix
v0.28.0-beta.1
v0.27.2-rc.1
v0.27.1
v0.27.0
v0.27.0-beta.2
v0.27.0-beta.1
v0.26.1
v0.26.0
v0.26.0-beta.2
v0.26.0-beta.1
v0.25.1
v0.25.0
v0.25.0-beta.2
v0.24.3
v0.25.0-beta.1
v0.24.2
v0.24.1
v0.24.0
v0.24.0-beta.2
v0.24.0-beta.1
v0.23.0
v0.23.0-rc.1
v0.23.0-beta.5
v0.23.0-beta.4
v0.23.0-beta3
v0.23.0-beta2
v0.23.0-beta1
v0.23.0-alpha12
v0.23.0-alpha11
v0.23.0-alpha10
v0.23.0-alpha9
v0.23.0-alpha8
v0.23.0-alpha7
v0.23.0-alpha6
v0.23.0-alpha5
v0.23.0-alpha4
v0.23.0-alpha4-docker-ko-test9
v0.23.0-alpha4-docker-ko-test8
v0.23.0-alpha4-docker-ko-test7
v0.23.0-alpha4-docker-ko-test6
v0.23.0-alpha4-docker-ko-test5
v0.23.0-alpha-docker-release-test-debug2
v0.23.0-alpha-docker-release-test-debug
v0.23.0-alpha4-docker-ko-test4
v0.23.0-alpha4-docker-ko-test3
v0.23.0-alpha4-docker-ko-test2
v0.23.0-alpha4-docker-ko-test
v0.23.0-alpha3
v0.23.0-alpha2
v0.23.0-alpha1
v0.22.3
v0.22.2
v0.23.0-alpha-docker-release-test
v0.22.1
v0.22.0
v0.22.0-alpha3
v0.22.0-alpha2
v0.22.0-alpha1
v0.22.0-nfpmtest
v0.21.0
v0.20.0
v0.19.0
v0.19.0-beta2
v0.19.0-beta1
v0.18.0
v0.18.0-beta4
v0.18.0-beta3
v0.18.0-beta2
v0.18.0-beta1
v0.17.1
v0.17.0
v0.17.0-beta5
v0.17.0-beta4
v0.17.0-beta3
v0.17.0-beta2
v0.17.0-beta1
v0.17.0-alpha4
v0.17.0-alpha3
v0.17.0-alpha2
v0.17.0-alpha1
v0.16.4
v0.16.3
v0.16.2
v0.16.1
v0.16.0
v0.16.0-beta7
v0.16.0-beta6
v0.16.0-beta5
v0.16.0-beta4
v0.16.0-beta3
v0.16.0-beta2
v0.16.0-beta1
v0.15.0
v0.15.0-beta6
v0.15.0-beta5
v0.15.0-beta4
v0.15.0-beta3
v0.15.0-beta2
v0.15.0-beta1
v0.14.0
v0.14.0-beta2
v0.14.0-beta1
v0.13.0
v0.13.0-beta3
v0.13.0-beta2
v0.13.0-beta1
upstream/v0.12.4
v0.12.4
v0.12.3
v0.12.2
v0.12.2-beta1
v0.12.1
v0.12.0-beta2
v0.12.0-beta1
v0.11.0
v0.10.8
v0.10.7
v0.10.6
v0.10.5
v0.10.4
v0.10.3
v0.10.2
v0.10.1
v0.10.0
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.1
v0.8.0
v0.7.1
v0.7.0
v0.6.1
v0.6.0
v0.5.2
v0.5.1
v0.5.0
v0.4.0
v0.3.6
v0.3.5
v0.3.4
v0.3.3
v0.3.2
v0.3.1
v0.3.0
v0.2.2
v0.2.1
v0.2.0
v0.1.1
v0.1.0
Labels
Clear labels
CLI
DERP
DNS
Nix
OIDC
SSH
bug
database
documentation
duplicate
enhancement
faq
good first issue
grants
help wanted
might-come
needs design doc
needs investigation
no-stale-bot
out of scope
performance
policy 📝
pull-request
question
regression
routes
stale
tags
tailscale-feature-gap
well described ❤️
wontfix
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/headscale#473
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @TimDowker on GitHub (Apr 14, 2023).
Bug description
Fresh Ubuntu 22.04 container running on Proxmox 7.4 - all updates applied for both host and container. Download and installed latest v0.22.0-alpha2 deb package using command "dpkg -i headscale_0.22.0-alpha2_linux_amd64.deb".
Tried to start it up after modifying the config.yaml (posted below).
Get the following error
Apr 14 12:25:36 hs headscale[366]: 2023-04-14T12:25:36-04:00 FTL ../../../home/runner/work/headscale/headscale/app.go:875 > failed to set up a HTTP server error="listen tcp :80: bind: permission denied"
@kradalby commented on GitHub (Apr 19, 2023):
Hi @TimDowker , I am unable to reproduce this in a fresh VM (both 22.04 and 22.10), is headscale able to bind to
:443and other privileged ports? Have you ran some extra hardening on your system to prevent these ports to be bound?Do you have anything else bound on port
:80?@TimDowker commented on GitHub (Apr 20, 2023):
Testing deb package on a fresh Ubuntu 22.04 Proxmox container. Will report back if this is still an issue.
@TimDowker commented on GitHub (Apr 20, 2023):
Same error on a fresh proxmox container running ubuntu template 22.04 with all updates.
Apr 20 13:10:57 hs headscale[10261]: 2023-04-20T13:10:57Z FTL ../../../home/runner/work/headscale/headscale/app.go:875 > failed to set up a HTTP server error="listen tcp :80: bind: permission denied"@TimDowker commented on GitHub (Apr 20, 2023):
Looks like whatever user Go is running as doesn't have the appropriate permissions to bind to port 80 (priviledged port) even though the systemd service file contains "AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_CHOWN"
@Porco-Rosso commented on GitHub (Apr 20, 2023):
For anyone also having the same issue, the headscale.sock file location was moved, hence the errors, if you don't edit your config.yaml, when transitioning to the .deb releases.
a5afe4bd06/config-example.yaml (L259)@Porco-Rosso commented on GitHub (Apr 20, 2023):
/var/run/headscale/keeps getting deleted, and installing the .deb doesn't fix it:/
@px4860 commented on GitHub (Apr 25, 2023):
so,is there any solution now?
@px4860 commented on GitHub (May 5, 2023):
i found the requirements of headscale needs Ubuntu 20.04 or newer, Debian 11 or newer.i use centos7 and get same issue.
@luizvaz commented on GitHub (May 17, 2023):
I had the same problem.
And the cause was letsencrypt setting
I am using
acme.shto deal with certificates.After clearing the hostname the error stopped.
Probably do you have anything already bonded to the port :80
@Porco-Rosso commented on GitHub (Jun 30, 2023):
I was running headscale in a debian 11 LXC container under proxmox. Enabling Nesting seems to have made it work.
Will report back if that wasn't the case.
@gbraad commented on GitHub (Jul 3, 2023):
It is caused by the following lines:
This indicates to listen on port :80 for the challenge to assign a certificate. The description says the following:
Which states that with
HTTP-01it will listen on":80"Binding to a port <1024 needs root privileges or otherwise granted. If you can set up a proxy for this, you might have listen happen on
:8081and have a forward from an external:80to this. But that is beyond the scope here. The Permission denied happened because of not having the permissions, which are needed by the Let's Encrypt challenge/response process.@Porco-Rosso commented on GitHub (Jul 3, 2023):
That makes sense to me, however I tried disabling nesting, and changing the port listen to both: :8081 and 0.0.0.0:8081, and neither let me start headscale properly.
I'm running a reverse proxy with it's own https certificate, so its strange to not be able to disable the feature on its own.
I imagine others will be running headscale in docker or LXC, so not sure if this falls out of the scope of the project or not.
@Porco-Rosso commented on GitHub (Jul 3, 2023):
For reference I've never had any issues binding to port 80 in any other containers. Is it the headscale user itself in the container that doesn't have the permissions? That wouldn't explain why port 8081 didn't work.
@gbraad commented on GitHub (Jul 4, 2023):
I run rootless, for example with podman. In that case, you aren't able to bind <1024.
@github-actions[bot] commented on GitHub (Dec 20, 2023):
This issue is stale because it has been open for 90 days with no activity.
@github-actions[bot] commented on GitHub (Dec 27, 2023):
This issue was closed because it has been inactive for 14 days since being marked as stale.