{"record":{"id":"503eaa6d6200565d","repo":"dgraph-io/dgraph","slug":"updateextsnapshotstreamingstaterequest-must-not-be","errorCode":null,"errorMessage":"UpdateExtSnapshotStreamingStateRequest must not be nil","messagePattern":"UpdateExtSnapshotStreamingStateRequest must not be nil","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"edgraph/server.go","lineNumber":2058,"sourceCode":"\tif !x.WorkerConfig.AclEnabled {\n\t\treturn nil\n\t}\n\n\tns, err := x.ExtractNamespaceFrom(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif tc.Hash != getHash(ns, tc.StartTs) {\n\t\treturn x.ErrHashMismatch\n\t}\n\treturn nil\n}\n\nfunc (s *Server) UpdateExtSnapshotStreamingState(ctx context.Context,\n\treq *api.UpdateExtSnapshotStreamingStateRequest) (v *api.UpdateExtSnapshotStreamingStateResponse, err error) {\n\n\tif req == nil {\n\t\treturn nil, errors.New(\"UpdateExtSnapshotStreamingStateRequest must not be nil\")\n\t}\n\n\t// External-snapshot import is a destructive admin operation: it arms import mode and\n\t// (via StreamExtSnapshot) replaces a group store. Gate it on both authorization paths so\n\t// it is protected under ACL and under an --security auth-token. Each gate fails open when\n\t// its feature is unconfigured, so the arming requirement on the stream path backstops the\n\t// bare-OSS case.\n\tif err := AuthorizeGuardians(ctx); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := hasPoormansAuth(ctx); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif req.Start && req.Finish {\n\t\treturn nil, errors.New(\"UpdateExtSnapshotStreamingStateRequest cannot have both Start and Finish set to true\")\n\t}\n","sourceCodeStart":2040,"sourceCodeEnd":2076,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/edgraph/server.go#L2040-L2076","documentation":"UpdateExtSnapshotStreamingState is a gRPC admin operation that arms (or disarms) external-snapshot import mode — a destructive operation that replaces a group store. The server rejects a nil request pointer outright before any authorization or Raft proposal (edgraph/server.go:2058). This guards the handler against malformed gRPC calls where the request body was never populated.","triggerScenarios":"Calling the UpdateExtSnapshotStreamingState gRPC method with a nil request message — typically a hand-rolled client invoking the RPC without constructing api.UpdateExtSnapshotStreamingStateRequest, or a wrapper passing nil through.","commonSituations":"Custom admin scripts or generated client misuse where the request struct is omitted; middleware/proxy layers forwarding empty bodies; SDK code paths where optional request arguments default to nil.","solutions":["Construct and pass a valid api.UpdateExtSnapshotStreamingStateRequest with Start or Finish set (exactly one of them)","Use the official Dgraph Go client (dgo) admin APIs rather than invoking the raw gRPC method manually","Check your proxy/interceptor layer for dropped request bodies if you believe you sent a request","If using generated stubs, verify the field is populated before Dial/Invoke"],"exampleFix":"// before\nconn.UpdateExtSnapshotStreamingState(ctx, nil)\n// after\nreq := &api.UpdateExtSnapshotStreamingStateRequest{Start: true}\nresp, err := conn.UpdateExtSnapshotStreamingState(ctx, req)","handlingStrategy":"validation","validationCode":"func validExtSnapReq(r *api.UpdateExtSnapshotStreamingStateRequest) bool {\n\treturn r != nil\n}\n// guard before RPC:\n// if !validExtSnapReq(req) { return errors.New(\"request required\") }","typeGuard":"func isNonNilReq(r *api.UpdateExtSnapshotStreamingStateRequest) bool {\n\treturn r != nil\n}","tryCatchPattern":"resp, err := client.UpdateExtSnapshotStreamingState(ctx, req)\nif err != nil && strings.Contains(err.Error(), \"must not be nil\") {\n\t// client bug: construct the request and retry once\n}","preventionTips":["Always construct the request struct before invoking admin RPCs","Wrap raw gRPC calls in typed helpers that reject nil requests","Prefer dgo/admin tooling over hand-rolled RPC invocations","Add unit tests asserting admin calls receive populated requests"],"tags":["dgraph","grpc","admin","validation"],"backgroundTag":"nil-request-payload","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}