syncthing/syncthing · error

unknown address scheme %q

Error message

unknown address scheme %q

What it means

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.

Source

Thrown at lib/connections/service.go:1035

	s.connectionStatusMut.Unlock()
}

func (s *service) NATType() string {
	s.listenersMut.RLock()
	defer s.listenersMut.RUnlock()
	for _, listener := range s.listeners {
		natType := listener.NATType()
		if natType != "unknown" {
			return natType
		}
	}
	return "unknown"
}

func getDialerFactory(cfg config.Configuration, uri *url.URL) (dialerFactory, error) {
	dialerFactory, ok := dialers[uri.Scheme]
	if !ok {
		return nil, fmt.Errorf("unknown address scheme %q", uri.Scheme)
	}
	if err := dialerFactory.Valid(cfg); err != nil {
		return nil, err
	}

	return dialerFactory, nil
}

func getListenerFactory(cfg config.Configuration, uri *url.URL) (listenerFactory, error) {
	listenerFactory, ok := listeners[uri.Scheme]
	if !ok {
		return nil, fmt.Errorf("unknown address scheme %q", uri.Scheme)
	}
	if err := listenerFactory.Valid(cfg); err != nil {
		return nil, err
	}

	return listenerFactory, nil

View on GitHub (pinned to 058bcd7334)

Solutions

  1. Correct the address to a supported scheme: tcp://host:22000, quic://host:22000, or relay://.
  2. Use the empty string or 'dynamic' for default addressing instead of inventing a scheme.
  3. Validate all device/listener URIs with url.Parse plus a scheme whitelist before passing them into the service.
  4. If you intended a custom dialer, register it in the dialers map before constructing the service.

Example fix

// before
addr := "https://192.0.2.10:22000" // unknown address scheme "https"

// after
addr := "tcp://192.0.2.10:22000"
Defensive patterns

Strategy: validation

Validate before calling

var dialSchemes = map[string]bool{"tcp": true, "tcp4": true, "tcp6": true, "quic": true, "quic4": true, "quic6": true, "relay": true, "unix": true}

func validDialAddr(addr string) bool {
    u, err := url.Parse(addr)
    if err != nil { return false }
    return dialSchemes[u.Scheme]
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of syncthing/syncthing@058bcd7334 (2026-08-15). Data as JSON: /api/errors/1120007bfb64fb99. Report an issue: GitHub.