projectdiscovery/nuclei · error

dialers not initialized for %s

Error message

dialers not initialized for %s

What it means

Thrown by oracleCustomDialer.dialWithCtx — the net.Dialer shim that go-ora's connector uses for every connection — when protocolstate.GetDialersWithId(o.executionId) returns nil. The executionId is captured when the OracleClient installs the custom dialer, so the error means that execution has no registered dialer set (protocolstate.Init never ran for it). Because ConnectWithDSN/ExecuteQueryWithDSN skip the IsOracle probe, this is the first dialer-dependent error hit on those paths.

Source

Thrown at pkg/js/libs/oracle/oracledialer.go:27

	"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/protocolstate"
)

// oracleCustomDialer implements the dialer interface expected by go-ora
type oracleCustomDialer struct {
	executionId string
	ctx         context.Context
}

func (o *oracleCustomDialer) dialWithCtx(ctx context.Context, network, address string) (net.Conn, error) {
	if ctx == nil {
		ctx = o.ctx
	}
	if ctx == nil {
		ctx = context.Background()
	}
	dialers := protocolstate.GetDialersWithId(o.executionId)
	if dialers == nil {
		return nil, fmt.Errorf("dialers not initialized for %s", o.executionId)
	}
	if !protocolstate.IsHostAllowed(o.executionId, address) {
		// host is not valid according to network policy
		return nil, protocolstate.ErrHostDenied.Msgf(address)
	}
	return dialers.Fastdialer.Dial(ctx, network, address)
}

func (o *oracleCustomDialer) Dial(network, address string) (net.Conn, error) {
	return o.dialWithCtx(o.ctx, network, address)
}

func (o *oracleCustomDialer) DialTimeout(network, address string, timeout time.Duration) (net.Conn, error) {
	baseCtx := o.ctx
	if baseCtx == nil {
		baseCtx = context.Background()
	}
	ctx, cancel := context.WithTimeout(baseCtx, timeout)

View on GitHub (pinned to 265b3a3dec)

Solutions

  1. Run scripts through the nuclei engine so each execution id has dialers registered via protocolstate.Init
  2. Embedders: call protocolstate.Init(&types.Options{ExecutionId: id, ...}) before any Oracle DSN call, with the same id in ctx
  3. Do not cache OracleClient across different executions — the dialer bakes in the old executionId; create a fresh client per script run
  4. After changing network policy options (RestrictLocalNetworkAccess/ExcludeTargets), ensure Init ran again for the current execution id
Defensive patterns

Strategy: validation

Validate before calling

// Go embedder: dialers must exist before any DSN-based oracle call
if protocolstate.GetDialersWithId(executionId) == nil {
    _ = protocolstate.Init(&types.Options{ExecutionId: executionId})
}

Try / catch

try { client.ConnectWithDSN(dsn); } catch (e) { if (String(e).includes('dialers not initialized')) { /* engine-less or stale client: re-init runtime, recreate client */ } else { throw e; } }

Prevention

When it happens

Trigger: Calling oracle.ConnectWithDSN or ExecuteQueryWithDSN from a JS context whose executionId lacks initialized dialers: standalone goja runtimes, direct Go calls in tests, custom SDK harnesses, or a stale executionId captured by a long-lived OracleClient after the engine rotated ids.

Common situations: Embedding the oracle lib outside the nuclei engine; unit tests exercising DSN flows; reusing an OracleClient instance across executions where the dialer map was rebuilt (policy change triggers dialers.Delete + re-Init).

Related errors


AI-assisted analysis of projectdiscovery/nuclei@265b3a3dec (2026-08-15). Data as JSON: /api/errors/61c85aff7db153d2. Report an issue: GitHub.