Cannot create a bucket

All I get in response to the ‘mb’ command is: Error: api key format error: invalid api key format

Make sure you copied the whole key with no trailing or leading spaces.

1 Like

I assumed everything was OK during the setup phase as I got the following: Your Uplink CLI is configured and ready to use!

You can try to check it

uplink access inspect

It should print out the satellite, API key and Encryption Access hash
Compare the API key there with copied API key, they should match. If you do not have a copy of API key, then you can create a new one and try to configure again.

Thanks Alexey,
I downloaded uplink again and set it up with a new API … same result. If I try to get help on Uplink commands eg. Mb, I get ‘command not found’ I am an amateur using Terminal though I have been using Macs for > 25 years.

Have you downloaded it via command line?

curl -L https://github.com/storj/storj/releases/latest/download/uplink_darwin_amd64.zip -o uplink_darwin_amd64.zip
unzip -o uplink_darwin_amd64.zip
chmod 755 uplink
sudo mv uplink /usr/local/bin/uplink

It’s possible the the uplink executable wasn’t moved to /usr/local/bin/uplink

Yes, I have downloaded it via the command line and yes the executable is in the right place. Thanks for the help.

The problem is a bug with uplink CLI’s config handling. If the “access” name chosen/set includes an uppercase letter, it will instead try to interpret this as a serialized access string to parse.

When running uplink setup, be sure to use an all lowercase access name when prompted. Alternatively, you can just leave the prompt blank and press return to accept default.

If you’d like to see what’s happening, you can view and edit the configuration file. On macOS, this is located at /Users/<your_username>/Library/Application Support/Storj/Uplink/config.yaml.

That first access line specifies the default “access” that uplink will use, and is where the problem begins. If this value contains any uppercase letters, it will be erroneously interpreted as a serialized access instead of being used as an access configuration name to derive a correct value from. You can safely delete this config file and re-run uplink setup or manually correct the default access name and begin issuing your commands.

FYI, you can also simply specify the access name to use along with a command:

uplink mb sj://ozy --access ozymandiaz

Note how I’ve used all lowercase letters, regardless of how you might have setup uplink initially. Using uppercase letters here will result in the same error described above. You can uplink import additional accesses to be used here. And just like in the configuration file, you can also simply pass a serialized access here directly on the command line. This option is useful for working with various buckets and objects that may exist under different accesses (i.e. API and encryption keys).

Find more information about any command by following this example:

uplink import -h

Use the following for reference of the bug described.

Correct configuration examples:
access: default
accesses.default: <serialized access string>

OR

access: ozy
accesses.ozy: <serialized access string>

OR SIMPLY

access: <serialized access string>

Currently incorrect configuration examples:
access: Ozymandiaz
accesses.Ozymandiaz: <serialized access string>

AND

access: Ozy
accesses.ozy: <serialized access string>

Thanks Teel; you’ve solved my ‘Invalid API’ issue with the lowercase fix. Now I’m left with trying to create a bucket ( the Uplink executable is in the right folder ) and I get “zsh: command not found: mb”

You’re issuing

uplink mb sj://bucket_name

and receiving that error?

Today in retrying everything, the “invalid api key format” has returned even after I’ve selected “default” as my access name and, yes, I have been entering “uplink mb sj://bucket_name”bin_—-zsh—_190×49

Your initial reported error of “zsh: command not found: mb” would seem to indicate that you forgot to specify the uplink program first before the make bucket (i.e. mb) command. I see that you’ve invoked the program and command correctly with your latest attempts, however.

As for your latest invalid API key errors, I suspect your config file is still referencing the prior access name chosen. You can try uplink mb sj://electronics --access default

Like I wrote above, you should inspect the config file to understand what’s happening. It’s located at /Users/ <your_username> /Library/Application Support/Storj/Uplink/config.yaml

2 Likes