{"record":{"id":"248bf487c4b202cb","repo":"dutchcoders/transfer.sh","slug":"gdrive-local-config-path-not-set","errorCode":null,"errorMessage":"gdrive-local-config-path not set.","messagePattern":"gdrive-local-config-path not set\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cmd.go","lineNumber":504,"sourceCode":"\t\tcase \"s3\":\n\t\t\tif accessKey := c.String(\"aws-access-key\"); accessKey == \"\" {\n\t\t\t\treturn errors.New(\"access-key not set.\")\n\t\t\t} else if secretKey := c.String(\"aws-secret-key\"); secretKey == \"\" {\n\t\t\t\treturn errors.New(\"secret-key not set.\")\n\t\t\t} else if bucket := c.String(\"bucket\"); bucket == \"\" {\n\t\t\t\treturn errors.New(\"bucket not set.\")\n\t\t\t} else if store, err := storage.NewS3Storage(c.Context, accessKey, secretKey, bucket, purgeDays, c.String(\"s3-region\"), c.String(\"s3-endpoint\"), c.Bool(\"s3-no-multipart\"), c.Bool(\"s3-path-style\"), logger); err != nil {\n\t\t\t\treturn err\n\t\t\t} else {\n\t\t\t\toptions = append(options, server.UseStorage(store))\n\t\t\t}\n\t\tcase \"gdrive\":\n\t\t\tchunkSize := c.Int(\"gdrive-chunk-size\") * 1024 * 1024\n\n\t\t\tif clientJSONFilepath := c.String(\"gdrive-client-json-filepath\"); clientJSONFilepath == \"\" {\n\t\t\t\treturn errors.New(\"gdrive-client-json-filepath not set.\")\n\t\t\t} else if localConfigPath := c.String(\"gdrive-local-config-path\"); localConfigPath == \"\" {\n\t\t\t\treturn errors.New(\"gdrive-local-config-path not set.\")\n\t\t\t} else if basedir := c.String(\"basedir\"); basedir == \"\" {\n\t\t\t\treturn errors.New(\"basedir not set.\")\n\t\t\t} else if store, err := storage.NewGDriveStorage(c.Context, clientJSONFilepath, localConfigPath, basedir, chunkSize, logger); err != nil {\n\t\t\t\treturn err\n\t\t\t} else {\n\t\t\t\toptions = append(options, server.UseStorage(store))\n\t\t\t}\n\t\tcase \"storj\":\n\t\t\tif access := c.String(\"storj-access\"); access == \"\" {\n\t\t\t\treturn errors.New(\"storj-access not set.\")\n\t\t\t} else if bucket := c.String(\"storj-bucket\"); bucket == \"\" {\n\t\t\t\treturn errors.New(\"storj-bucket not set.\")\n\t\t\t} else if store, err := storage.NewStorjStorage(c.Context, access, bucket, purgeDays, logger); err != nil {\n\t\t\t\treturn err\n\t\t\t} else {\n\t\t\t\toptions = append(options, server.UseStorage(store))\n\t\t\t}\n\t\tcase \"local\":","sourceCodeStart":486,"sourceCodeEnd":522,"githubUrl":"https://github.com/dutchcoders/transfer.sh/blob/c37bfd95797fd6da8a6da53fc13d191994b3f687/cmd/cmd.go#L486-L522","documentation":"Thrown by the transfer.sh CLI when --provider gdrive is chosen and --gdrive-client-json-filepath is set but --gdrive-local-config-path is empty. This flag points at the local file where the OAuth token/session state is cached between runs; without it the gdrive storage backend cannot persist authorization, so the CLI stops during startup validation.","triggerScenarios":"Running with --provider gdrive --gdrive-client-json-filepath X but no --gdrive-local-config-path; or the path interpolated to an empty string from an unset variable.","commonSituations":"Read-only container filesystems where operators deliberately dropped the token-cache path instead of configuring a writable one; migrating deployments where the token file location changed; copying the client-json flag from docs but skipping the rest of the gdrive example.","solutions":["Add --gdrive-local-config-path /writable/dir/token.json pointing at a writable location","Ensure the directory exists and the process user can write to it (needed to cache the OAuth token)","Also set --basedir, which is validated next and will fail with its own error","If running in a container, mount a writable volume for the token cache"],"exampleFix":"// before\ntransfer.sh --provider gdrive --gdrive-client-json-filepath /secrets/client_secret.json\n// after\ntransfer.sh --provider gdrive --gdrive-client-json-filepath /secrets/client_secret.json --gdrive-local-config-path /data/gdrive-token.json --basedir /data","handlingStrategy":"validation","validationCode":"TOKEN_PATH=/data/gdrive-token.json\nmkdir -p \"$(dirname \"$TOKEN_PATH\")\" && touch \"$TOKEN_PATH\" \\\n  || { echo \"token path not writable\" >&2; exit 1; }\nargs+=(--gdrive-local-config-path \"$TOKEN_PATH\")","typeGuard":null,"tryCatchPattern":"if err := cmd.Root.Execute(); err != nil {\n  if strings.Contains(err.Error(), \"gdrive-local-config-path not set\") {\n    log.Fatalf(\"gdrive provider requires --gdrive-local-config-path\")\n  }\n  os.Exit(1)\n}","preventionTips":["Point the token path at a writable volume, never a read-only layer","Pre-create the parent directory with correct ownership","Keep gdrive flags grouped in one template to avoid dropping one"],"tags":["cli","configuration","gdrive","google-drive","oauth","startup-validation"],"backgroundTag":"missing-required-flag","analyzedSha":"c37bfd95797fd6da8a6da53fc13d191994b3f687","analyzedAt":"2026-09-05T10:21:07.548Z","contentChangedAt":"2026-09-05T10:21:07.548Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}