dgraph-io/dgraph · error
failed to run publisher: %v
Error message
failed to run publisher: %v
What it means
In streamInGroup, the publisher goroutine reads from the incoming StreamExtSnapshot stream and fans messages out to subscribers (local writer and forwarders). If ps.handlePublisher returns an error (e.g. failed Recv on the incoming stream other than EOF), it is wrapped as 'failed to run publisher: %v'.
Source
Thrown at worker/import.go:620
return nil
}
updateNodeStatus(&ps.RWMutex, successfulNodes, member.Addr, true)
glog.Infof("[import] Successfully connected and streamed data to node: %v", member.Addr)
return nil
})
}
}
eg.Go(func() error {
defer ps.close()
defer func() {
if err := stream.Send(&api.StreamExtSnapshotResponse{}); err != nil {
glog.Errorf("[import] failed to send close on in: %v", err)
}
}()
if err := ps.handlePublisher(errGCtx, stream); err != nil {
return fmt.Errorf("failed to run publisher: %v", err)
}
return nil
})
if err := eg.Wait(); err != nil {
return fmt.Errorf("failed to run in group streaming: %v", err)
}
// Sends a StreamExtSnapshotResponse with the Finish flag set to true to indicate
// the completion of the streaming process. If an error occurs during the send
// operation, it is returned for further handling.
if err := stream.Send(&api.StreamExtSnapshotResponse{Finish: true}); err != nil {
glog.Errorf("failed to send done signal: %v", err)
}
// If this node is the leader and fails to reach a majority of nodes, we return an error.
// This ensures that the data is reliably received by enough nodes before proceeding.
if forward && !checkMajority(successfulNodes) {
glog.Error("[import] Majority of nodes failed to receive data.")View on GitHub (pinned to 759e242be6)
Solutions
- Check the wrapped cause for the real transport error and fix connectivity between the importing client and this alpha.
- Retry the snapshot streaming from the beginning; errgroup aborts the whole stream.
- Check alpha logs for the paired subscriber/forwarder errors that may have canceled the shared errgroup context.
- Ensure the importing client is not timing out before the stream completes.
Example fix
null
Defensive patterns
Strategy: try-catch
Validate before calling
// verify client stability and connectivity before streaming
if err := pingAlpha(proxyAddr); err != nil { return err } Try / catch
err := streamInGroupViaClient(ctx)
if err != nil && strings.Contains(err.Error(), "failed to run publisher") {
root := errors.Unwrap(err)
// root is the transport/recv error; retry whole stream after fixing it
} Prevention
- Keep the importing client process alive and connected for the full stream
- Avoid network interruptions between the client/proxy alpha and the group leader
- Check alpha logs for the first underlying error; this message is only a wrapper
When it happens
Trigger: The client streaming into StreamExtSnapshot breaks mid-stream: Recv returns a transport error or the context is canceled; malformed/failed receive inside the publisher loop.
Common situations: dgraph live loader / client disconnected during bulk import; network drop between proxy alpha and this leader; stream canceled because another group member (subscriber/forwarder) failed first via errgroup context.
Related errors
- failed to establish stream with leader: %v
- failed to run in group streaming: %v
- connection string cannot be empty
- failed to connect to endpoint [%s]: %w
- failed to initiate external snapshot stream: %v
AI-assisted analysis of dgraph-io/dgraph@759e242be6 (2026-09-01).
Data as JSON: /api/errors/10d357e574c99d71.
Report an issue: GitHub.