{"record":{"id":"f071709158eb5170","repo":"canopy-network/canopy","slug":"failed-to-create-iterator-v","errorCode":null,"errorMessage":"failed to create iterator: %v","messagePattern":"failed to create iterator: (.+?)","errorType":"error_code","errorClass":"ErrStoreGet","httpStatus":null,"severity":"error","filePath":"store/versioned_store.go","lineNumber":290,"sourceCode":"\t}\n\tvar (\n\t\terr  error\n\t\titer *pebble.Iterator\n\t\topts = &pebble.IterOptions{\n\t\t\tLowerBound:      prefix,\n\t\t\tUpperBound:      prefixEnd(prefix),\n\t\t\tKeyTypes:        pebble.IterKeyTypePointsOnly,\n\t\t\tPointKeyFilters: filters,\n\t\t\tUseL6Filters:    false,\n\t\t}\n\t)\n\tif vs.batch != nil && vs.batch.Indexed() {\n\t\titer, err = vs.batch.NewIter(opts)\n\t} else {\n\t\titer, err = vs.db.NewIter(opts)\n\t}\n\tif iter == nil || err != nil {\n\t\treturn nil, ErrStoreGet(fmt.Errorf(\"failed to create iterator: %v\", err))\n\t}\n\treturn &VersionedIterator{\n\t\titer:    iter,\n\t\tstore:   vs,\n\t\tprefix:  prefix,\n\t\treverse: reverse,\n\t\tseek:    seek,\n\t}, nil\n}\n\n// VersionedIterator implements  iteration with single-pass key deduplication\ntype VersionedIterator struct {\n\titer          *pebble.Iterator\n\tstore         *VersionedStore\n\tprefix        []byte\n\tkey           []byte\n\tvalue         []byte\n\treverse       bool","sourceCodeStart":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/canopy-network/canopy/blob/ee8197d91dd410f6592cb650a94c925ee6dc8bad/store/versioned_store.go#L272-L308","documentation":"Raised in newVersionedIterator when neither the batch nor the underlying pebble DB can create an iterator (iter is nil or err is non-nil) for the given prefix and filter options. It signals an infrastructure failure opening a range scan, not an empty result set, and is wrapped with ErrStoreGet.","triggerScenarios":"Thrown at store/versioned_store.go:290 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the embedded pebble error for the root cause (DB closed, invalid bounds/options).","Verify prefix bounds (LowerBound/UpperBound) are well-formed and lower < upper.","Retry the iteration; if it persists, check the pebble DB health and whether the batch was invalidated."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ee8197d91dd410f6592cb650a94c925ee6dc8bad","analyzedAt":"2026-09-06T09:30:15.973Z","contentChangedAt":"2026-09-06T09:30:15.973Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}