{"record":{"id":"1120007bfb64fb99","repo":"syncthing/syncthing","slug":"unknown-address-scheme-q","errorCode":null,"errorMessage":"unknown address scheme %q","messagePattern":"unknown address scheme %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/connections/service.go","lineNumber":1035,"sourceCode":"\ts.connectionStatusMut.Unlock()\n}\n\nfunc (s *service) NATType() string {\n\ts.listenersMut.RLock()\n\tdefer s.listenersMut.RUnlock()\n\tfor _, listener := range s.listeners {\n\t\tnatType := listener.NATType()\n\t\tif natType != \"unknown\" {\n\t\t\treturn natType\n\t\t}\n\t}\n\treturn \"unknown\"\n}\n\nfunc getDialerFactory(cfg config.Configuration, uri *url.URL) (dialerFactory, error) {\n\tdialerFactory, ok := dialers[uri.Scheme]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"unknown address scheme %q\", uri.Scheme)\n\t}\n\tif err := dialerFactory.Valid(cfg); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn dialerFactory, nil\n}\n\nfunc getListenerFactory(cfg config.Configuration, uri *url.URL) (listenerFactory, error) {\n\tlistenerFactory, ok := listeners[uri.Scheme]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"unknown address scheme %q\", uri.Scheme)\n\t}\n\tif err := listenerFactory.Valid(cfg); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn listenerFactory, nil","sourceCodeStart":1017,"sourceCodeEnd":1053,"githubUrl":"https://github.com/syncthing/syncthing/blob/058bcd7334839663cf569501d3ac539034d45cb5/lib/connections/service.go#L1017-L1053","documentation":"Returned by getDialerFactory in lib/connections/service.go when resolving a listen/dial URL whose scheme is not a registered key in the package-level dialers map (tcp, tcp4, tcp6, quic, quic4, quic6, relay, unix). It signals a malformed or unsupported address URI in the device or listener configuration, and occurs before any dialer validation runs.","triggerScenarios":"Passing an address like foo://1.2.3.4:22000 or https://host to the connection service, or a URI with a typo in the scheme; also referencing a scheme compiled out of the build (e.g. a build without the QUIC dialer registered).","commonSituations":"Hand-edited config.xml with an address scheme that Syncthing does not speak; scripts generating device addresses; upgrading between versions where a scheme was removed; copy-pasting an https URL into the device 'Addresses' field.","solutions":["Correct the address to a supported scheme: tcp://host:22000, quic://host:22000, or relay://.","Use the empty string or 'dynamic' for default addressing instead of inventing a scheme.","Validate all device/listener URIs with url.Parse plus a scheme whitelist before passing them into the service.","If you intended a custom dialer, register it in the dialers map before constructing the service."],"exampleFix":"// before\naddr := \"https://192.0.2.10:22000\" // unknown address scheme \"https\"\n\n// after\naddr := \"tcp://192.0.2.10:22000\"","handlingStrategy":"validation","validationCode":"var dialSchemes = map[string]bool{\"tcp\": true, \"tcp4\": true, \"tcp6\": true, \"quic\": true, \"quic4\": true, \"quic6\": true, \"relay\": true, \"unix\": true}\n\nfunc validDialAddr(addr string) bool {\n    u, err := url.Parse(addr)\n    if err != nil { return false }\n    return dialSchemes[u.Scheme]\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Whitelist URI schemes before saving device addresses to config.","Never put https/http URLs in device addresses; they are not dial schemes.","Reject config saves that contain unknown schemes instead of deferring failure to dial time."],"tags":["configuration","uri","syncthing","dial"],"backgroundTag":null,"analyzedSha":"058bcd7334839663cf569501d3ac539034d45cb5","analyzedAt":"2026-08-15T07:53:43.174Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}