{"record":{"id":"72720b7963d4faf3","repo":"projectdiscovery/nuclei","slug":"could-not-close-v","errorCode":null,"errorMessage":"could not close: %+v","messagePattern":"could not close: %\\+v","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/protocols/file/request.go","lineNumber":160,"sourceCode":"\t\t\t\t\trequest.options.Progress.AddToTotal(1)\n\t\t\t\t\treader, err := archiveInstance.OpenReader(stream)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgologger.Error().Msgf(\"%s\\n\", err)\n\t\t\t\t\t\t// error while elaborating the file\n\t\t\t\t\t\trequest.options.Progress.IncrementFailedRequestsBy(1)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tfileStat, _ := fi.Stat()\n\t\t\t\t\ttmpFileOut, err := os.CreateTemp(\"\", \"\")\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgologger.Error().Msgf(\"%s\\n\", err)\n\t\t\t\t\t\t// error while elaborating the file\n\t\t\t\t\t\trequest.options.Progress.IncrementFailedRequestsBy(1)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tdefer func() {\n\t\t\t\t\t\tif err := tmpFileOut.Close(); err != nil {\n\t\t\t\t\t\t\tpanic(fmt.Errorf(\"could not close: %+v\", err))\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif err := os.Remove(tmpFileOut.Name()); err != nil {\n\t\t\t\t\t\t\tpanic(fmt.Errorf(\"could not remove: %+v\", err))\n\t\t\t\t\t\t}\n\t\t\t\t\t}()\n\t\t\t\t\t_, err = io.Copy(tmpFileOut, reader)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgologger.Error().Msgf(\"%s\\n\", err)\n\t\t\t\t\t\t// error while elaborating the file\n\t\t\t\t\t\trequest.options.Progress.IncrementFailedRequestsBy(1)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\t_ = tmpFileOut.Sync()\n\t\t\t\t\t// rewind the file\n\t\t\t\t\t_, _ = tmpFileOut.Seek(0, 0)\n\t\t\t\t\tevent, fileMatches, err := request.processReader(tmpFileOut, filePath, input, fileStat.Size(), previous)\n\t\t\t\t\tif err != nil {","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/protocols/file/request.go#L142-L178","documentation":"Error \"could not close: %+v\" thrown in projectdiscovery/nuclei.","triggerScenarios":"Thrown at pkg/protocols/file/request.go:160 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}