You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Headscale prints an error message about unmarshalling records from dns.extra_records_path even though records are processed and streamed to nodes just fine.
Expected Behavior
Only print an error message when something went wrong permanently and cannot be recovered. Essentially transient errors happening while the file is written should be hidden. A user with the default log level has the impression that something is broken.
Steps To Reproduce
Set dns.extra_records_path to some path
Write to the file with: echo '[{"name":"grafana.myvpn.example.com","type":"A","value":"100.64.0.1"}]' | jq -cS > .headscale-dns/extra.json. Using this command triggers the error message reliably while headscale processes the changes correctly.
Headscale logs:
2024-12-14T19:28:11+01:00 TRC ../runner/work/headscale/headscale/hscontrol/dns/extrarecords.go:87 > extra records received filewatch event op=WRITE path=.headscale-dns/extra.json
2024-12-14T19:28:11+01:00 ERR ../runner/work/headscale/headscale/hscontrol/dns/extrarecords.go:115 > reading extra records from path: .headscale-dns/extra.json error="unmarshalling records, content: \"\": unexpected end of JSON input"
2024-12-14T19:28:11+01:00 TRC ../runner/work/headscale/headscale/hscontrol/dns/extrarecords.go:87 > extra records received filewatch event op=WRITE path=.headscale-dns/extra.json
2024-12-14T19:28:11+01:00 TRC ../runner/work/headscale/headscale/hscontrol/dns/extrarecords.go:134 > extra records updated from path, count old: 1, new: 1 records=[{"Name":"grafana.myvpn.example.com","Type":"A","Value":"100.64.0.2"}]
2024-12-14T19:28:11+01:00 TRC ../runner/work/headscale/headscale/hscontrol/poll.go:644 > received stream update: StateFullUpdate node=n1 node.id=1 omitPeers=false readOnly=false stream=true
2024-12-14T19:28:11+01:00 TRC ../runner/work/headscale/headscale/hscontrol/poll.go:644 > Sending Full MapResponse node=n1 node.id=1 omitPeers=false readOnly=false stream=true
2024-12-14T19:28:11+01:00 TRC finished writing mapresp to node mkey=mkey:94b730090613b46fe0f4a0a51518c2a585c63641a25a24ec419881be55015b0d node=n1 timeSpent=0.095543
2024-12-14T19:28:11+01:00 TRC ../runner/work/headscale/headscale/hscontrol/poll.go:644 > update sent node=n1 node.id=1 omitPeers=false readOnly=false stream=true
nblock
changed the title
[Bug] Misleading error message when reading from dns.extra_records_path
[Bug] Misleading error message while processing dns.extra_records_path
Dec 14, 2024
* Fix excess error message during writes
Fixes#2290
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
* retry filewatcher on removed files
This should handled if files are deleted and added again, and for rename
scenarios.
Fixes#2289
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
* test more write and remove in filewatcher
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
---------
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
Is this a support request?
Is there an existing issue for this?
Current Behavior
Headscale prints an error message about unmarshalling records from
dns.extra_records_path
even though records are processed and streamed to nodes just fine.Expected Behavior
Only print an error message when something went wrong permanently and cannot be recovered. Essentially transient errors happening while the file is written should be hidden. A user with the default log level has the impression that something is broken.
Steps To Reproduce
dns.extra_records_path
to some pathecho '[{"name":"grafana.myvpn.example.com","type":"A","value":"100.64.0.1"}]' | jq -cS > .headscale-dns/extra.json
. Using this command triggers the error message reliably while headscale processes the changes correctly.Environment
Runtime environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: