Skip to content
Back

Github App "Failed to retrieve access token from GitHub API" v1.8.1

  • 0
  • Self Hosted
Flyto
12 Jan, 2026, 22:46

When trying to connect the Github App on 1.8.1 I recieve this error:

TypeScript
[Error] URL: /v1/vcs/github/callback
[Error] Type: Exception
[Error] Message: Failed to retrieve access token from GitHub API.
[Error] File: /usr/src/code/vendor/utopia-php/vcs/src/VCS/Adapter/Git/GitHub.php
[Error] Line: 398```

ENV should all be set according to docs, Github app as well. Anyone an idea? 

The Callback URL:
GET https://backend.dashly.at/v1/vcs/github/callback?code=8523009ca9352c8911d1&installation_id=103919286&setup_action=update&state=%7B%22projectId%22%3A%2269655ecb000d5ab27c14%22%2C%22success%22%3A%22https%3A%5C%2F%5C%2Fbackend.dashly.at%5C%2Fconsole%5C%2Fproject-default-69655ecb000d5ab27c14%5C%2Fsettings%3Falert%3Dinstallation-updated%22%2C%22failure%22%3A%22https%3A%5C%2F%5C%2Fbackend.dashly.at%5C%2Fconsole%5C%2Fproject-default-69655ecb000d5ab27c14%5C%2Fsettings%3Falert%3Dinstallation-updated%22%7D 500 (Internal Server Error)
TL;DR
Developers are experiencing issues with the Github App version 1.8.1, specifically encountering the error message "Failed to retrieve access token from GitHub API." This problem is likely due to incorrect GitHub App credentials, especially related to the private key (potentially incorrect key, missing line breaks, or mismatch with the app). The issue can also arise from discrepancies between the callback URL or app credentials and what GitHub expects. Make sure the GitHub App private key is set correctly in the environment, using raw PEM, escaped string, or a mounted file. The error occurs during a GET request to the callback URL, resulting in a 500
Flashtum
12 Jan, 2026, 22:52

I can help 🙂 This usually happens because Appwrite can’t exchange the GitHub callback code for an access token. The most common cause is an issue with the GitHub App credentials, especially the private key not being set correctly (wrong key, missing line breaks, or not matching the app). It can also happen if the callback URL or app credentials don’t exactly match what GitHub expects. How are you setting the GitHub App private key in your environment (raw PEM, escaped string, or mounted file)? @Flyto

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