# Regarding GatewayST Setup

**URL:** <https://forum.storj.io/t/regarding-gatewayst-setup/21572>\
**Category:** troubleshooting\
**Tags:** s3-gateway\
**Created:** [February 25, 2023, 1:37am UTC](https://forum.storj.io/t/regarding-gatewayst-setup/21572 "2023-02-25T01:37:57Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![mitexleo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/mitexleo/32/1132_2.png) [@mitexleo](https://forum.storj.io/u/mitexleo)\
**Post date:** [February 25, 2023, 10:45am UTC](https://forum.storj.io/t/regarding-gatewayst-setup/21572/21 "2023-02-25T10:45:12Z")

</div>

Is there anything else I should look at ?

---

<div class="post-metadata">

**Author:** ![mitexleo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/mitexleo/32/1132_2.png) [@mitexleo](https://forum.storj.io/u/mitexleo)\
**Post date:** [February 25, 2023, 10:49am UTC](https://forum.storj.io/t/regarding-gatewayst-setup/21572/22 "2023-02-25T10:49:29Z")

</div>

It works only if I run as root. Im actually runnning gateway as root on my previous server too ! But i dont see any error message like this one.

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [February 26, 2023, 3:43am UTC](https://forum.storj.io/t/regarding-gatewayst-setup/21572/23 "2023-02-26T03:43:53Z")

</div>

I think the reason is not applying variables during cronjob executing.  
You can fix it this way: [linux - Where can I set environment variables that crontab will use? - Stack Overflow](https://stackoverflow.com/a/13579786), or provide the path to the `config.yaml` with option `--config-dir`, i.e.

```auto
gateway run --config-dir=/home/USER/.local/share/storj/gateway

```

please note - you need to provide an absolute path, not relative.

---

<div class="post-metadata">

**Author:** ![mitexleo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/mitexleo/32/1132_2.png) [@mitexleo](https://forum.storj.io/u/mitexleo)\
**Post date:** [March 3, 2023, 3:02am UTC](https://forum.storj.io/t/regarding-gatewayst-setup/21572/24 "2023-03-03T03:02:45Z")

</div>

Okay … Just done setting up on my new server. But everything seems same !

I forgot to mention one thing.

If Run `gateway run` everything looks perfect.  
But the problem only occurs when I run it as a systemd service. This is weird 😕…

``  
[Unit]

Description=Gateway ST

After=syslog.target

[Service]

ExecStart=/usr/local/bin/gateway run --access Aj… --website

Restart=on-failure

#User=root

[Install]

WantedBy=multi-user.target

``

I’m using same config for another server. Which is working fine.

---

<div class="post-metadata">

**Author:** ![mitexleo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/mitexleo/32/1132_2.png) [@mitexleo](https://forum.storj.io/u/mitexleo)\
**Post date:** [March 3, 2023, 3:05am UTC](https://forum.storj.io/t/regarding-gatewayst-setup/21572/25 "2023-03-03T03:05:35Z")

</div>

By the way, I did setup Gateway on that server as root.

---

<div class="post-metadata">

**Author:** ![mitexleo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/mitexleo/32/1132_2.png) [@mitexleo](https://forum.storj.io/u/mitexleo)\
**Post date:** [March 3, 2023, 3:16am UTC](https://forum.storj.io/t/regarding-gatewayst-setup/21572/26 "2023-03-03T03:16:04Z")

</div>

If I obtain the credentials by running `gateway run` … then use those leaving the systemd service as is. Will it work ?

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [March 3, 2023, 4:31am UTC](https://forum.storj.io/t/regarding-gatewayst-setup/21572/27 "2023-03-03T04:31:03Z")

</div>

> [@mitexleo](#):
>
> gateway run --access Aj…

This way it doesn’t work, you can skip the `--access` option and provide the path to the `config.yaml` instead with the option `--config-dir`, the path must be an absolute, and the user running this service should have an access to this path and `config.yaml` in particular.

---

<div class="post-metadata">

**Author:** ![mitexleo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/mitexleo/32/1132_2.png) [@mitexleo](https://forum.storj.io/u/mitexleo)\
**Post date:** [March 3, 2023, 8:46am UTC](https://forum.storj.io/t/regarding-gatewayst-setup/21572/28 "2023-03-03T08:46:58Z")

</div>

Tried and got this …

Error: gateway configuration: failed parsing access config: uplink: invalid access grant format

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [March 3, 2023, 8:55am UTC](https://forum.storj.io/t/regarding-gatewayst-setup/21572/29 "2023-03-03T08:55:54Z")

</div>

Seems you placed an API Key instead of access grant, or did not specify it at all in the provided `config.yaml` (or maybe your user cannot access it or path is wrong).  
If you want to generate an access grant locally, not in web UI, you may to do so, but need to run `gateway setup` first and follow the CLI wizard. For the root user you need to run it with `sudo`, i.e. `sudo gateway setup`

---

<div class="post-metadata">

**Author:** ![mitexleo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/mitexleo/32/1132_2.png) [@mitexleo](https://forum.storj.io/u/mitexleo)\
**Post date:** [March 3, 2023, 9:21am UTC](https://forum.storj.io/t/regarding-gatewayst-setup/21572/30 "2023-03-03T09:21:50Z")

</div>

If wanna run the setup again. How can I remove the config ? Is it enough to remove the config.yaml ?

---

<div class="post-metadata">

**Author:** ![mitexleo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/mitexleo/32/1132_2.png) [@mitexleo](https://forum.storj.io/u/mitexleo)\
**Post date:** [March 3, 2023, 8:18pm UTC](https://forum.storj.io/t/regarding-gatewayst-setup/21572/33 "2023-03-03T20:18:10Z")

</div>

I’ve generated a new access grant from Sattelite and used that to setup again … But its same… I dunno How I should try ! I even tried to setup with GatewayMT. That is also not working.

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [March 4, 2023, 1:27am UTC](https://forum.storj.io/t/regarding-gatewayst-setup/21572/34 "2023-03-04T01:27:00Z")

</div>

Could you please show your current run command?  
And does it work, if you run it manually?

Also just commenting out of `User` clause does not change anything - it will try to execute as root. If you want to use a specific user, you must provide it and its group, see example: [How to run systemd service as specific user and group in Linux | GoLinuxCloud](https://www.golinuxcloud.com/run-systemd-service-specific-user-group-linux/)

---

<div class="post-metadata">

**Author:** ![mitexleo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/mitexleo/32/1132_2.png) [@mitexleo](https://forum.storj.io/u/mitexleo)\
**Post date:** [March 4, 2023, 1:55am UTC](https://forum.storj.io/t/regarding-gatewayst-setup/21572/35 "2023-03-04T01:55:35Z")

</div>

Thanks for the article…  
Everything is working fine now…

Here’s my systemd service file in case anyone need:

```auto
[Unit]
Description=Gateway ST
After=network.target
[Service]
User=ubuntu
Group=ubuntu
ExecStart=/usr/local/bin/gateway run --access 1jAfVgQBb5.... --website
Restart=on-failure
#User=root
[Install]
WantedBy=multi-user.target

```

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [March 4, 2023, 2:34am UTC](https://forum.storj.io/t/regarding-gatewayst-setup/21572/36 "2023-03-04T02:34:38Z")

</div>

By the way, you still uses an `--access` option instead of `--config-dir`, the current version of GatewayST ignores it with the `run` command, and uses their default config instead.  
But if this service is working even when you did not specify a path to the config file, probably it applying variables and know the default path. In this case your run command can look like

```auto
ExecStart=/usr/local/bin/gateway run --website

```

---

<div class="post-metadata">

**Author:** ![mitexleo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/mitexleo/32/1132_2.png) [@mitexleo](https://forum.storj.io/u/mitexleo)\
**Post date:** [March 4, 2023, 2:48am UTC](https://forum.storj.io/t/regarding-gatewayst-setup/21572/37 "2023-03-04T02:48:40Z")

</div>

Ah, Sorry ! Forgot about that. Now, its fine.

Could you please tell me if my Caddy config is okay ?  
I’m getting Error 400 Malformed host header error.

```auto
reverse_proxy /nixone/* 127.0.0.1:7777 {
  header_up X-Real-IP {remote}
  header_up X-Forwarded-For {remote}
  header_up X-Forwarded-Proto {scheme}
  header_up Host {http.host}
}

```

---

<div class="post-metadata">

**Author:** ![mitexleo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/mitexleo/32/1132_2.png) [@mitexleo](https://forum.storj.io/u/mitexleo)\
**Post date:** [March 4, 2023, 2:49am UTC](https://forum.storj.io/t/regarding-gatewayst-setup/21572/38 "2023-03-04T02:49:21Z")

</div>

Here’s full config;

```auto
cdn.nixorigin.one {
  reverse_proxy /nixone/* 127.0.0.1:7777 {
    header_up X-Real-IP {remote}
    header_up X-Forwarded-For {remote}
    header_up X-Forwarded-Proto {scheme}
    header_up Host {http.host}
  }
}

```

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [March 4, 2023, 3:23am UTC](https://forum.storj.io/t/regarding-gatewayst-setup/21572/39 "2023-03-04T03:23:34Z")

</div>

I have no experience with this reverse proxy, sorry.

However, since GatewayST doesn’t support TLS, it can handle only HTTP requests, not HTTPS.  
To land an HTTPS traffic, your reverse proxy must listen an https traffic with a valid certificate, but you should not pass Proto to the GatewayST, it should remain HTTP.

---

<div class="post-metadata">

**Author:** ![mitexleo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/mitexleo/32/1132_2.png) [@mitexleo](https://forum.storj.io/u/mitexleo)\
**Post date:** [March 4, 2023, 3:24am UTC](https://forum.storj.io/t/regarding-gatewayst-setup/21572/40 "2023-03-04T03:24:47Z")

</div>

Okay 👍… Won’t pass proto. Lets see how it goes !

---

<div class="post-metadata">

**Author:** ![mitexleo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/mitexleo/32/1132_2.png) [@mitexleo](https://forum.storj.io/u/mitexleo)\
**Post date:** [March 4, 2023, 3:29am UTC](https://forum.storj.io/t/regarding-gatewayst-setup/21572/41 "2023-03-04T03:29:11Z")

</div>

What does this mean ?

 ![SmartSelect_20230304-092830_Vivaldi Browser](https://storj-s3.bcdn.literatehosting.net/original/2X/8/852ae63f12e460e46260da457b181e4403c003d2.jpeg)

---

<div class="post-metadata">

**Author:** ![mitexleo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/mitexleo/32/1132_2.png) [@mitexleo](https://forum.storj.io/u/mitexleo)\
**Post date:** [March 4, 2023, 3:30am UTC](https://forum.storj.io/t/regarding-gatewayst-setup/21572/42 "2023-03-04T03:30:59Z")

</div>

Sorry, that file actually doesn’t exist !

Everything is fine now 😌 …

Thanks for your help , Alexy !

[Previous page](https://forum.storj.io/t/regarding-gatewayst-setup/21572.md?page=1)
