netbirdio/netbird · error

Error getting sync response

Error message

Error getting sync response: {}

What it means

Fires in handleClientSyncResponse when client.GetLatestSyncResponse() returns an error retrieving the client's most recent management sync response. The client exists, but its latest NetworkMap/sync response could not be produced — e.g. the client has never completed a sync or internal state is unavailable.

Solutions

  1. Verify the client has connected to management at least once (a fresh, never-synced client has no stored response)
  2. Check management connectivity for the client
  3. Inspect the wrapped error in the response/log for the retrieval failure cause
  4. Restart the client to force a new sync cycle
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at proxy/internal/debug/handler.go:509 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of netbirdio/netbird@93e97f4bf1 (2026-08-16). Data as JSON: /api/errors/37d98c9134ce93e5. Report an issue: GitHub.

Appendix: source

Thrown at proxy/internal/debug/handler.go:509

func (h *Handler) inboundInfoFor(accountID types.AccountID) (InboundListenerInfo, bool) {
	if h.inbound == nil {
		return InboundListenerInfo{}, false
	}
	all := h.inbound.InboundListeners()
	info, ok := all[accountID]
	return info, ok
}

func (h *Handler) handleClientSyncResponse(w http.ResponseWriter, _ *http.Request, accountID types.AccountID, wantJSON bool) {
	client, ok := h.provider.GetClient(accountID)
	if !ok {
		http.Error(w, "Client not found: "+string(accountID), http.StatusNotFound)
		return
	}

	syncResp, err := client.GetLatestSyncResponse()
	if err != nil {
		http.Error(w, "Error getting sync response: "+err.Error(), http.StatusInternalServerError)
		return
	}

	if syncResp == nil {
		http.Error(w, "No sync response available for client: "+string(accountID), http.StatusNotFound)
		return
	}

	opts := protojson.MarshalOptions{
		EmitUnpopulated: true,
		UseProtoNames:   true,
		Indent:          "  ",
		AllowPartial:    true,
	}

	jsonBytes, err := opts.Marshal(syncResp)
	if err != nil {
		http.Error(w, "Error marshaling sync response: "+err.Error(), http.StatusInternalServerError)

View on GitHub (pinned to 93e97f4bf1)