dutchcoders/transfer.sh · error
storj-bucket not set.
Error message
storj-bucket not set.
What it means
Thrown by the transfer.sh CLI when --provider storj is selected and --storj-access is present but --storj-bucket is empty. The bucket names the Storj destination for uploads; without it the storage backend has no target, so startup fails during the ordered flag validation before NewStorjStorage is called.
Source
Thrown at cmd/cmd.go:516
case "gdrive":
chunkSize := c.Int("gdrive-chunk-size") * 1024 * 1024
if clientJSONFilepath := c.String("gdrive-client-json-filepath"); clientJSONFilepath == "" {
return errors.New("gdrive-client-json-filepath not set.")
} else if localConfigPath := c.String("gdrive-local-config-path"); localConfigPath == "" {
return errors.New("gdrive-local-config-path not set.")
} else if basedir := c.String("basedir"); basedir == "" {
return errors.New("basedir not set.")
} else if store, err := storage.NewGDriveStorage(c.Context, clientJSONFilepath, localConfigPath, basedir, chunkSize, logger); err != nil {
return err
} else {
options = append(options, server.UseStorage(store))
}
case "storj":
if access := c.String("storj-access"); access == "" {
return errors.New("storj-access not set.")
} else if bucket := c.String("storj-bucket"); bucket == "" {
return errors.New("storj-bucket not set.")
} else if store, err := storage.NewStorjStorage(c.Context, access, bucket, purgeDays, logger); err != nil {
return err
} else {
options = append(options, server.UseStorage(store))
}
case "local":
if v := c.String("basedir"); v == "" {
return errors.New("basedir not set.")
} else if store, err := storage.NewLocalStorage(v, logger); err != nil {
return err
} else {
options = append(options, server.UseStorage(store))
}
default:
return errors.New("Provider not set or invalid.")
}
srvr, err := server.New(View on GitHub (pinned to c37bfd9579)
Solutions
- Add --storj-bucket <name> to the command line
- Create the bucket in Storj first (uplink mb or Satellite UI) so the next step — NewStorjStorage — succeeds
- Verify the access grant has permission scope over the named bucket
Example fix
// before transfer.sh --provider storj --storj-access "$STORJ_ACCESS" // after transfer.sh --provider storj --storj-access "$STORJ_ACCESS" --storj-bucket uploads
Defensive patterns
Strategy: validation
Validate before calling
: "${STORJ_BUCKET:?storj bucket required}"
args+=(--storj-bucket "$STORJ_BUCKET") Try / catch
if err := cmd.Root.Execute(); err != nil {
if strings.Contains(err.Error(), "storj-bucket not set") {
log.Fatalf("storj provider requires --storj-bucket")
}
os.Exit(1)
} Prevention
- Create the bucket (uplink mb) before first launch
- Parameterize bucket name per environment with fail-fast env var checks
- Confirm the access grant scope covers the bucket
When it happens
Trigger: Running with --provider storj --storj-access X but no --storj-bucket, or a bucket interpolated from an unset/empty variable.
Common situations: Access grant configured but the bucket never created/named in the deployment config; per-environment bucket names where the staging value is missing; copying examples that only demonstrate the access flag.
Understand the failure class
Background: "--flag is required" and "must specify" CLI errors: how missing-required-flag validation works and how to fix it — this error's family across 20 libraries.
Related errors
AI-assisted analysis of dutchcoders/transfer.sh@c37bfd9579 (2026-09-05).
Data as JSON: /api/errors/0d58dad4a171fcb6.
Report an issue: GitHub.