ipfs/kubo · error

failed to parse endpoint %q: %w

Error message

failed to parse endpoint %q: %w

What it means

While building the HTTP delegated routers at node startup, one of the configured Routing.DelegatedRouters or Ipns.DelegatedPublishers endpoint URLs could not be parsed as a multiaddr/URL; the offending endpoint string is quoted in the message.

Source

Thrown at core/node/libp2p/routingopt.go:122

	}

	return endpoints
}

func constructDefaultHTTPRouters(cfg *config.Config, addrFunc func() []ma.Multiaddr) ([]*routinghelpers.ParallelRouter, error) {
	var routers []*routinghelpers.ParallelRouter
	httpRetrievalEnabled := cfg.HTTPRetrieval.Enabled.WithDefault(config.DefaultHTTPRetrievalEnabled)

	// Collect URLs from both router and publisher sources
	endpoints := collectAllEndpoints(cfg)

	// Group endpoints by origin (base URL) and aggregate capabilities
	originCapabilities := make(map[string]autoconf.EndpointCapabilities)
	for _, endpoint := range endpoints {
		// Parse endpoint and determine capabilities based on source
		baseURL, capabilities, err := determineCapabilities(endpoint)
		if err != nil {
			return nil, fmt.Errorf("failed to parse endpoint %q: %w", endpoint.URL, err)
		}

		// Aggregate capabilities for this origin
		existing := originCapabilities[baseURL]
		existing.Merge(capabilities)
		originCapabilities[baseURL] = existing
	}

	// Create single HTTP router and composer per origin
	for baseURL, capabilities := range originCapabilities {
		// Construct HTTP router using base URL (without path)
		httpRouter, err := irouting.ConstructHTTPRouter(baseURL, cfg.Identity.PeerID, addrFunc, cfg.Identity.PrivKey, httpRetrievalEnabled)
		if err != nil {
			return nil, err
		}

		// Configure router operations based on aggregated capabilities
		// https://specs.ipfs.tech/routing/http-routing-v1/

View on GitHub (pinned to 329838acdf)

Solutions

  1. Fix the endpoint string in Routers.*.Endpoints / Ipns.DelegatedPublishers in the config (e.g. https://example.com/routing/v1)
  2. Check for typos, missing scheme, or stray whitespace
  3. See docs/config.md for the expected endpoint format
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at core/node/libp2p/routingopt.go:122 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of ipfs/kubo@329838acdf (2026-09-03). Data as JSON: /api/errors/8b57f0f79150a451. Report an issue: GitHub.