#Unable to connect Github repo
79 messages · Page 1 of 1 (latest)
What guide?
official in docs
Do you can send the link of the specific tutorial that you have followed?
Also, what are the logs for docker compose logs appwrite?
So do you have set the corresponding variables in the .env file?
Master pid 1, manager pid 7
[Error] Timestamp: 2024-05-31T17:12:04+00:00
[Error] Method: GET
[Error] URL: /v1/vcs/github/callback
[Error] Type: Ahc\Jwt\JWTException
[Error] Message: Signing key cannot be empty
[Error] File: /usr/src/code/vendor/adhocore/jwt/src/ValidatesJWT.php
[Error] Line: 34
[Error] Timestamp: 2024-05-31T17:18:07+00:00
[Error] Method:
[Error] URL: /favicon.ico
[Error] Type: Appwrite\Extend\Exception
[Error] Message: The requested route was not found. Please refer to the API docs and try again.
[Error] File: /usr/src/code/app/controllers/general.php
[Error] Line: 972
oh
where do I set this signing key?
In the env variables I think
_APP_VCS_GITHUB_CLIENT_SECRET is set
_APP_VCS_GITHUB_WEBHOOK_SECRET set as well
_APP_OPENSSL_KEY_V1 too
According to the page in the link you sent there are more variables that need to be set
Specifically those:
_APP_VCS_GITHUB_APP_NAME
_APP_VCS_GITHUB_PRIVATE_KEY
_APP_VCS_GITHUB_APP_ID
_APP_VCS_GITHUB_CLIENT_ID
_APP_VCS_GITHUB_WEBHOOK_SECRET
all set
If you have installed appwrite through the usual procedure (the automatic install in the docs), do you have run this command to recreate the containers and apply the changes?
docker compose up -d
yup
Weird. After runnng docker exec appwrite vars does it shows all the github keys?
(**don't **send here the keys)
so for the people that get the same error:
https://github.com/appwrite/appwrite/discussions/8011
Steven says it's because your _APP_VCS_GITHUB_PRIVATE_KEY variable is not set properly
yeah, I didn't fix it yet, but the solution was in the link, I must have had folded it wrong
thanks for all the help!
Confirm us if that solves your issue 🙂
I have the same problem. Tried setting the \n and stuff manually but it didnt work. I then tried to to it via this cmd: https://gist.github.com/bafxyz/de4c94c0912f59969bd27b47069eeac0 but it didn't work too. I did get the same error. Any sugggestions? I cannot use the test provided in the github issue provided by @pulsar hull , because I am using coolify.
this env var should probably be just path to the mounted file instead of value
oh, or even better compromise, provide an example of properly folded key
@bold quest I've regenerated private key in github app and used the command provided by @lapis gulch to create the variable and updated containers
using the script provided in appwrite discussion I get Invalid Private Key
version 1.5.7
removing newline character at the end produces same error
@icy tartan maybe you'll find it interesting
How did you update the containers?
@pulsar hull so you didn't managed to solve it as well? I'm also still having the issue.
@icy tartan I've changed the env and restarted the container
portainer > update the stack with prune services
Restarting does not changes to env variables. The container must be recreated
Ugh portainer
Are you updating via .env file?
In fact it did pull the whole image and recreated everthing because thats what coolify is doing
Best you create a separate post
environment variables, advanced mode in portainer
Try pasting the key from the file instead of changing the newlines.
echo $_APP_VCS_GITHUB_PRIVATE_KEY from inside container shows updated var
Can you DM me what it shows?
yeah, not in prod yet
@pulsar hull i've just noticed the cmd i've posted creates \n\n instead of \n. better check it as well.
not on mac, it's creating single newline
i did it on mac as well
I'm highly confident it's a portainer problem: https://github.com/portainer/portainer/issues/1856
and env_var parameter doesn't work in portainer either, imho it looks for it inside portainer container...
What do you mean?
So you modified the compose file to specify a env_file? And you put that env file in the same place as the compose file?
Interesting...maybe portainer isn't using the compose commands 🤷♂️
By default, compose uses the .env file in the same folder as the compose file
seems like it, it even seems to parse compose definition it's own way, because swarm mode errored about container_name
Oh swarm is a little different than compose. Some things aren't compatible like container name and env file.
fyi, env_file is also not supported in swarm mode, just as well as reading .env from the same folder
that's the correct way to deploy: export $(cat standard/appwrite/.env) > /dev/null 2>&1; docker stack deploy appwrite -c standard/appwrite/docker-compose.yaml
to read variables from .env
but having variable set in .env like in the screenshot, get's me all the same error as before
so there is definitely something missing from the docs on how to properly format this variable
my docker-compose starts like this:
version: '3'
services:
appwrite:
image: appwrite/appwrite:1.5.7
networks:
- appwrite
- traefik
deploy:
labels:
- traefik.enable=true
- traefik.http.services.appwrite_api.loadbalancer.server.port=80
#http
- traefik.http.routers.appwrite_api_http.entrypoints=web
- traefik.http.routers.appwrite_api_http.rule=Host(`domain.com`) && PathPrefix(`/`)
- traefik.http.routers.appwrite_api_http.service=appwrite_api
# https
- traefik.http.routers.appwrite_api_https.entrypoints=websecure
- traefik.http.routers.appwrite_api_https.rule=Host(`domain.com`) && PathPrefix(`/`)
- traefik.http.routers.appwrite_api_https.service=appwrite_api
- traefik.http.routers.appwrite_api_https.tls=true
- traefik.http.routers.appwrite_api_https.tls.certresolver=production
mode: replicated
replicas: 1
update_config:
parallelism: 1
delay: 30s
restart_policy:
condition: on-failure
placement:
constraints:
- node.role == manager
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- /home/debian/standard/appwrite/uploads:/storage/uploads:rw
- /home/debian/performance/appwrite/cache:/storage/cache:rw
- /home/debian/standard/appwrite/config:/storage/config:rw
- /home/debian/standard/appwrite/certificates:/storage/certificates:rw
- /home/debian/performance/appwrite/functions:/storage/functions:rw
depends_on:
- redis
- clamav
environment:
- _APP_ENV
- _APP_WORKER_PER_CORE
- _APP_LOCALE
- _APP_CONSOLE_WHITELIST_ROOT
- _APP_CONSOLE_WHITELIST_EMAILS
- _APP_CONSOLE_WHITELIST_IPS
- _APP_CONSOLE_HOSTNAMES
- _APP_SYSTEM_EMAIL_NAME
- _APP_SYSTEM_EMAIL_ADDRESS
- _APP_SYSTEM_SECURITY_EMAIL_ADDRESS
- _APP_SYSTEM_RESPONSE_FORMAT
every service is configured like this, very similar
even more interesting, the command I pasted before is cutting variable out at space character and that's why it fails this time
@lapis gulch I got it working, here is the steps I took:
- on my mac:
awk -v ORS='\n' '1' private-key.pem | pbcopy - on my vm:
export _APP_VCS_GITHUB_PRIVATE_KEY="<paste it here as is, no modifications, it should be multiline before you hit enter>" - deploy stack without reading .env again, because it'll override
@bold quest @icy tartan thanks a lot for help in here, I really appreciate it
here is the takeaway, I don't know how you test it locally, what tools you use and how you deploy to prod, but \n can't be written as literal string in the variable, because it won't render, it needs to be corrected in the docs or update the script to render newline characters like that
also any IDE, text area or even nano is rendering pasted variable as multiline destroying the .env file which is by default an ini file
the only working solution is to export this variable in the shell which makes deployment command kind of a monster like 😄
a fix would be to allow users to provide a path to a file that they can mount in the container
example of deployment command:
export $(cat standard/appwrite/.env) > /dev/null 2>&1; _APP_VCS_GITHUB_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----
....
-----END RSA PRIVATE KEY-----
"; docker stack deploy appwrite -c standard/appwrite/docker-compose.yaml
Docs are fine and work for everyone else because the standard deployment uses compose. You're kind of on your own if you use something else like swarm or portainer