Back

"Signing key cannot be empty" with GitHub Integration on 1.4.2

  • 0
  • Self Hosted
  • Functions
  • General
Drake
9 Sep, 2023, 16:17

does docker compose exec appwrite vars show the correct value?

TL;DR
Summary: Users are experiencing issues with the signing key being empty when using GitHub integration on version 1.4.2. One user had an issue with the key format because they exported it from 1Password, but copying straight from the .pem file solved the problem. Another user asked if commits should automatically deploy to the main branch with GitHub integration, but nothing happened when they pushed commits. The solution was to generate the key from the GitHub app itself and not self-generate it. The user also suggested updating the documentation to clarify that generating the key from GitHub is mandatory and it should be in a single-line string format with '\
Drake
9 Sep, 2023, 16:17

you should use single line

Drake
9 Sep, 2023, 17:15

also, here's a script to test the env var:

TypeScript
#!/bin/sh

CODE='
if (openssl_pkey_get_private(getenv("_APP_VCS_GITHUB_PRIVATE_KEY")) === false) {
    echo "Invalid Private Key\n";
    exit(1);
} else {
    echo "Valid Private Key\n";
    exit(0);
}'

docker compose exec appwrite php -r "$CODE"

After you update the env var, run docker compose up -d to apply the env var change and then run the script to test if it's a valid value

unsoop
9 Sep, 2023, 18:15

updated the code to use \n again. did docker compose down && docker compose up -d

and ran the script: with key that was generated using ssh-keyggen: Invalid Private Key

using ssh-keygen -t rsa -b 4096

Invalid Private Key

same...

unsoop
9 Sep, 2023, 18:17
  • its also in appwrite main container but image wont help to prove it as var list is to long πŸ™‚
unsoop
9 Sep, 2023, 18:17
unsoop
9 Sep, 2023, 18:21

i think i found the issue!!!

unsoop
9 Sep, 2023, 18:21

it a STUPID USER issue!! (me)

unsoop
9 Sep, 2023, 18:21

yep... its me

unsoop
9 Sep, 2023, 18:21

Valid Private Key

darShan
9 Sep, 2023, 18:22

I hope this isn't your actual docker hub password πŸ’€

unsoop
9 Sep, 2023, 18:23

long story (very) short:

the key needs to be generated from the app itself and not self generated... *thnx for the help ** il go sit myself in the corner for 10m...

unsoop
9 Sep, 2023, 18:23

tnx, it is (but not any more πŸ™‚

unsoop
9 Sep, 2023, 18:26

works like a charm πŸ™‚

unsoop
9 Sep, 2023, 18:30

@Steven a suggestion: its not an option to generate the key in the github app its a must. you could add to the documentation:

  1. its a must and not an option
  2. the format should be single line string with \n for multi line seperater.
unsoop
9 Sep, 2023, 18:50

yep. i would point to a document/image

  • state its a mandatory to take it from GITHUB
Drake
9 Sep, 2023, 18:52
Drake
9 Sep, 2023, 18:52

What if the first sentence says RSA private key from GitHub?

unsoop
9 Sep, 2023, 19:22

sound legit. but i would Bold the GitHub

unsoop
9 Sep, 2023, 19:22

and not "you can" but "you must"

unsoop
9 Sep, 2023, 19:24

as for github integration, should it automaticly deploy commits to the main branch ? i pushed few commits and nothing happened/... 😦

unsoop
9 Sep, 2023, 19:26

and i dont see errorrs anywhere 😦

Drake
9 Sep, 2023, 19:30

Yes, if you configured the webhook parts correctly

Drake
9 Sep, 2023, 19:35

Please create a new post for help with webhooks

Roger that!
10 Sep, 2023, 03:10

I ran into the same problem with the key not being the correct RSA PRIVATE KEY format, even though I'd created and downloaded it from GitHub. My issue was because I stored it in 1Password after download, and exported the private key from there, which mucked it up. Copying straight from the .pem file resolved it: https://discordapp.com/channels/564160730845151244/1147708406849876079/1150266669990682634

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more