{"record":{"id":"9d5f73c44bb725ba","repo":"projectdiscovery/nuclei","slug":"ipv4-and-or-ipv6-must-be-selected","errorCode":null,"errorMessage":"ipv4 and/or ipv6 must be selected","messagePattern":"ipv4 and/or ipv6 must be selected","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/runner/options.go","lineNumber":230,"sourceCode":"\n\t// verify that a valid ip version type was selected (4, 6)\n\tif len(options.IPVersion) == 0 {\n\t\t// add ipv4 as default\n\t\toptions.IPVersion = append(options.IPVersion, \"4\")\n\t}\n\tvar useIPV4, useIPV6 bool\n\tfor _, ipv := range options.IPVersion {\n\t\tswitch ipv {\n\t\tcase \"4\":\n\t\t\tuseIPV4 = true\n\t\tcase \"6\":\n\t\t\tuseIPV6 = true\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unsupported ip version: %s\", ipv)\n\t\t}\n\t}\n\tif !useIPV4 && !useIPV6 {\n\t\treturn errors.New(\"ipv4 and/or ipv6 must be selected\")\n\t}\n\treturn nil\n}\n\nfunc validateMissingS3Options(options *types.Options) []string {\n\tvar missing []string\n\tif options.AwsBucketName == \"\" {\n\t\tmissing = append(missing, \"AWS_TEMPLATE_BUCKET\")\n\t}\n\tif options.AwsProfile == \"\" {\n\t\tvar missingCreds []string\n\t\tif options.AwsAccessKey == \"\" {\n\t\t\tmissingCreds = append(missingCreds, \"AWS_ACCESS_KEY\")\n\t\t}\n\t\tif options.AwsSecretKey == \"\" {\n\t\t\tmissingCreds = append(missingCreds, \"AWS_SECRET_KEY\")\n\t\t}\n\t\tif options.AwsRegion == \"\" {","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/internal/runner/options.go#L212-L248","documentation":"The file protocol streams each matched archive member into a temp file (os.CreateTemp) and its deferred cleanup panics if Close fails. A close error after a successful create is abnormal and usually environmental - ENOSPC, NFS I/O errors, or a double close - so nuclei panics rather than silently risk truncated data being matched.","triggerScenarios":"Scanning archives (zip/tar) when TMPDIR fills mid-copy, or TMPDIR lives on a network filesystem that returns I/O errors on close.","commonSituations":"Long archive-heavy scans exhausting /tmp; containers with small ephemeral disks; TMPDIR pointed at NFS.","solutions":["Free space or point TMPDIR to a larger local volume (export TMPDIR=/data/tmp) and rerun","Narrow the scan to the failing target to confirm, then exclude that archive via -exclude or file filters","If it recurs on healthy local disks, capture the panic details and report it upstream"],"exampleFix":"# before\nTMPDIR=/tmp nuclei -t file.yaml -l files.txt   # /tmp fills up\n# after\nmkdir -p /data/tmp && TMPDIR=/data/tmp nuclei -t file.yaml -l files.txt","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"defer func() {\n    if r := recover(); r != nil {\n        // temp-file cleanup panic (close failure): log and continue with next target\n        log.Printf(\"file protocol cleanup panic: %v\", r)\n    }\n}()\nerr := engine.ExecuteWithResults(target, ...)\nif err != nil {\n    log.Printf(\"execute failed: %v\", err)\n}","preventionTips":["Keep TMPDIR local and spacious","Monitor disk usage during archive scans","Isolate archive-heavy scans per target so one panic does not kill a batch"],"tags":["file","temp-file","panic","filesystem"],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}