yukimochi / Activity-Relay

Yet another powerful customizable ActivityPub relay server written in Go.
https://relay.toot.yukimochi.jp/
GNU Affero General Public License v3.0
278 stars 39 forks source link

Relay service exiting due to ACTOR_PEM parsing error. #53

Closed jojobii-arks closed 1 year ago

jojobii-arks commented 1 year ago

Currently receiving an error when trying to run relay-api and relay-worker service.

Steps to reproduce

Logs:

Nov 15 04:58:08 pc-linux relay[8578]: RELAY_ICON: INVALID OR EMPTY. THIS COLUMN IS DISABLED.
Nov 15 04:58:08 pc-linux relay[8578]: RELAY_IMAGE: INVALID OR EMPTY. THIS COLUMN IS DISABLED.
Nov 15 04:58:08 pc-linux relay[8578]: ACTOR_PEM: x509: failed to parse private key (use ParsePKCS8PrivateKey instead for this key format)
Nov 15 04:58:08 pc-linux systemd[1]: relay-api.service: Main process exited, code=exited, status=1/FAILURE
Nov 15 04:58:08 pc-linux systemd[1]: relay-api.service: Failed with result 'exit-code'.
Nov 15 04:58:08 pc-linux relay[8583]: RELAY_ICON: INVALID OR EMPTY. THIS COLUMN IS DISABLED.
Nov 15 04:58:08 pc-linux relay[8583]: RELAY_IMAGE: INVALID OR EMPTY. THIS COLUMN IS DISABLED.
Nov 15 04:58:08 pc-linux relay[8583]: ACTOR_PEM: x509: failed to parse private key (use ParsePKCS8PrivateKey instead for this key format)
Nov 15 04:58:08 pc-linux systemd[1]: relay-worker.service: Main process exited, code=exited, status=1/FAILURE
Nov 15 04:58:08 pc-linux systemd[1]: relay-worker.service: Failed with result 'exit-code'.
yukimochi commented 1 year ago

Thanks for your new issue.

The reason seems to be that the OpenSSL default settings have changed.

Please let me know your Linux distribution and OpenSSL version. I will update the documentation to resolve this error.

yukimochi commented 1 year ago

If you may use OpenSSL 3>, replace installation step below

  1. Generate actor RSA certificate to /var/lib/relay/actor.pem
$ openssl genrsa -traditional | sudo tee /var/lib/relay/actor.pem
$ sudo chmod 600 /var/lib/relay/actor.pem
$ sudo chown relay:relay /var/lib/relay/actor.pem

Good luck.

jojobii-arks commented 1 year ago

Thanks for your new issue.

The reason seems to be that the OpenSSL default settings have changed.

Please let me know your Linux distribution and OpenSSL version. I will update the documentation to resolve this error.

Linux distribution: Ubuntu 22.04.1 LTS OpenSSL Version: OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)


If you may use OpenSSL 3>, replace installation step below

  1. Generate actor RSA certificate to /var/lib/relay/actor.pem
$ openssl genrsa -traditional | sudo tee /var/lib/relay/actor.pem
$ sudo chmod 600 /var/lib/relay/actor.pem
$ sudo chown relay:relay /var/lib/relay/actor.pem

Good luck.

I no longer get the parsing error. Thank you very much! 🙇

# sudo systemctl status relay-worker.service

● relay-worker.service - YUKIMOCHI Activity-Relay Job Worker
     Loaded: loaded (/etc/systemd/system/relay-worker.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2022-11-15 07:15:10 UTC; 2min 26s ago
       Docs: https://github.com/yukimochi/Activity-Relay/wiki
   Main PID: 3389 (relay)
      Tasks: 6 (limit: 1116)
     Memory: 5.5M
        CPU: 140ms
     CGroup: /system.slice/relay-worker.service
             └─3389 /usr/bin/relay --config /var/lib/relay/config.yml worker

Nov 15 07:15:10 linux-pc relay[3389]: RELAY NAME      : [REDACTED]
Nov 15 07:15:10 linux-pc relay[3389]: RELAY DOMAIN    : [REDACTED]
Nov 15 07:15:10 linux-pc relay[3389]: REDIS URL       : redis://[REDACTED]
Nov 15 07:15:10 linux-pc relay[3389]: BIND ADDRESS    : [REDACTED]
Nov 15 07:15:10 linux-pc relay[3389]: JOB_CONCURRENCY : 50
Nov 15 07:15:10 linux-pc relay[3389]: INFO: 2022/11/15 07:15:10 worker.go:58 Launching a worker with the following settings:
Nov 15 07:15:10 linux-pc relay[3389]: INFO: 2022/11/15 07:15:10 worker.go:59 - Broker: redis://[REDACTED]
Nov 15 07:15:10 linux-pc relay[3389]: INFO: 2022/11/15 07:15:10 worker.go:61 - DefaultQueue: relay
Nov 15 07:15:10 linux-pc relay[3389]: INFO: 2022/11/15 07:15:10 worker.go:65 - ResultBackend: redis://[REDACTED]
Nov 15 07:15:10 linux-pc relay[3389]: INFO: 2022/11/15 07:15:10 redis.go:102 [*] Waiting for messages. To exit press CTRL+C
yukimochi commented 1 year ago

docs updated!