Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NTP service set the wrong systemtime in windows #2428

Closed
4 of 5 tasks
AtticusZeller opened this issue Dec 31, 2024 · 4 comments
Closed
4 of 5 tasks

NTP service set the wrong systemtime in windows #2428

AtticusZeller opened this issue Dec 31, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@AtticusZeller
Copy link

AtticusZeller commented Dec 31, 2024

Operating system

Windows

System version

win11 24H2

Installation type

Original sing-box Command Line

If you are using a graphical client, please provide the version of the client.

Original sing-box Command Line

Version

sing-box version 1.11.0-beta.20

Environment: go1.23.4 windows/amd64
Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_ech,with_utls,with_reality_server,with_acme,with_clash_api
Revision: fb512212e8ce4fbb26179473870ec217963f862f
CGO: disabled

Description

NTP service set the wrong system time while ntp and write_to_system enabled.

i tried to use different server,interval which did work.

it did run in powershell(admin)

Reproduction

  "ntp": {
    "enabled": true,
    "interval": "30m0s",
    "server": "time.tencent.com",
    "write_to_system": true,
    "server_port": 123
  }

Logs

+0800 2024-12-31 09:21:13 INFO network: updated default interface Wi-Fi, index 6
+0800 2024-12-31 09:21:13 DEBUG dns: lookup domain time.tencent.com
+0800 2024-12-31 09:21:13 DEBUG router: match[1] rule_set=geosite-cn => route(dns_direct)
+0800 2024-12-31 09:21:13 DEBUG router: match[1] => route(dns_direct)
+0800 2024-12-31 09:21:13 DEBUG outbound/direct[direct]: outbound packet connection to 223.5.5.5:53
+0800 2024-12-31 09:21:13 DEBUG dns: exchanged doh.pub NOERROR 122
+0800 2024-12-31 09:21:13 DEBUG dns: exchanged doh.pub SOA doh.pub. 122 IN SOA ns3.dnsv5.com. enterprise3dnsadmin.dnspod.com. 1735267500 3600 180 1209600 180
+0800 2024-12-31 09:21:13 DEBUG dns: exchanged doh.pub NOERROR 122
+0800 2024-12-31 09:21:13 DEBUG dns: exchanged doh.pub SOA doh.pub. 122 IN SOA ns3.dnsv5.com. enterprise3dnsadmin.dnspod.com. 1735267500 3600 180 1209600 180
+0800 2024-12-31 09:21:13 DEBUG dns: exchanged doh.pub NOERROR 67
+0800 2024-12-31 09:21:13 DEBUG dns: exchanged doh.pub A doh.pub. 67 IN A 120.53.53.53
+0800 2024-12-31 09:21:13 DEBUG dns: exchanged doh.pub A doh.pub. 67 IN A 1.12.12.12
+0800 2024-12-31 09:21:13 DEBUG outbound/direct[direct]: outbound connection to 120.53.53.53:443
+0800 2024-12-31 09:21:13 DEBUG dns: exchanged doh.pub NOERROR 67
+0800 2024-12-31 09:21:13 DEBUG dns: exchanged doh.pub A doh.pub. 67 IN A 120.53.53.53
+0800 2024-12-31 09:21:13 DEBUG dns: exchanged doh.pub A doh.pub. 67 IN A 1.12.12.12
+0800 2024-12-31 09:21:13 DEBUG outbound/direct[direct]: outbound connection to 120.53.53.53:443
+0800 2024-12-31 09:21:14 DEBUG dns: exchanged time.tencent.com NOERROR 600
+0800 2024-12-31 09:21:14 DEBUG dns: exchanged time.tencent.com NOERROR 600
+0800 2024-12-31 09:21:14 DEBUG dns: exchanged time.tencent.com CNAME time.tencent.com. 600 IN CNAME time1.cloud.tencent.com.
+0800 2024-12-31 09:21:14 DEBUG dns: exchanged time.tencent.com CNAME time.tencent.com. 600 IN CNAME time1.cloud.tencent.com.
+0800 2024-12-31 09:21:14 DEBUG dns: exchanged time.tencent.com OPT OPT PSEUDOSECTION: EDNS: version 0 flags: MBZ: 0x0258, udp: 512 PADDING: 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+0800 2024-12-31 09:21:14 DEBUG dns: exchanged time.tencent.com A time1.cloud.tencent.com. 600 IN A 106.55.184.199
+0800 2024-12-31 09:21:14 DEBUG dns: exchanged time.tencent.com OPT OPT PSEUDOSECTION: EDNS: version 0 flags: MBZ: 0x0258, udp: 512 PADDING: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+0800 2024-12-31 09:21:14 DEBUG dns: lookup succeed for time.tencent.com: 106.55.184.199
+0800 2024-12-31 09:21:14 INFO ntp: updated time: 2024-12-31 17:21:14 +0800

Supporter

Integrity requirements

  • I confirm that I have read the documentation, understand the meaning of all the configuration items I wrote, and did not pile up seemingly useful options or default values.
  • I confirm that I have provided the server and client configuration files and process that can be reproduced locally, instead of a complicated client configuration file that has been stripped of sensitive data.
  • I confirm that I have provided the simplest configuration that can be used to reproduce the error I reported, instead of depending on remote servers, TUN, graphical interface clients, or other closed-source software.
  • I confirm that I have provided the complete configuration files and logs, rather than just providing parts I think are useful out of confidence in my own intelligence.
@charliez0
Copy link

charliez0 commented Jan 6, 2025

Does the https://sing-box.sagernet.org/configuration/ntp/ have "write_to_system" param?

@AtticusZeller
Copy link
Author

https://sing-box.sagernet.org/configuration/ntp/

it does have the param write_to_system in raw code but disappear in doc.

enable write_to_system to write,but it wrote the wrong time now.

@AtticusZeller AtticusZeller changed the title NTP would not change system time NTP service set the wrong systemtime in windows Jan 6, 2025
@AtticusZeller
Copy link
Author

i found the commit to sing was differet to time_windows.go, so i tried to run .\sing-box.exe tools synctime -w -C .\ ,it did work finally.

@AtticusZeller
Copy link
Author

it was fixed in1.11.0-beta.23 Pre-release
thank you so much for it 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants