Skip to content
Init is here / May 19 - 23
Back

[Solved] Github App configuration not working

  • 0
  • Self Hosted
  • Functions
Ernest
10 Dec, 2023, 10:21

Having a bit of an issue configuring my Github App for functions in my self-hosted instance. I've checked the app configuration (callbacks, permissions, etc) and everything seems to be in order.

Relevant env variables (obviously simplified)

TypeScript
- _APP_DOMAIN=my.domain.com
- _APP_DOMAIN_FUNCTIONS=my.domain.com
- _APP_DOMAIN_TARGET=my.domain.com
- _APP_FUNCTIONS_SIZE_LIMIT=30000000
- _APP_FUNCTIONS_TIMEOUT=900
- _APP_FUNCTIONS_BUILD_TIMEOUT=900
- _APP_FUNCTIONS_CONTAINERS=
- _APP_FUNCTIONS_CPUS=0
- _APP_FUNCTIONS_MEMORY=0
- _APP_FUNCTIONS_MEMORY_SWAP=
- _APP_FUNCTIONS_RUNTIMES=node-16.0,php-8.0,python-3.9,ruby-3.0,dart-3.0
- _APP_EXECUTOR_SECRET=my-secret
- _APP_EXECUTOR_HOST=http://appwrite-executor/v1
- _APP_EXECUTOR_RUNTIME_NETWORK=
- _APP_FUNCTIONS_ENVS=
- _APP_FUNCTIONS_INACTIVE_THRESHOLD=
- OPEN_RUNTIMES_NETWORK=
- _APP_FUNCTIONS_RUNTIMES_NETWORK=
- _APP_FUNCTIONS_MAINTENANCE_INTERVAL=
- _APP_VCS_GITHUB_APP_NAME=my-appwrite-app
- _APP_VCS_GITHUB_PRIVATE_KEY=-----BEGIN RSA PRIVATE KEY-----\n...8LHNx6PA==\n-----END RSA PRIVATE KEY-----
- _APP_VCS_GITHUB_APP_ID=685648
- _APP_VCS_GITHUB_CLIENT_ID=Iv1.8637b081cde7d136
- _APP_VCS_GITHUB_CLIENT_SECRET=d353e36...620
- _APP_VCS_GITHUB_WEBHOOK_SECRET=QxqzUv...vzS

Logs from appwrite:

TypeScript
2023-12-10T10:02:49.409190414Z [Error] Timestamp: 2023-12-10T10:02:49+00:00
2023-12-10T10:02:49.409267174Z [Error] Method: GET
2023-12-10T10:02:49.409271254Z [Error] URL: /v1/account/sessions/oauth2/:provider/redirect
2023-12-10T10:02:49.409274214Z [Error] Type: Appwrite\Extend\Exception
2023-12-10T10:02:49.409277054Z [Error] Message: Failed to obtain access token. The GitHub OAuth2 provider returned an error: Not Found
2023-12-10T10:02:49.409280094Z [Error] File: /usr/src/code/app/controllers/api/account.php
2023-12-10T10:02:49.409282854Z [Error] Line: 489
TL;DR
Title: [Solved] Github App configuration not working TL;DR: The issue was with the callback URLs. Deleting and re-adding them resolved the problem. The user was experiencing trouble configuring their Github App for functions in their self-hosted instance. They verified the app configuration, including callbacks and permissions, and everything seemed correct. Relevant environment variables were provided for reference. The appwrite logs showed an error message stating that it failed to obtain an access token due to a "Not Found" error from the GitHub OAuth2 provider. Solution: The user tried deleting both callbacks, reloading, and then adding them again. This resolved
Ernest
10 Dec, 2023, 10:30

Solution here. The callback url fields are buggy even though everything was correct, I had to delete both callbacks, reload and add them again 🤦‍♂️ There should be a notice of this on that section so that devs don't end up going bald from all the hair pulling. https://discord.com/channels/564160730845151244/1172239299081666682/1172757175228186694

Ernest
10 Dec, 2023, 10:30

[Solved] Github App configuration not working

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