mirror of
https://github.com/juanfont/headscale.git
synced 2026-01-11 20:00:28 +01:00
[Bug] "Unexpected fault address" when opening SQLite db under armv7 #828
Closed
opened 2025-12-29 02:24:32 +01:00 by adam
·
11 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#828
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 @m-kloeckner on GitHub (Oct 11, 2024).
Is this a support request?
Is there an existing issue for this?
Current Behavior
I am running headscale on a armv7 SOC (Cubieboard2) in a docker container since quite a while now. After switching to version 0.23 I'm running in an error.
When trying to start headscale using the official headscale/headscale docker image for armv7 the process fails with the following error after trying to open the SQLite db.
Expected Behavior
Opening the SQLite db does not crash the startup process of headscale on armv7.
Steps To Reproduce
Environment
Runtime environment
Anything else?
I built the docker image using debian:slim as a base; it fails with the exact same error.
@maxlysenko commented on GitHub (Nov 28, 2024):
Hello,
Ran into the same issue on a ARMv7 board (OrangePi).
Found a statement about fragile modernc.org/libc dependency in the documentation of
modernc.org/sqlite.Tried changing the versions in the go.mod file and managed to build working executable.
The exact steps were:
git clone https://github.com/juanfont/headscale.gitcd headscalegit checkout v0.23.0go mod tidyGOOS="linux" GOARCH="arm" GOARM="7" go build -v -ldflags="-s -w -X github.com/juanfont/headscale/cmd/headscale/cli.Version=v0.23.0" github.com/juanfont/headscale/cmd/headscale@jumper047 commented on GitHub (Nov 30, 2024):
@maxlysenko thank you for your fix, has same issue on my rpi 1b (armv6). Your patch helps me too.
@kradalby commented on GitHub (Dec 2, 2024):
I wonder if this would trigger when doing armv6 builds on other machinery, if that is the case, the github action for just running the build could just compile for all ARCHes so we get feedback when something like that breaks.
If someone is up for it, I'll accept a PR doing:
@kradalby commented on GitHub (Dec 5, 2024):
I've set up the build job in #2270, they all currently build, which means that the dependency might be in sync on master?
I dont have a Arm6 board at hand, but I've added so all the binaries are added to the build job, can someone have a look at trying the relevant binary from https://github.com/juanfont/headscale/actions/runs/12160775450?pr=2270 to see if they start on the relevant board?
Please dont do in production, running the CLI or something should be fine.
@maxlysenko commented on GitHub (Dec 5, 2024):
Hello,
Tested arm7 build from https://github.com/juanfont/headscale/actions/runs/12160775450?pr=2270, nothing changed, same crash when opening database.
The problem is probably not in the build process or cross-compilation, but in the versions of dependencies in the go.mod file.
Most likely nothing will change until you change version of modernc.org/libc to corresponding with modernc.org/sqlite.
According to description in modernc.org/sqlite docs you shoud use in your go.mod the exact same version of modernc.org/libc as in the go.mod file of the modernc.org/sqlite itself.
So if in your go.mod file you have
modernc.org/sqlite v1.32.0then you should usemodernc.org/libc v1.55.3, because go.mod file for v1.32.0 of modernc.org/sqlite contains this version.Also it seems from commit cc087474 that from v1.33.0 modernc.org/sqlite uses internal/libc, so bumping version of modernc.org/sqlite to v1.33.0 or higher also may help.Upgrading only modernc.org/sqlite version did't work for me. Tried versions from v1.33.0 to v1.34.1.
Out of interest tried
to see which versions of modules go mod will pull automatically. The versions are
So for now my workaround is:
@kradalby commented on GitHub (Dec 6, 2024):
hmm, I need a way to detect this at build time, we dont have any machinery available to ensure we dont have this regression at runtime. Open for proposals.
@maxlysenko commented on GitHub (Dec 6, 2024):
modernc.org/libc was upgraded to v1.60.1 in go.mod in #2098.
Why it was done, why this version was chosen?
As far as I understand (looking at the
go mod graphandgo mod whyoutput) none of the imported packages/modules requires this version.So just downgrading modernc.org/libc to v1.55.3 in go.mod should fix the problem.
Unfortunatly I do not know how to detect runtime problem at build time.
@kradalby commented on GitHub (Dec 6, 2024):
In general they are just updated to latest, there is no other rational, so I am happy to have them adjusted so it works again, what I am concerned about is me/someone else upgrading it without ensuring the lockstep.
Typically I just run a
go get -uto upgrade all. If we dont have a test/ci failing, it will be hard to detect/prevent this.@kradalby commented on GitHub (Dec 6, 2024):
I've updated my PR with the dependency version you mention, but I am hesitant calling it a "fix" as it doesnt protect for the future.
@maxlysenko commented on GitHub (Dec 6, 2024):
Tested arm builds from https://github.com/juanfont/headscale/actions/runs/12199297972, they don't crash on database access, they start and work.
@kradalby commented on GitHub (Dec 9, 2024):
Great, the best measure I think I can do for now to ensure we keep this in lock is documentation, I have added a section to our go.mod file in
f1b97dd(#2270)