Known bug - Unauthorized API credentials

Continuing the discussion from Object storage provider for Mastodon instance:

Before setting up the object storage for a Mastodon instance, I even cannot get Gateway work right.

I tried aws s3 --endpoint=http://localhost:7777/ cp ~/.bashrc s3://temp.dev/ and got the error below:

Feb 15 21:08:59 ik1-432-48064 gateway[5561]: 2021-02-15T21:08:59.220+0900        ERROR        gateway error:        {"error": "uplink: metainfo error: Unauthorized API credentials", "errorVerbose": "uplink: metainfo error: Unauthorized API credentials\n\tstorj.io/uplink/private/metainfo.(*Client).Batch:1181\n\tstorj.io/uplink/private/storage/streams.(*streamStore).Put:256\n\tstorj.io/uplink/private/storage/streams.(*shimStore).Put:53\n\tstorj.io/uplink/private/stream.NewUpload.func1:48\n\tgolang.org/x/sync/errgroup.(*Group).Go.func1:57"}
Feb 15 21:08:59 ik1-432-48064 gateway[5561]: API: PutObject(bucket=temp.dev, object=.bashrc)
Feb 15 21:08:59 ik1-432-48064 gateway[5561]: Time: 21:08:59 JST 02/15/2021
Feb 15 21:08:59 ik1-432-48064 gateway[5561]: DeploymentID: 92fc816d-773d-4101-9299-c150eb8629bb
Feb 15 21:08:59 ik1-432-48064 gateway[5561]: RequestID: 1663EA82CD6F39DF
Feb 15 21:08:59 ik1-432-48064 gateway[5561]: RemoteHost: 127.0.0.1
Feb 15 21:08:59 ik1-432-48064 gateway[5561]: Host: localhost:7777
Feb 15 21:08:59 ik1-432-48064 gateway[5561]: UserAgent: aws-cli/1.19.7 Python/2.7.16 Linux/4.19.0-13-amd64 botocore/1.20.7
Feb 15 21:08:59 ik1-432-48064 gateway[5561]: Error: uplink: metainfo error: Unauthorized API credentials (*errs.errorT)

The access information is:

=========== ACCESS RESTRICTIONS ==========================================================
Download  : Allowed
Upload    : Allowed
Lists     : Allowed
Deletes   : Allowed
NotBefore : No restriction
NotAfter  : No restriction
Paths     : sj://temp.dev/ (entire bucket)
=========== SERIALIZED ACCESS WITH THE ABOVE RESTRICTIONS TO SHARE WITH OTHERS ===========
Access    : 12RNZJeXeP...

Imported 12RNZJeXeP... with $ gateway setup --access 12RNZJeXeP... --non-interactive.

Used aws-cli/1.19.7 Python/2.7.16 Linux/4.19.0-13-amd64 botocore/1.20.7.

Updating Setting Up a Self-Hosted S3 Compatible Gateway - Storj Docs is necessary for sure. The word API should be removed altogether so there is not a chance of confusion.

Or do you need to import the Access Grant generated on the dashboard instead? I am not sure what to import and how it should be imported correctly.


I removed the existing configuration file for uplink and followed:

to configure the uplink, still it does not work due to uplink: permission denied (bucket: metainfo error: Unauthorized API credentials).

What does this mean?

You can safely close / lock this thread.

It was found out that this issue was because of a known bug. cf: Uplink set up: Unauthorized API credentials

After creating an Access Grant on a new Firefox profile the issue is no longer reproduced.

Yes the browser cache can introduce some errors (for example - create an access grant limited to only one bucket or with impossible timespan like --not-before 2021-02-15T00:00:00Z and --not-after 2021-02-15T00:00:00Z in the same time).
However, the uplink share command should generate an access grant in a normal format.
Just need to remove the previous config of the gateway to setup it again.