Lago 1.8.2 docker-compose startup fails: OpenSSL::PKey::RSAError: Neither PUB key nor PRIV key

Deploying Lago 1.8.2 with docker-compose, the API container crashed during db:migrate with bin/rails aborted! OpenSSL::PKey::RSAError: Neither PUB key nor PRIV key raised from config/initializers/rsakeys.rb. The deployment was missing the LAGORSAPRIVATEKEY env value. A side note from the thread: the 1.8.2 compose image was mis-tagged and effectively still 1.8.1, which the maintainer called a release-process mistake.

Generate an RSA private key and set it before starting: echo "LAGO_RSA_PRIVATE_KEY=\"$(openssl genrsa 2048 | base64)\"" >> .env then source .env. The maintainer confirmed the missing key was the cause of the crash. On the mis-tagged image: pulling the repo directly worked around the 1.8.2/1.8.1 mix-up until the release process was fixed. Source: https://github.com/getlago/lago/issues/389

Source: https://github.com/getlago/lago/issues/389