Skip to content

Incorrect error message downloading blob with leading / and CDA_API_KEY set #195

@DanielTOsborne

Description

@DanielTOsborne

CLI Script

blob

Describe the bug

If a BLOB/CLOB name has a leading /, it tries to download to root, and reports an error.
The fact it errors out is fine, but the message it reports is wrong.

It took me a while to realize the "permission denied" error message was referring to the actual destination filesystem.
The "Access scope hint" is a red herring, and unrelated to the real problem.

$ cwms-cli clob download --clob-id "/REPORTS/RELEASE/REL-BLB"
2026-04-09 18:27:02;INFO;logger configured
2026-04-09 18:27:04;ERROR;Failed to download: [Errno 13] Permission denied: '/REPORTS'
2026-04-09 18:27:04;WARNING;Access scope hint: a key was sent for this download request in office SPK. If you need to view clob content outside that key's access scope, retry with --anonymous or remove the configured API key. Docs: https://cwms-cli.readthedocs.io/en/latest/cli/blob.html#blob-auth-scope

Suggestion would be to either allow downloading to the current directory (as if there wasn't a leading /), or report a warning that it will attempt to write to the root filesystem.
In fact, this is dangerous and should be changed so it never tries to write to root (/). If cwms-cli were run as root user, it could be devastating.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghigh

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions