dgraph-io/dgraph · error

you must specify a 'destination' value

Error message

you must specify a 'destination' value

What it means

resolveBackup validates the backup mutation input and rejects the request when input.Destination is empty. A backup needs a destination URI (file path, S3/minio URL, etc.) telling Dgraph where to write the backup.

Source

Thrown at graphql/admin/backup.go:34

	"github.com/dgraph-io/dgraph/v25/graphql/schema"
	"github.com/dgraph-io/dgraph/v25/protos/pb"
	"github.com/dgraph-io/dgraph/v25/worker"
)

type backupInput struct {
	DestinationFields
	ForceFull bool
}

func resolveBackup(ctx context.Context, m schema.Mutation) (*resolve.Resolved, bool) {
	glog.Info("Got backup request")

	input, err := getBackupInput(m)
	if err != nil {
		return resolve.EmptyResult(m, err), false
	}
	if input.Destination == "" {
		err := fmt.Errorf("you must specify a 'destination' value")
		return resolve.EmptyResult(m, err), false
	}

	req := &pb.BackupRequest{
		Destination:  input.Destination,
		AccessKey:    input.AccessKey,
		SecretKey:    input.SecretKey,
		SessionToken: input.SessionToken,
		Anonymous:    input.Anonymous,
		ForceFull:    input.ForceFull,
	}
	taskId, err := worker.Tasks.Enqueue(req)
	if err != nil {
		return resolve.EmptyResult(m, err), false
	}

	msg := fmt.Sprintf("Backup queued with ID %#x", taskId)
	data := response("Success", msg)

View on GitHub (pinned to 759e242be6)

Solutions

  1. Include a non-empty destination in the mutation, e.g. destination: "/backups" or "s3://bucket/path".
  2. Verify any variable feeding destination resolves to a non-empty string before sending.
  3. For S3 destinations also supply accessKey/secretKey as needed by your setup.

Example fix

// before
mutation { backup(input: {destination: ""}) { response { message } } }
// after
mutation { backup(input: {destination: "/var/backups"}) { response { message } } }
Defensive patterns

Strategy: validation

Validate before calling

function requireDestination(dest) {
  if (typeof dest !== 'string' || dest.trim() === '')
    throw new Error("backup mutation requires a non-empty 'destination' (path or s3:// URI)");
}

Type guard

function hasDestination(v) { return typeof v?.destination === 'string' && v.destination.trim().length > 0; }

Try / catch

try { await backup(input); } catch (e) { if (String(e).includes("you must specify a 'destination' value")) { throw new Error('Configure backup destination before invoking backup'); } throw e; }

Prevention

When it happens

Trigger: Executing the backup mutation (via /admin GraphQL or /backup) where getBackupInput succeeded but input.destination was omitted or set to an empty string.

Common situations: Copy-pasting a backup mutation example without editing the destination; environment where the destination was supplied via a variable that resolved to ""; confusing the REST /backup endpoint's destination parameter with the GraphQL field name.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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