{"record":{"id":"977e61fb66de7255","repo":"projectdiscovery/nuclei","slug":"cannot-load-metadata-cache-into-a-modified-index","errorCode":null,"errorMessage":"cannot load metadata cache into a modified index","messagePattern":"cannot load metadata cache into a modified index","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/catalog/index/index.go","lineNumber":265,"sourceCode":"\n\tif err := os.Rename(tmpFile, i.cacheFile); err != nil {\n\t\t_ = os.Remove(tmpFile)\n\n\t\treturn err\n\t}\n\n\ti.dirty = false\n\n\treturn nil\n}\n\n// Load loads the cache from disk using gob decoding.\nfunc (i *Index) Load() error {\n\ti.mu.Lock()\n\tdefer i.mu.Unlock()\n\n\tif i.dirty {\n\t\treturn errors.New(\"cannot load metadata cache into a modified index\")\n\t}\n\n\tfile, err := os.Open(i.cacheFile)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn nil\n\t\t}\n\n\t\treturn err\n\t}\n\tdefer func() { _ = file.Close() }()\n\n\tvar snapshot cacheSnapshot\n\n\tdecoder := gob.NewDecoder(file)\n\tif err := decoder.Decode(&snapshot); err != nil {\n\t\t_ = file.Close()\n\t\t_ = os.Remove(i.cacheFile)","sourceCodeStart":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/catalog/index/index.go#L247-L283","documentation":"Error \"cannot load metadata cache into a modified index\" thrown in projectdiscovery/nuclei.","triggerScenarios":"Thrown at pkg/catalog/index/index.go:265 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"}