dgraph-io/dgraph · error

%s

Error message

%s

What it means

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).

Source

Thrown at dgraph/cmd/live/run.go:796

	if opt.dataFiles == "" {
		return errors.New("RDF or JSON file(s) location must be specified")
	}

	fs := filestore.NewFileStore(opt.dataFiles)

	filesList := fs.FindDataFiles(opt.dataFiles, []string{".rdf", ".rdf.gz", ".json", ".json.gz"})
	totalFiles := len(filesList)
	if totalFiles == 0 {
		return errors.Errorf("No data files found in %s", opt.dataFiles)
	}
	fmt.Printf("Found %d data file(s) to process\n", totalFiles)

	errCh := make(chan error, totalFiles)
	for _, file := range filesList {
		file = strings.Trim(file, " \t")
		go func(file string) {
			errCh <- errors.Wrap(l.processFile(ctx, fs, file, opt.key), file)
		}(file)
	}

	// PrintCounters should be called after schema has been updated.
	if bmOpts.PrintCounters {
		go l.printCounters()
	}

	for range totalFiles {
		if err := <-errCh; err != nil {
			fmt.Printf("Error while processing data file %s\n", err)
			return err
		}
	}

	close(l.reqs)
	// First we wait for requestsWg, when it is done we know all retry requests have been added
	// to retryRequestsWg. We can't have the same waitgroup as by the time we call Wait, we can't

View on GitHub (pinned to 759e242be6)

Solutions

  1. Read the full wrapped message: the file path prefix tells you which input failed; open and validate that file's syntax
  2. Re-run with a smaller --batch size and watch for Alpha-side errors in its logs
  3. Check network connectivity and Alpha health (graphql admin health endpoint) during the load
  4. Verify --creds / auth configuration are correct for the target namespace

Example fix

// error output shape
// <file>: while lexing ... at line 5: Invalid syntax
// after: fix line 5 of data.rdf
dgraph live --files data.rdf  # corrected file loads
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await runLive({ files: dir, alpha, creds });
} catch (e) {
  // errors.Wrap prefixes the failing file path
  const m = String(e.message);
  const [file, ...rest] = m.split(': ');
  console.error(`Load failed for file ${file}: ${rest.join(': ')}`);
  // then inspect that file's syntax or Alpha connectivity
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of dgraph-io/dgraph@759e242be6 (2026-09-01). Data as JSON: /api/errors/1d6bf2bfabc44753. Report an issue: GitHub.