Backblaze / B2_Command_Line_Tool

The command-line tool that gives easy access to all of the capabilities of B2 Cloud Storage
Other
530 stars 120 forks source link

s3endpoint in `b2 account get` sometimes returns an empty value #1037

Closed cdhowie closed 1 hour ago

cdhowie commented 2 weeks ago

Attempting to obtain all of the information required to use an S3-compatible client with B2 is a needlessly convoluted and frustrating process. There does not appear to be any way to obtain the S3 endpoint or account region using the CLI tool, requiring one to log into the B2 web UI to get this information.

I see #912 but this doesn't seem to provide useful information, at least for our account:

$ b2 account get
{
    ...
    "s3endpoint": ""
}

Neither does there seem to be a way to obtain the account region, which is a required field for some S3-compatible clients.

mjurbanski-reef commented 2 weeks ago

It should be possible through this method, and I have yet to reproduce the "s3endpoint" being empty.

Can you confirm the empty string is returned for an account that does indeed have at least one bucket attached to it? And in that account you can access the S3 access info through web UI as you indicated?

cdhowie commented 2 weeks ago

Yes, we have many buckets and are already using the S3-compatible API in multiple services.

ppolewicz commented 2 weeks ago

Please make sure you are using the newest version of the CLI. Then, please run b2 account authorize - if you have authorized a long, long time ago, your local db might not have the information written down. If that fails, please run b2 account authorize --verbose, strip the secret information and show us the logs so that we can try to help you out.

cdhowie commented 3 hours ago

Re-authorizing does populate this field. It seems there should be some kind of indication in the b2 account get output that this may be needed if the last authorization was performed with a too-old version to have fields that were added in newer versions.

mjurbanski-reef commented 1 hour ago

Happy the issue got resolved.

AFAIK only way to encounter this problem now is by using a year old version of b2 to authorize. That would also mean that no matter what kind of life-improvement fix we include in new b2 version, a person using old b2 tool would not see it anyhow.

Though thanks to you creating this issue, the person encountering this problem should have a much easier time finding a solution (which is to update&authorize again).

Lets revisit the problem if we get more reports about this consuming too much time to debug despite this information being here.