projectdiscovery/subfinder · error

could not init passive session for

Error message

could not init passive session for %s: %s

What it means

Runtime error emitted on the results channel by Agent.EnumerateSubdomainsWithCtx when subscraping.NewSession fails for the given domain — usually because an HTTP client/proxy (the -proxy URL) could not be constructed. Enumeration for that domain stops; the error is wrapped with the domain name for context.

Solutions

  1. Check the interpolated cause; most often it is an invalid or unreachable -proxy URL
  2. Fix or omit the proxy setting so subscraping.NewSession can build its client
  3. Handle subscraping.Error results when consuming the channel so this failure is reported instead of silently ending output
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at pkg/passive/passive.go:75 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of projectdiscovery/subfinder@7a0b91f0fa (2026-09-06). Data as JSON: /api/errors/fde5d63f5545af18. Report an issue: GitHub.

Appendix: source

Thrown at pkg/passive/passive.go:75

	go func() {
		defer close(results)

		var enumerateOptions EnumerationOptions
		for _, enumerateOption := range options {
			enumerateOption(&enumerateOptions)
		}

		multiRateLimiter, err := a.buildMultiRateLimiter(ctx, rateLimit, enumerateOptions.customRateLimiter)
		if err != nil {
			results <- subscraping.Result{
				Type: subscraping.Error, Error: fmt.Errorf("could not init multi rate limiter for %s: %s", domain, err),
			}
			return
		}
		session, err := subscraping.NewSession(domain, proxy, multiRateLimiter, timeout)
		if err != nil {
			results <- subscraping.Result{
				Type: subscraping.Error, Error: fmt.Errorf("could not init passive session for %s: %s", domain, err),
			}
			return
		}
		defer session.Close()
		session.MaxResults = enumerateOptions.maxResults
		session.MaxResponseBodySize = enumerateOptions.maxResponseBodySize

		ctx, cancel := context.WithTimeout(ctx, maxEnumTime)

		wg := &sync.WaitGroup{}
		// Run each source in parallel on the target domain
		for _, runner := range a.sources {
			wg.Add(1)
			go func(source subscraping.Source) {
				defer wg.Done()
				ctxWithValue := context.WithValue(ctx, subscraping.CtxSourceArg, source.Name())
				sourceResults := source.Run(ctxWithValue, domain, session)
				for resp := range sourceResults {

View on GitHub (pinned to 7a0b91f0fa)