Back

[SOLVED] Error 500 when creating a function with Github

  • 0
  • Functions
iStornZ
4 Sep, 2023, 14:42

Hello all,

  • I created a Github app (following the doc here https://appwrite.io/docs/configuration#git)
  • Then adding all vars in .env then relaunch server with docker
  • I go to "Function", "Connect Git repository", "GitHub"
  • App is installed & ensured to click on "Only select repositories" then "All repositories" then "Save" to ensure access are good
  • I click on "Create function", from Quick Start I select "Node.js" for ex.
  • I click on Next for all step then "Create a new repository"
  • I click on "GitHub" & I see error 500 (sometimes I see the same screen: Repository Access, I do the same trick as previously)

What can I do ? Thanks πŸ™‚

TL;DR
Title: [SOLVED] Error 500 when creating a function with GitHub - The issue was resolved. - Double check the callback URLs in GitHub and ensure they are in the same order as in the docs. - Uninstall the GitHub app from your account and go through the flow again. - Verify permissions again to ensure they are correct. - There may be a network problem or a permissions problem with the GitHub app. - Changing the webhook secret and generating a random string did not solve the issue. - Apply the changes by running `docker compose up -d`. - Set the webhook secret in both Appwrite and GitHub. -
iStornZ
4 Sep, 2023, 15:36

Apparently I had a 401 error...

iStornZ
4 Sep, 2023, 15:37

{"message":"Invalid webhook signature.","code":401,"type":"general_access_forbidden","version":"1.4.1"}

Drake
4 Sep, 2023, 15:47

please set the webhook secret in appwrite and github

iStornZ
4 Sep, 2023, 15:49

I generated a random string, set on Github & set _APP_VCS_GITHUB_WEBHOOK_SECRET too :/

Drake
4 Sep, 2023, 15:49

did you run docker compose up -d to apply the changes?

iStornZ
4 Sep, 2023, 15:50

Yep !

iStornZ
4 Sep, 2023, 15:50

I verified with `docker-compose exec appwrite vars``

iStornZ
4 Sep, 2023, 15:51

Tried to change webhook secret but not working too ...

iStornZ
4 Sep, 2023, 15:54

It seems some requests works now but I see error 500 again ...

Drake
4 Sep, 2023, 15:56

maybe network problem. maybe permissions problem with the github app

iStornZ
4 Sep, 2023, 15:58

Hum I got something helpful, in the URL of my appwrite instance I got this after install github app:

https://my.server.com/console/project-test/functions?from=github&to=cover&error=%7B%22message%22%3A%22Failed+to+obtain+access+token.+The+GitHub+OAuth2+provider+returned+an+error%3A+Not+Found%22%2C%22type%22%3A%22user_oauth2_provider_error%22%2C%22code%22%3A404%7D#

iStornZ
4 Sep, 2023, 16:01

I'm sure about permissions, I checked it again and it's OK πŸ™‚

Drake
4 Sep, 2023, 16:08

double check the callback urls in github. they need to be the same order as in the docs. then ninstall the github app from your account and go through the flow again

iStornZ
4 Sep, 2023, 16:08

Ah ok ! It's not on the same order !

iStornZ
4 Sep, 2023, 16:09

I will try thanks πŸ™‚

iStornZ
4 Sep, 2023, 16:12

It works πŸŽ‰ Thank you for your (very quick) help !

iStornZ
4 Sep, 2023, 16:13

[SOLVED] Error 500 when creating a function with Github

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