{"record":{"id":"b946595e1eaf5ad9","repo":"dutchcoders/transfer.sh","slug":"gdrive-client-json-filepath-not-set","errorCode":null,"errorMessage":"gdrive-client-json-filepath not set.","messagePattern":"gdrive-client-json-filepath not set\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cmd.go","lineNumber":502,"sourceCode":"\n\t\tswitch provider := c.String(\"provider\"); provider {\n\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))","sourceCodeStart":484,"sourceCodeEnd":520,"githubUrl":"https://github.com/dutchcoders/transfer.sh/blob/c37bfd95797fd6da8a6da53fc13d191994b3f687/cmd/cmd.go#L484-L520","documentation":"Thrown by the transfer.sh CLI when --provider gdrive is selected but --gdrive-client-json-filepath is empty. Google Drive storage is initialized from an OAuth client credentials JSON file, and this flag tells the CLI where that file lives; without it NewGDriveStorage cannot be configured, so startup fails fast.","triggerScenarios":"Running with --provider gdrive and no --gdrive-client-json-filepath — path never provided, env interpolation empty, or the credentials file not mounted into the container.","commonSituations":"First-time gdrive setup where the OAuth client JSON was downloaded but never wired into the flags; container images that omitted the credentials mount at /secrets; docs/config drift after migrating from local to containerized deployment.","solutions":["Provide --gdrive-client-json-filepath /path/to/client_secret.json pointing at your Google OAuth client credentials","Verify the file actually exists at that path and is readable by the process user","Remember the follow-up required flags: --gdrive-local-config-path and --basedir are validated next","Mount the JSON into the container and pass the in-container path, not the host path"],"exampleFix":"// before\ntransfer.sh --provider gdrive --gdrive-local-config-path /config/token.json --basedir /data\n// after\ntransfer.sh --provider gdrive --gdrive-client-json-filepath /secrets/client_secret.json --gdrive-local-config-path /config/token.json --basedir /data","handlingStrategy":"validation","validationCode":"CLIENT_JSON=/secrets/client_secret.json\nif [ ! -r \"$CLIENT_JSON\" ]; then echo \"missing $CLIENT_JSON\" >&2; exit 1; fi\nargs+=(--gdrive-client-json-filepath \"$CLIENT_JSON\")","typeGuard":null,"tryCatchPattern":"if err := cmd.Root.Execute(); err != nil {\n  if strings.Contains(err.Error(), \"gdrive-client-json-filepath not set\") {\n    log.Fatalf(\"gdrive provider requires --gdrive-client-json-filepath\")\n  }\n  os.Exit(1)\n}","preventionTips":["Mount the OAuth client JSON into the container and pass the in-container path","Validate the file exists and is readable in the startup script before launch","Set all three gdrive flags (client json, local config path, basedir) together"],"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"}