{"record":{"id":"9d7205873abaedc2","repo":"dgraph-io/dgraph","slug":"from-processkvlist","errorCode":null,"errorMessage":"from processKVList","messagePattern":"from processKVList","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"worker/restore_map.go","lineNumber":900,"sourceCode":"\t\t\t\t}\n\t\t\t\t// If there is a drop namespace, we just ban the namespace in the pstore.\n\t\t\t\tns, err := strconv.ParseUint(op.DropValue, 0, 64)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, errors.Wrapf(err, \"Map phase failed to parse namespace\")\n\t\t\t\t}\n\t\t\t\tif err := pstore.BanNamespace(ns); err != nil {\n\t\t\t\t\treturn nil, errors.Wrapf(err, \"Map phase failed to ban namespace: %d\", ns)\n\t\t\t\t}\n\t\t\t\tmaxBannedNs = x.Max(maxBannedNs, ns)\n\t\t\t}\n\t\t}\n\t\tglog.Infof(\"[MAP] Processed manifest num: %v\", manifest.BackupNum)\n\t} // done with all the manifests.\n\n\tglog.Infof(\"Histogram of map input sizes:\\n%s\\n\", mapper.szHist)\n\tclose(mapper.reqCh)\n\tif err := g.Wait(); err != nil {\n\t\treturn nil, errors.Wrapf(err, \"from processKVList\")\n\t}\n\tif err := mapper.Flush(); err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to flush the mapper\")\n\t}\n\tmapRes := &mapResult{\n\t\tmaxUid:        mapper.maxUid,\n\t\tmaxNs:         mapper.maxNs,\n\t\tshouldDropAll: dropAll,\n\t\tdropAttr:      dropAttr,\n\t\tdropNs:        dropNs,\n\t}\n\t// update the maxNsId considering banned namespaces.\n\tmapRes.maxNs = x.Max(mapRes.maxNs, maxBannedNs)\n\treturn mapRes, nil\n}\n","sourceCodeStart":882,"sourceCodeEnd":916,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/worker/restore_map.go#L882-L916","documentation":"RunMapper fans out manifest processing to worker goroutines via processKVList; after closing reqCh it waits on the errgroup. If any worker failed, this wrapper propagates that error with the 'from processKVList' context.","triggerScenarios":"Any goroutine in the errgroup (processing KV lists from the backup manifests) returns an error, e.g. malformed KVs, decode failures, or downstream map-phase errors like the namespace-ban failure.","commonSituations":"Restoring a corrupted or truncated backup; concurrency/timeout failures while reading posting lists during map phase; an earlier wrapped error (e.g. error 960) surfacing here.","solutions":["Look at the wrapped root-cause error in the message chain to find the actual failing KV processing step","Validate the backup manifest and data files before restoring","Re-run the restore; transient IO failures may not recur","Reduce mapper concurrency if resource exhaustion is the root cause"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if err := validateBackupManifest(manifests); err != nil { return fmt.Errorf(\"invalid backup: %w\", err) }","typeGuard":null,"tryCatchPattern":"res, err := RunMapper(ctx, opts)\nif err != nil {\n    // unwrap errgroup error chain to the real cause\n    cause := errors.Cause(err)\n    glog.Errorf(\"map phase failed, cause: %v\", cause)\n    return cause\n}","preventionTips":["Validate backup integrity (manifests and data) before restore","Always inspect the full wrapped error chain, not just the wrapper message","Keep mapper concurrency within machine resource limits"],"tags":["restore","map-phase","concurrency","errgroup"],"backgroundTag":"map-phase-worker-failed","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}