{"record":{"id":"76a471c00929911c","repo":"dgraph-io/dgraph","slug":"cannot-create-backup-handler","errorCode":null,"errorMessage":"cannot create backup handler","messagePattern":"cannot create backup handler","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"worker/online_restore.go","lineNumber":245,"sourceCode":"\t}\n\n\t// TODO: after the drop, the tablets for the predicates stored in this group's\n\t// backup could be in a different group. The tablets need to be moved.\n\n\t// Reset tablets and set correct tablets to match the restored backup.\n\tcreds := &x.MinioCredentials{\n\t\tAccessKey:    req.AccessKey,\n\t\tSecretKey:    req.SecretKey,\n\t\tSessionToken: req.SessionToken,\n\t\tAnonymous:    req.Anonymous,\n\t}\n\turi, err := url.Parse(req.Location)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"cannot parse backup location\")\n\t}\n\thandler, err := NewUriHandler(uri, creds)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"cannot create backup handler\")\n\t}\n\n\tmanifests, err := getManifestsToRestore(handler, uri, req)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"cannot get backup manifests\")\n\t}\n\n\t// filter manifests that needs to be restored\n\tmfsToRestore := manifests[:0]\n\tfor _, m := range manifests {\n\t\tif (req.BackupNum == 0 || m.BackupNum <= req.BackupNum) &&\n\t\t\t(req.IncrementalFrom == 0 || m.BackupNum >= req.IncrementalFrom) {\n\n\t\t\tmfsToRestore = append(mfsToRestore, m)\n\t\t}\n\t}\n\tmanifests = mfsToRestore\n","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/worker/online_restore.go#L227-L263","documentation":"Wrapped by handleRestoreProposal (worker/online_restore.go:245) after NewUriHandler(uri, creds) fails. NewUriHandler matches the URI scheme to a storage backend handler (s3, minio, gcs, azure, file) and validates credentials; failure means the scheme is unsupported or the supplied credentials/options are invalid for that handler.","triggerScenarios":"Location with an unknown scheme; missing required credentials for the scheme (AccessKey/SecretKey for s3/minio, SessionToken stale); inconsistent options (Anonymous:true plus access keys); handler construction rejecting the combination.","commonSituations":"Restoring from S3 without passing access/secret keys in the request; expired STS session token; typo'd scheme (s3a://, s3:/bucket); mixing anonymous access with provided keys; enterprise-feature scheme used on a build lacking it.","solutions":["Check Alpha logs for the wrapped underlying error to see which handler/scheme was rejected.","Supply the correct credentials fields (AccessKey, SecretKey, SessionToken) in the restore request for s3/minio, or set Anonymous for public buckets.","Use an exactly supported scheme: s3://, minio://, gcs://, azure://, or a plain absolute path for local filesystem.","Ensure the restore request options are consistent — do not combine Anonymous with access keys."],"exampleFix":"// before\n{\"location\": \"s3://bucket/backup\", \"anonymous\": false}   // no keys provided\n// after\n{\"location\": \"s3://bucket/backup\", \"accessKey\": \"AKIA...\", \"secretKey\": \"...\"}","handlingStrategy":"validation","validationCode":"// Confirm scheme and credentials pair before restore\n// s3/minio require AccessKey+SecretKey; public buckets can set Anonymous\nif strings.HasPrefix(loc, \"s3://\") && accessKey == \"\" && !anonymous {\n    return errors.New(\"s3 restore requires accessKey/secretKey or anonymous=true\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass AccessKey/SecretKey/SessionToken in the restore request for s3/minio.","Use only supported schemes: s3, minio, gcs, azure, or plain filesystem paths.","Don't mix Anonymous:true with credentials.","Verify handler/enterprise support for the scheme on your Dgraph build."],"tags":["dgraph","restore","s3","credentials","storage-handler"],"backgroundTag":"unsupported-storage-scheme","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}