Generating relay credentials failed

I was running install.sh after removing the credentials.json and the following error is logged

Generating Relay credentials...
Creating sentry_onpremise_relay_run ... 
Creating sentry_onpremise_relay_run ... done
An error occurred, caught SIGERR on line 324
Cleaning up...

The files only contains the error message and not a valid JSON object
root@basecamp /srv/sentry # cat relay/credentials.json

error: could not parse json config file (file /work/.relay/credentials.json)
  caused by: EOF while parsing a value at line 1 column 0

I removed the credentials as suggested here:

Removing the invalid credentials.json file and running the command to generate the credentials (Install.sh fails if relay/credentials.json not exist · Issue #476 · getsentry/self-hosted · GitHub) fails with the following message:

root@basecamp /srv/sentry # docker-compose run --no-deps -v $(pwd)/relay/config.yml:/tmp/config.yml relay credentials generate --stdout
Creating sentry_onpremise_relay_run ... done
 INFO  relay::setup > launching relay from config folder /work/.relay
 INFO  relay::setup >   relay mode: managed
 INFO  relay::setup >   relay id: -
 INFO  relay::setup >   public key: -
 INFO  relay::setup >   log level: DEBUG
 ERROR relay_log::utils > relay has no credentials, which are required in managed mode. Generate some with "relay credentials generate" first.

You are missing a very important parameter: --config /tmp which tells relay where to look for its config. See our install script code for this:

1 Like