{"record":{"id":"b352b15cf0ffe9a9","repo":"ethereum/go-ethereum","slug":"raw-entry-ancestor-not-found-x","errorCode":null,"errorMessage":"raw-entry ancestor not found: %x","messagePattern":"raw-entry ancestor not found: %x","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"trie/sync.go","lineNumber":348,"sourceCode":"\t}\n\t// If database says duplicate, the blob is present for sure.\n\t// Note we only check the existence with new code scheme, snap\n\t// sync is expected to run with a fresh new node. Even there\n\t// exists the code with legacy format, fetch and store with\n\t// new scheme anyway.\n\tif rawdb.HasCodeWithPrefix(s.database, hash) {\n\t\treturn\n\t}\n\t// Assemble the new sub-trie sync request\n\treq := &codeRequest{\n\t\tpath: path,\n\t\thash: hash,\n\t}\n\t// If this sub-trie has a designated parent, link them together\n\tif parent != (common.Hash{}) {\n\t\tancestor := s.nodeReqs[string(parentPath)] // the parent of codereq can ONLY be nodereq\n\t\tif ancestor == nil {\n\t\t\tpanic(fmt.Sprintf(\"raw-entry ancestor not found: %x\", parent))\n\t\t}\n\t\tancestor.deps++\n\t\treq.parents = append(req.parents, ancestor)\n\t}\n\ts.scheduleCodeRequest(req)\n}\n\n// Missing retrieves the known missing nodes from the trie for retrieval. To aid\n// both eth/6x style fast sync and snap/1x style state sync, the paths of trie\n// nodes are returned too, as well as separate hash list for codes.\nfunc (s *Sync) Missing(max int) ([]string, []common.Hash, []common.Hash) {\n\tvar (\n\t\tnodePaths  []string\n\t\tnodeHashes []common.Hash\n\t\tcodeHashes []common.Hash\n\t)\n\tfor !s.queue.Empty() && (max == 0 || len(nodeHashes)+len(codeHashes) < max) {\n\t\t// Retrieve the next item in line","sourceCodeStart":330,"sourceCodeEnd":366,"githubUrl":"https://github.com/ethereum/go-ethereum/blob/6bb0588ad8e7f922e4ad5580f51265a4097af08f/trie/sync.go#L330-L366","documentation":"Error \"raw-entry ancestor not found: %x\" thrown in ethereum/go-ethereum.","triggerScenarios":"trie.Sync scheduling a raw code entry whose parent path is absent from the node request table.","commonSituations":"State sync scheduling bytecode requests for contracts in sub-tries that were not scheduled first.","solutions":["The code/raw-entry request's parent node request was never scheduled. Ensure the owning sub-trie/node request is registered before adding code requests that reference it as parent."],"exampleFix":"// Register the node request first, then the code request:\nsync.AddSubTrie(path, hash, root, nil)\nsync.AddCodeEntry(codePath, codeHash, parentHash)","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6bb0588ad8e7f922e4ad5580f51265a4097af08f","analyzedAt":"2026-08-15T10:06:53.996Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}