mirror of
https://github.com/juanfont/headscale.git
synced 2026-01-11 20:00:28 +01:00
[Bug] v0.23.0-beta1 breaks built-in DERP #746
Closed
opened 2025-12-29 02:23:10 +01:00 by adam
·
17 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#746
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 @christian-heusel on GitHub (Jul 23, 2024).
Is this a support request?
Is there an existing issue for this?
Current Behavior
Expected Behavior
The builtin DERP keeps on working with the update, I have also configured and used this setup for a long time now.
Steps To Reproduce
headscaleto version v0.23.0-beta1I hope that I did not miss anything in the changelogs, but to me it looks like there was no config changes etc. required to keep this working between the two relevant versions.
Environment
Runtime environment
Although both of the above are the case the DERP server is just publicly accesible:
Anything else?
The startup log claims that I do not have any DERP's configured:
and yet this is my derp config (snippet), which used to work with the previous versions:
@JohanVlugt commented on GitHub (Jul 24, 2024):
I think you forgot to add
/udpin the docker compose.This new beta update works for me without changing the setup.
@christian-heusel commented on GitHub (Jul 25, 2024):
Adding in the
/udpdid indeed solve the issue, but why did this work with the pre-beta versions? 🤔Also should this maybe be in the upgrade documentation for the final release?
@christian-heusel commented on GitHub (Jul 25, 2024):
Ah nevermind it just took
tailscale statusa moment to realize that the DERP is gone, changing the network config does not help for me 😅@kradalby commented on GitHub (Jul 25, 2024):
I'm having trouble reproducing this and all of the tests keep passing, it has me quite puzzled.
The error about empty DERP is only covering the DERP loaded via URL/file, so in this case it is displayed before the DERPs from the embedded server, and if there are no DERPs at all, the whole server will halt https://github.com/juanfont/headscale/blob/main/hscontrol/app.go#L516-L518.
Does this mean it was there initially, but then disappeared after?
@kradalby commented on GitHub (Jul 25, 2024):
I've expanded the DERP tests a bit to ensure that the embedded server isnt removed by the updater in #2030.
So this makes me think that this is a networking issue, because headscale sends the DERP server as part of the map update.
I cant really think of anything that would have changed this in the commits between the last alpha and the beta.
Could there be an external event/change to your docker setup 🤔 (odd since reverting works).
I did notice this tho:
This could indicate that it only listens to IPv6? however my test logs shows the same, so I would find it odd to be the cause, and I do not think anything related to that has changed.
@christian-heusel commented on GitHub (Jul 25, 2024):
No the way I'm testing this is that I'm redeploying the other version on my VPS and then run tailscale status on my client to see if it's still working / printing out the error.
This was my first thought aswell, but the issue now reproduces over multirple docker versions and really consistently with every switch of images that I do.
After I have switched to the
-debugversion of the image I was able to check this inside of the container, and the outputs were the same for both versions:So since all of this did not help I also had a look at the output of tailscaled on my client and this looks interesting:
So what actually seems to break is the internal DNS server (or something in that realm) and the DERP is just fallout from the before failure:
So this means apparently it now sets the "DNS Domain" to a different value, but I'm not sure whether that causes the issue 🤔
Since it might be of interest, here is the output of my DNS config:
Also @kradalby thanks for looking into this, this is very much appreciated! ❤️
@christian-heusel commented on GitHub (Jul 25, 2024):
Possible duplicates/related issues given my latest findings: #2029 #2026
@kradalby commented on GitHub (Jul 25, 2024):
ah yes, a DNS issue might be the potential culprit, while waiting for a reply I started to write up some clearly missing DNS tests, so will continue with that then. I'll post when I have an update, maybe on either of those two issues.
@kradalby commented on GitHub (Aug 1, 2024):
I think #2034 addresses this, would it be possible for you to help me test it? would be great to avoid another bad release like beta1.
Binary is available here: https://github.com/juanfont/headscale/actions/runs/10195837541?pr=2034
@christian-heusel commented on GitHub (Aug 1, 2024):
@kradalby thanks for working on a fix! 🤗
Except for the fact that I had to rename from
dns_configtodnsthe mentioned PR did not fix the issues 😅Also there was no error about the rename from
restricted_nameserverstosplit, but setting it also did not help, same for the addition ofglobalin thenameserversdirective 🤔@kradalby commented on GitHub (Aug 2, 2024):
Yes, sorry, thats part of the PR, I have one theory looking at your config, can you try setting a
dns.base_namedifferent from the DNS name you use for headscale? somagicdns.vpn.heusel.euasbase_nameand keepvpn.heusel.eufor the headscale?Did you not get any warnings at the beginning of your logs? I've made it so if not replaced it should fatal now.
@kradalby commented on GitHub (Aug 2, 2024):
To test, you can set the
dns.use_username_in_magic_dnstotrue, which will be removed, but it will temp give you back the username in the dns, which should have the same effect.This might be a good thing that we discovered, that having the same base_name and headscale dns name will no longer be possible due to how Tailscale takes over the DNS.
For the record, in Tailscale upstream, this is the same behaviour:
so by headscale injecting username stuff, it did not break before, but that prevents us from achieving some other things, so it sadly has to go.
@kradalby commented on GitHub (Aug 16, 2024):
@christian-heusel did you have an opportunity to test this?
@christian-heusel commented on GitHub (Aug 16, 2024):
Sorry I forgot about this, will test and report soon!
@christian-heusel commented on GitHub (Aug 17, 2024):
This makes the three types of queries from above work again 😊 👍🏻
Regarding https://github.com/juanfont/headscale/issues/2025#issuecomment-2264760872:
When unsetting the previously set
dns.use_username_in_magic_dnsand setting thebase_nameas requested it also works as expected 👍🏻Maybe I'm testing this wrong, but I dont get any warnings/fatal versions with the latest version of your branch and the following DNS config snippet (which I have verified to be the active one inside of the confainer by running
docker compose exec headscale cat /etc/headscale/config.yaml):Instead I'm being warned about a key I don't even have set:
@christian-heusel commented on GitHub (Aug 17, 2024):
Edit: reverted bogus comment here, I tried to connect against a node of mine that went offline for unbeknownst reaons. 😆
@kradalby commented on GitHub (Aug 19, 2024):
hmm, I you wont really get any errors/warnings for setting the wrong keys, for example
dns.nameserversisnt checked, whiledns_config.nameserversis checked. I suppose we could do it, but there is no good way in cobra to cover all cases, only the ones we can think about.At the moment it will only warn if you have the old set, and not the new. if you mix, it wont detect it.