crowdsecurity/crowdsec · error

get stream: %w

Error message

get stream: %w

What it means

The HTTP GET to the CAPI decisions stream endpoint (GetStreamV3, community blocklist + blocklist pull) failed — at startup or on a periodic pull. Causes: network failure, CAPI 5xx, timeout, or auth token expiry. The pull-top lock is released afterwards; the blocklist is simply not refreshed this round.

Source

Thrown at pkg/apiserver/apic.go:612

		return nil
	}

	/*defer lock release*/
	defer func() {
		log.Debug("Releasing lock for pullCAPI")

		if err := a.dbClient.ReleasePullCAPILock(ctx); err != nil {
			log.Errorf("while releasing lock: %v", err)
		}
	}()

	log.Infof("Starting community-blocklist update")

	log.Debugf("Community pull: %t | Blocklist pull: %t", a.pullCommunity, a.pullBlocklists)

	data, _, err := a.apiClient.Decisions.GetStreamV3(ctx, apiclient.DecisionsStreamOpts{Startup: a.startup, CommunityPull: a.pullCommunity, AdditionalPull: a.pullBlocklists})
	if err != nil {
		return fmt.Errorf("get stream: %w", err)
	}

	a.startup = false
	/*to count additions/deletions across lists*/

	log.Debugf("Received %d new decisions", len(data.New))
	log.Debugf("Received %d deleted decisions", len(data.Deleted))

	if data.Links != nil {
		log.Debugf("Received %d blocklists links", len(data.Links.Blocklists))
		log.Debugf("Received %d allowlists links", len(data.Links.Allowlists))
	}

	addCounters, deleteCounters := makeAddAndDeleteCounters()

	// process deleted decisions
	nbDeleted, err := a.HandleDeletedDecisionsV3(ctx, data.Deleted, deleteCounters)
	if err != nil {

View on GitHub (pinned to 909b515798)

Solutions

  1. Check outbound connectivity to api.crowdsec.net (TLS, proxy, DNS)
  2. If the token expired the client re-authenticates — verify credentials if auth errors persist
  3. Check CAPI status pages for outages; the pull retries on the next cycle
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at pkg/apiserver/apic.go:612 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of crowdsecurity/crowdsec@909b515798 (2026-09-06). Data as JSON: /api/errors/8fe1e524a09b4920. Report an issue: GitHub.