{"record":{"id":"365344a9ebb240fb","repo":"cayleygraph/cayley","slug":"errquadstorenotregistred","errorCode":"ErrQuadStoreNotRegistred","errorMessage":"this QuadStore is not registered","messagePattern":"this QuadStore is not registered","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"graph/registry.go","lineNumber":23,"sourceCode":"// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage graph\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nvar (\n\tErrQuadStoreNotRegistred  = fmt.Errorf(\"this QuadStore is not registered\")\n\tErrQuadStoreNotPersistent = fmt.Errorf(\"cannot specify address for non-persistent backend\")\n\tErrOperationNotSupported  = fmt.Errorf(\"this Operation is not supported\")\n)\n\nvar storeRegistry = make(map[string]QuadStoreRegistration)\n\ntype NewStoreFunc func(string, Options) (QuadStore, error)\ntype InitStoreFunc func(string, Options) error\ntype UpgradeStoreFunc func(string, Options) error\n\ntype QuadStoreRegistration struct {\n\tNewFunc      NewStoreFunc\n\tUpgradeFunc  UpgradeStoreFunc\n\tInitFunc     InitStoreFunc\n\tIsPersistent bool\n}\n\nfunc RegisterQuadStore(name string, register QuadStoreRegistration) {","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/cayleygraph/cayley/blob/81dcd7d73e45136bc0d01802a8ba4685d8a533eb/graph/registry.go#L5-L41","documentation":"NewQuadStore/InitQuadStore/UpgradeQuadStore look up the backend by name in the internal storeRegistry. If no backend with that name was registered (via init() in an imported package), the sentinel ErrQuadStoreNotRegistred is returned.","triggerScenarios":"graph.NewQuadStore(\"mongodb\", ...) (or Init/Upgrade) with a backend whose package was never imported, or a typo in the backend name (\"leveldb\" vs \"level\").","commonSituations":"Forgetting to import _ \"github.com/cayleygraph/cayley/graph/nosql/...\" or the specific kv backend package; renaming backends between Cayley versions; blank-import list pruned by a linter/IDE.","solutions":["Blank-import the backend package: _ \"github.com/cayleygraph/cayley/graph/kv/leveldb\"","Check the exact registered name (see registry.Register calls or graph.ListQuadStores()) for typos","Verify the backend package is still maintained in your Cayley version (some moved to nimble-coder repos)","Keep blank imports in one file so lint/autocleanup doesn't remove them"],"exampleFix":"// before\nimport \"github.com/cayleygraph/cayley/graph\"\nqs, err := graph.NewQuadStore(\"leveldb\", path, nil)\n// after\nimport (\n    \"github.com/cayleygraph/cayley/graph\"\n    _ \"github.com/cayleygraph/cayley/graph/kv/leveldb\"\n)\nqs, err := graph.NewQuadStore(\"leveldb\", path, nil)","handlingStrategy":"try-catch","validationCode":"import (\n    \"github.com/cayleygraph/cayley/graph\"\n    _ \"github.com/cayleygraph/cayley/graph/kv/leveldb\" // register backend\n)\nfor _, name := range graph.RegisteredQuadStores() {\n    if name == backendName { found = true }\n}","typeGuard":"func backendRegistered(name string) bool {\n    for _, n := range graph.RegisteredQuadStores() { if n == name { return true } }\n    return false\n}","tryCatchPattern":"qs, err := graph.NewQuadStore(name, path, opts)\nif errors.Is(err, graph.ErrQuadStoreNotRegistred) {\n    return nil, fmt.Errorf(\"backend %q not registered: add a blank import of its package\", name)\n}","preventionTips":["Always blank-import every backend package you use","Keep imports in a dedicated file so cleanup tools don't remove them","Check registered names with graph.ListQuadStores()/docs when upgrading Cayley","Validate the storage config name at startup"],"tags":["registry","backend","import"],"backgroundTag":"missing-dependency","analyzedSha":"81dcd7d73e45136bc0d01802a8ba4685d8a533eb","analyzedAt":"2026-09-06T06:14:12.358Z","contentChangedAt":"2026-09-06T06:14:12.358Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}