dutchcoders/transfer.sh · error
storj-access not set.
Error message
storj-access not set.
What it means
Thrown by the transfer.sh CLI when --provider storj is selected but --storj-access is empty. Storj storage authenticates via an access grant (serialized access credential), and this flag supplies it; without it NewStorjStorage has no credentials, so the CLI aborts startup validation before contacting the network.
Source
Thrown at cmd/cmd.go:514
options = append(options, server.UseStorage(store))
}
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.")
}View on GitHub (pinned to c37bfd9579)
Solutions
- Generate an access grant in Storj (Satellite UI or uplink) and pass it with --storj-access <grant>
- Also provide --storj-bucket, which is validated next and will fail with its own error
- Check shell quoting/length limits — access grants are long strings that can be truncated or mangled in some config systems
- Inject the grant from a secret manager into the process arguments rather than hardcoding it
Example fix
// before transfer.sh --provider storj --storj-bucket uploads // after transfer.sh --provider storj --storj-access "$STORJ_ACCESS_GRANT" --storj-bucket uploads
Defensive patterns
Strategy: validation
Validate before calling
: "${STORJ_ACCESS:?storj access grant required}"
args+=(--storj-access "$STORJ_ACCESS") Try / catch
if err := cmd.Root.Execute(); err != nil {
if strings.Contains(err.Error(), "storj-access not set") {
log.Fatalf("storj provider requires --storj-access")
}
os.Exit(1)
} Prevention
- Generate the access grant before deploying and store it in a secret manager
- Beware of length/quoting issues when embedding the long grant string in configs
- Set --storj-access and --storj-bucket together
When it happens
Trigger: Running with --provider storj and no --storj-access — access grant never generated/pasted, env interpolation empty, or the grant stored in a secret that was not injected into the flags.
Common situations: Setting up Storj for the first time before creating an access grant in the Satellite UI; rotating grants where the new grant was not updated in the service config; container deployments where the access grant env var is missing from the pod spec.
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/b6c3fa1cd34168f8.
Report an issue: GitHub.