I'm attempting to spin up a docker container running bors-ng. I supply the required environment variables, as outlined in the docs and in the guide, Setting up bors with docker-compose. However, after the log line "running migrations for bors", I encounter the following error, and the service crashes.
The stack trace is as follows:
web_1 | Running migrations for bors
web_1 | 23:50:22.825 [error] GenServer BorsNG.GitHub terminating
web_1 | ** (ArgumentError) argument error: [[], {:jose_jws, {:jose_jws_alg_rsa_pkcs1_v1_5, :RS256}, :undefined, %{"typ" => "JWT"}}, %{"aud" => "Joken", "exp" => <redacted>, "iat" => <redacted>, "iss" => <redacted>, "jti" => "<redacted>", "nbf" => <redacted>}]
web_1 | (jose) src/jose_jwt.erl:184: :jose_jwt.sign/3
web_1 | (joken) lib/joken/signer.ex:119: Joken.Signer.sign/2
web_1 | (joken) lib/joken.ex:365: Joken.encode_and_sign/3
web_1 | (joken) lib/joken.ex:211: Joken.generate_and_sign/4
web_1 | (joken) lib/joken.ex:225: Joken.generate_and_sign!/4
web_1 | (bors) lib/github/github/server.ex:62: BorsNG.GitHub.Server.handle_call/3
web_1 | (stdlib) gen_server.erl:661: :gen_server.try_handle_call/4
web_1 | (stdlib) gen_server.erl:690: :gen_server.handle_msg/6
web_1 | Last message (from BorsNG.Supervisor): :get_app
web_1 | 23:50:22.830 [info] Application bors exited: BorsNG.Application.start(:normal, []) returned an error: shutdown: failed to start child: BorsNG.Attrs
web_1 | ** (EXIT) exited in: GenServer.call(BorsNG.GitHub, :get_app, 10000)
Has anyone else encountered this before? Unfortunately I'm not familiar with Elixir/Phoenix/Erlang, so debugging has proven difficult.
I still haven't been able to resolve this issue. I did find this github issue, in which the user did not have their pem input correctly formatted within an Elixir string. I'm not sure how I can see if this is the issue; I base64-encode my pem with
openssl base64 -A -e < secret.pem
And decoding it gives me the correct result.
Okay, can you ask GitHub to regenerate your PEM key, then post an exact copy of your docker-compose.yml
file?
Certainly, thanks for the reply. Here's the docker-compose.yml
file (PEM and client secret have been since regenerated and my public ec2 DNS fudged):
version: "2"
services:
web:
image: borsng/bors-ng
restart: always
ports:
- 80:8000
environment:
PORT: 4000
PUBLIC_HOST: "ec2-3-15-96-420.us-east-1.compute.amazonaws.com"
DATABASE_URL: "postgres://postgres:testing1@postgres:5432/bors_ng"
GITHUB_CLIENT_ID: "Iv1.896d6f4781cfdfa7"
GITHUB_CLIENT_SECRET: "5fb8a1969375132a30be4fed1a5d243d0a7a5031"
GITHUB_INTEGRATION_ID: 49067
GITHUB_INTEGRATION_PEM: "LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLSBNSUlFcEFJQkFBS0NBUUVBMEVaeFZQRjRMcVRsVDZGT1d1c2hlSERZTmNUNGh0c1BvSUZ1Rm00SnBsclNrdmVuIDdxZGo1SHFWTWNxQkNXbHAvZEhQL1JvTXp4aTFlNUZ5UmpXUzU5Vlp5UXlxeWZ3amc0R2M0ZVhWVk5rZDNUMFIgTE1BZWVFaGFJUzJQMVVrazhwZXZ4Y2xVIGRiRWtDL0JvQ1F6enVrUzlvWGJoVWl4VWZvK1A2NU1JVm8wNlJkZFggNnNVWXdtVGNkQnl6MVVYMXJlcWR2R01EdFNhcS9tWllWbmlKSEc0eUQrbUhsWnZxM0xRbWVHRkpxcmFCRGt0SCBWZjlDTUtoZGtpd0x0SmUvSHRKQmVOeHB0V1AvMmc0U2cxOTh3RDJ3STRIYUFseThSS1ppS3h4RC9Hdmk2ODU3IC9meVdnVlRCak5Kelc2TGVWSWpSUVRKMmo4bnFIWEFNOVR4d3IgUUlEQVFBQkFvSUJBUUNRU0l5UWxPdDJITVBEIEEzTTlwdkE3K0tpL3J5R2dncmR6c05acjhYVDc2cVZBTFJNSVVLdnlCejIrRFpTUXlaY2t3Q24vSkFIRm9rOXYgT0JaYkx4Z0RSUmo3SDZ4ZFd5L2JGWHB5UC84bTFYWkw0dGM0RWl2SmxnM2lPQ2NSVWFlbjY0OVlUSjRYSGsxaiBlL3NHY2hPU2NiYVEyY05FWXZOeDdkQjlHUkhJcXJNWUtqL1pObU1KaEEyLzg5K0hrayBRb2g1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xa0M4dTJreiB6eUpDZy94OFZyc0ZKM2QwQWJXN1V6UDJtdjVZb0NHbElUMUJLVU0vS1hzRWIzVm11Q1AvNWJQSHBISkxqb3pkIE4zRDlObnNDZ1lCSzZVNWJLNm1MZUxXRVM5VDJsZ25tYnM3dVJkd0t3eXpZM0FhdjFCSHlPUUZxZGJpcE1QcWkgaCtDanFuQnovL1lwSUVJbmdLY2ZuK3pGckc5V3JsQml6ZVUvbm1Bd2xMdWhIVWJqVzBOb1hHdDZGcVo2UXZXVSBFa1A3YTZOWlphSFdteHM0Uk0zVm1qamFpZ21RSlFnME1RYm9ybWxINGg1YUVXaVRPVDNLK1E9PSAtLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo="
GITHUB_WEBHOOK_SECRET: "YzUzYzY1YTY2MmFiMTdjNzliNTFlZDBh"
DATABASE_USE_SSL: "false"
DATABASE_AUTO_MIGRATE: "true"
ALLOW_PRIVATE_REPOS: "true"
SECRET_KEY_BASE: 46290
postgres:
image: postgres:11.6
restart: always
volumes:
- datadb:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: testing1
volumes:
datadb:
networks:
default:
driver: bridge
Found the problem. All of the line breaks in your pemfile have been replaced with spaces. That is, it looks like this when I base64 decode it:
-----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEA0EZxVPF4LqTlT6FOWusheHDYNcT4htsPoIFuFm4JplrSkven 7qdj5HqVMcqBCWlp/dHP/RoMzxi1e5FyRjWS59VZyQyqyfwjg4Gc4eXVVNkd3T0R LMAeeEhaIS2P1Ukk8pevxclU dbEkC/BoCQzzukS9oXbhUixUfo+P65MIVo06RddX 6sUYwmTcdByz1UX1reqdvGMDtSaq/mZYVniJHG4yD+mHlZvq3LQmeGFJqraBDktH Vf9CMKhdkiwLtJe/HtJBeNxptWP/2g4Sg198wD2wI4HaAly8RKZiKxxD/Gvi6857 /fyWgVTBjNJzW6LeVIjRQTJ2j8nqHXAM9Txwr QIDAQABAoIBAQCQSI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XXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXX/+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXX+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX+XX/
XXXXXXXXXXXXXXXXXXXXXXXX++XXXXXXXXXXXXXXXXXX/XXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXX+XX/XX/XXXXXXXXX+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX+X
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXX+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/XXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX+XXXXXXXXXXXXXXXXXX/XXXXXX
XXXXX/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXX+XXXXXXXXXXXX+XXXXXXXXXXXX+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX==
-----END RSA PRIVATE KEY-----
The lines breaks here are part of the format.
1 Like
That indeed was the issue! Thanks so much for the help. I was unaware that private keys required those newlines.
1 Like