The v1.1.2 of the gateway does not start on QNAP NAS

The v1.1.2 of the gateway does not start on QNAP NAS. No Setup prompt is display.
Just

The Storj client-side S3 gateway

Usage:
/app/gateway [command]

Available Commands:
help Help about any command
run Run the S3 gateway
setup Create a gateway config file
version output the version’s build information, if any

Flags:
–advanced if used in with -h, print advanced flags help
–config-dir string main directory for gateway configuration (default “/root/.local/share/storj/gateway”)
-h, --help help for /app/gateway

Use “/app/gateway [command] --help” for more information about a command.

What command did you use to start it?

As it stated in the documentation expect the version string instead 1.0.4 I used 1.1.2

Please, try this one:

docker run -d --restart unless-stopped -p 0.0.0.0:7777:7777 --mount type=bind,source=/path/to/gateway-config-dir/,destination=/root/.local/share/storj/gateway/ --name gateway storjlabs/gateway:a53b280-v1.1.2-go1.13.8 run --server.address=":7777"

@Alexey

It does not run in gneral due to the doubled --d command plases change ot to -d

This command only works if a config from version 1.0.4 was generated.
When I use this command from the scratch it does not start up due to missing config

Thanks, fixed a typo.
Yes, you can generate it as well

docker run -it --rm --mount type=bind,source=/path/to/gateway-config-dir/,destination=/root/.local/share/storj/gateway/ storjlabs/gateway:a53b280-v1.1.2-go1.13.8 setup --server.address=":7777"

The config.yaml will be generated in the /path/to/gateway-config-dir/
You also can generate the config using an access grant from the uplink.

docker run -it --rm --mount type=bind,source=/path/to/gateway-config-dir/,destination=/root/.local/share/storj/gateway/ storjlabs/gateway:a53b280-v1.1.2-go1.13.8 setup --server.address=":7777" --access 12Df...... --non-interactive

You should specify the right serialized access grant string with the --access option.

1 Like

What does it mean access grant ? Is there a possibility to configure the gateway via docker commands and specify Access Is and API key via command line ?

The Access grant is a serialized access to the bucket, it contains satellite, API key and encryption key derived from your encryption phrase.
You can precise configure how someone could access any object.
For example, to receive an access grant for the object document.docx with prefix documents/ and bucket sj://test you can specify like this:

uplink share sj://test/documents/document.docx --readonly --not-before +2h

It will give you a serialized access grant and the direct link to use in the browser.
The same way you can configure an access grant for the exact bucket or even entire project.

Then you can use it to configure the S3 Gateway. And it will be able to use only this bucket and only with a given rights.

You can see other commands with

uplink share --help
2 Likes

@Alexey Ok thanks. However the version v1.1.2 does not correct start up on QNAP NAS

Please, show the error

It’s because they have different entrypoint scripts.

v1.0.4

#!/bin/sh
set -euo pipefail

if [[ ! -f "${CONF_PATH}/config.yaml" ]]; then
        ./gateway setup --config-dir "${CONF_PATH}"
fi

RUN_PARAMS="${RUN_PARAMS:-} --config-dir ${CONF_PATH}"

exec ./gateway run $RUN_PARAMS "$@"

So it detects whether there is a config and if not runs setup. Otherwise starts the gateway. You can use environment variable CONF_PATH to write config to another path (inside the container), so you don’t have to use the long default path.

v1.1.2

#!/bin/sh
set -euo pipefail

exec ./gateway $@

Basically just runs the gateway.

@jensamberg: You can still manually run setup from the docker run command to create the config file though, like Alexey posted previously.

I bring it not up on QNAP with version 1.1.2. After configuration i see in the logs

  • See https://documentation.tardigrade.io/api-reference/s3-gateway for some example commands
    2020-06-01T06:49:57.943Z INFO Configuration loaded {“Location”: “/root/.local/share/storj/gateway/config.yaml”}
    2020-06-01T06:49:57.944Z INFO Invalid configuration file key {“Key”: “legacy.client.api-key”}
    Error: gateway setup error: gateway configuration already exists (/root/.local/share/storj/gateway)
    2020-06-01T06:50:00.969Z INFO Configuration loaded {“Location”: “/root/.local/share/storj/gateway/config.yaml”}
    2020-06-01T06:50:00.970Z INFO Invalid configuration file key {“Key”: “legacy.client.api-key”}
    Error: gateway setup error: gateway configuration already exists (/root/.local/share/storj/gateway)
    2020-06-01T06:50:04.040Z INFO Configuration loaded {“Location”: “/root/.local/share/storj/gateway/config.yaml”}
    2020-06-01T06:50:04.040Z INFO Invalid configuration file key {“Key”: “legacy.client.api-key”}
    Error: gateway setup error: gateway configuration already exists (/root/.local/share/storj/gateway)
    2020-06-01T06:50:07.640Z INFO Configuration loaded {“Location”: “/root/.local/share/storj/gateway/config.yaml”}
    2020-06-01T06:50:07.640Z INFO Invalid configuration file key {“Key”: “legacy.client.api-key”}
    Error: gateway setup error: gateway configuration already exists (/root/.local/share/storj/gateway)
    2020-06-01T06:50:10.918Z INFO Configuration loaded {“Location”: “/root/.local/share/storj/gateway/config.yaml”}
    2020-06-01T06:50:10.918Z INFO Invalid configuration file key {“Key”: “legacy.client.api-key”}
    Error: gateway setup error: gateway configuration already exists (/root/.local/share/storj/gateway)
    2020-06-01T06:50:16.275Z INFO Configuration loaded {“Location”: “/root/.local/share/storj/gateway/config.yaml”}
    2020-06-01T06:50:16.276Z INFO Invalid configuration file key {“Key”: “legacy.client.api-key”}
    Error: gateway setup error: gateway configuration already exists (/root/.local/share/storj/gateway)

Ok I found the new commands. After setup I have to change “setup” to “run”

docker run -d --restart unless-stopped -p 0.0.0.0:7777:7777 --mount type=bind,source=/share/dockerdata/storj/gateway/,destination=/root/.local/share/storj/gateway/ --name=gateway -it storjlabs/gateway:a53b280-v1.1.2-go1.13.8 run --server.address=":7777"

However after the gateway is runnning and lso working I still have some strange messages

API: SYSTEM()
Time: 06:53:24 UTC 06/01/2020
DeploymentID: f2acfe19-0fc2-4264-a4fc-f28be6ecf0a5
Error: Server not initialized, please try again
       3: /go/pkg/mod/github.com/minio/minio@v0.0.0-20200428222040-c3c3e9087bc1/cmd/iam.go:1732:cmd.(*IAMSys).IsAllowed()
       2: /go/pkg/mod/github.com/minio/minio@v0.0.0-20200428222040-c3c3e9087bc1/cmd/bucket-handlers.go:311:cmd.objectAPIHandlers.ListBucketsHandler()
       1: net/http/server.go:2007:http.HandlerFunc.ServeHTTP()