{"record":{"id":"1d6bf2bfabc44753","repo":"dgraph-io/dgraph","slug":"s","errorCode":null,"errorMessage":"%s","messagePattern":"%s","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dgraph/cmd/live/run.go","lineNumber":796,"sourceCode":"\n\tif opt.dataFiles == \"\" {\n\t\treturn errors.New(\"RDF or JSON file(s) location must be specified\")\n\t}\n\n\tfs := filestore.NewFileStore(opt.dataFiles)\n\n\tfilesList := fs.FindDataFiles(opt.dataFiles, []string{\".rdf\", \".rdf.gz\", \".json\", \".json.gz\"})\n\ttotalFiles := len(filesList)\n\tif totalFiles == 0 {\n\t\treturn errors.Errorf(\"No data files found in %s\", opt.dataFiles)\n\t}\n\tfmt.Printf(\"Found %d data file(s) to process\\n\", totalFiles)\n\n\terrCh := make(chan error, totalFiles)\n\tfor _, file := range filesList {\n\t\tfile = strings.Trim(file, \" \\t\")\n\t\tgo func(file string) {\n\t\t\terrCh <- errors.Wrap(l.processFile(ctx, fs, file, opt.key), file)\n\t\t}(file)\n\t}\n\n\t// PrintCounters should be called after schema has been updated.\n\tif bmOpts.PrintCounters {\n\t\tgo l.printCounters()\n\t}\n\n\tfor range totalFiles {\n\t\tif err := <-errCh; err != nil {\n\t\t\tfmt.Printf(\"Error while processing data file %s\\n\", err)\n\t\t\treturn err\n\t\t}\n\t}\n\n\tclose(l.reqs)\n\t// First we wait for requestsWg, when it is done we know all retry requests have been added\n\t// to retryRequestsWg. We can't have the same waitgroup as by the time we call Wait, we can't","sourceCodeStart":778,"sourceCodeEnd":814,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/dgraph/cmd/live/run.go#L778-L814","documentation":"Errors surfaced here are the wrapped result of `l.processFile(...)` for each data file: `errors.Wrap(l.processFile(ctx, fs, file, opt.key), file)` prefixes the underlying message with the file name. The processFile goroutines send their failures on errCh and run() reports them, so the real cause is inside per-file parsing/uploading (malformed RDF/JSON, network failure to Alpha, auth errors).","triggerScenarios":"Any failure inside processFile: malformed RDF/JSON lines in the data file, connection loss to the Alpha mid-upload, invalid/insufficient creds (key), or internal batch mutation errors during concurrent goroutine processing.","commonSituations":"Corrupt or truncated .rdf.gz files; invalid N-Quad syntax on a line; Alpha restarted during a long bulk load; wrong --creds causing rejected mutations.","solutions":["Read the full wrapped message: the file path prefix tells you which input failed; open and validate that file's syntax","Re-run with a smaller --batch size and watch for Alpha-side errors in its logs","Check network connectivity and Alpha health (graphql admin health endpoint) during the load","Verify --creds / auth configuration are correct for the target namespace"],"exampleFix":"// error output shape\n// <file>: while lexing ... at line 5: Invalid syntax\n// after: fix line 5 of data.rdf\ndgraph live --files data.rdf  # corrected file loads","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await runLive({ files: dir, alpha, creds });\n} catch (e) {\n  // errors.Wrap prefixes the failing file path\n  const m = String(e.message);\n  const [file, ...rest] = m.split(': ');\n  console.error(`Load failed for file ${file}: ${rest.join(': ')}`);\n  // then inspect that file's syntax or Alpha connectivity\n}","preventionTips":["Validate RDF/JSON syntax of data files before loading (parser dry run)","Keep Alpha healthy and monitor it during long loads; retry failed files individually","Use a modest --batch size so per-file errors are easier to isolate"],"tags":["cli","data-parsing","concurrency","wrapped-error"],"backgroundTag":"data-file-processing-failed","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}