{"record":{"id":"c5951bf9beb3a6c5","repo":"projectdiscovery/nuclei","slug":"dialers-not-initialized-for-s","errorCode":null,"errorMessage":"dialers not initialized for %s","messagePattern":"dialers not initialized for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/js/libs/http/http.go","lineNumber":272,"sourceCode":"\t\treturn nil, fmt.Errorf(\"http: executionId not set\")\n\t}\n\n\tparsed, err := url.Parse(rawURL)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"http: invalid url: %w\", err)\n\t}\n\tif parsed.Scheme == \"\" || parsed.Host == \"\" {\n\t\treturn nil, fmt.Errorf(\"http: url must include scheme and host\")\n\t}\n\n\thost := parsed.Hostname()\n\tif !protocolstate.IsHostAllowed(executionID, host) {\n\t\treturn nil, protocolstate.ErrHostDenied.Msgf(host)\n\t}\n\n\tdialers := protocolstate.GetDialersWithId(executionID)\n\tif dialers == nil {\n\t\treturn nil, fmt.Errorf(\"dialers not initialized for %s\", executionID)\n\t}\n\n\ttlsConfig := &tls.Config{\n\t\tInsecureSkipVerify: true,\n\t\tMinVersion:         tls.VersionTLS10,\n\t\tRenegotiation:      tls.RenegotiateOnceAsClient,\n\t}\n\tif host != \"\" {\n\t\ttlsConfig.ServerName = host\n\t}\n\n\ttransport := &http.Transport{\n\t\tProxy: http.ProxyFromEnvironment,\n\t\tDialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {\n\t\t\treturn dialers.Fastdialer.Dial(ctx, network, addr)\n\t\t},\n\t\tDialTLSContext: func(ctx context.Context, network, addr string) (net.Conn, error) {\n\t\t\treturn dialers.Fastdialer.DialTLSWithConfig(ctx, network, addr, tlsConfig)","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/js/libs/http/http.go#L254-L290","documentation":"An executionId was found but protocolstate.GetDialersWithId(executionID) returned nil: no fastdialer set is registered for the execution (never initialized, already torn down, or an id mismatch). The HTTP path refuses to fall back to a default dialer, so it fails closed.","triggerScenarios":"SDK/test usage that sets an executionId but skips protocolstate initialization; requests still in flight when the execution's dialers were released; a Client held across execution boundaries.","commonSituations":"Same lifecycle-mismatch class as the grpc 'dialers not initialized' error: embedded usage bypassing engine init, goroutines outliving the scan, or executions cleaned up while JS callbacks still run.","solutions":["Initialize protocolstate dialers for the execution before any request","Keep Client construction and requests inside a single execution; never cache a Client across scans","Cancel or await in-flight requests before execution teardown"],"exampleFix":"// before: client (and its execution) already torn down when this runs\nconst resp = client.Get('https://example.com');\n\n// after: create and use the client within one execution\nconst client = new http.Client();\nconst resp = client.Get('https://example.com');\n// execution ends after the template run, not before","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const resp = client.Get(url);\n} catch (e) {\n  if (/dialers not initialized/.test(e.message || '')) {\n    // execution lifecycle bug: create the Client and request inside one live execution\n  }\n}","preventionTips":["Keep http.Client construction and requests within a single execution","Do not cache clients or responses across template runs","In SDK flows, initialize protocolstate before the first request"],"tags":["http","lifecycle","dialer","javascript"],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}