Back

Error 404 Not found user_oauth2_provider_error

  • 0
  • Self Hosted
  • Functions
mumble man
24 Oct, 2023, 15:01

Hi I have an appwrite instance hosted where I am trying to connect the Github app that is setup following the documentation to get the github snyced function deployment running. When I am trying to install & authorise the Github App the callback takes me to a 404 page (see the provided screenshot) and an error is thrown in the appwrite container docker logs (see the second screenshot).

The response header includes https://localhost for the access-control-allow-origin. Might be related to my issue - I am running appwrite with the pretty much default traefik setup (just added some labels to try fix the issue) provided by the installations script behind a Caddy instance that reverse proxies the traffic to traefik. I included some header pass-through config to keep the headers intact but might have missed something there, if the issue is related to authentication/cookies or something.

**The Redirect URL is the following (with some redacted parts): ** https://my-subdomain.my-domain.de/v1/vcs/github/callback?code=<here-the-callback-code>&installation_id=<here-installation-id>&setup_action=install&state=%7B%22projectId%22%3A%<here-parts-of-project-id>%22%2C%22success%22%3A%22https%3A%5C%2F%5C%2Fmy-subdomain.my-domain.de%5C%2Fconsole%5C%2Fproject-6536954f3502aaa8176e%5C%2Ffunctions%22%2C%22failure%22%3A%22https%3A%5C%2F%5C%2Fmy-subdomain.my-domain.de%5C%2Fconsole%5C%2Fproject-6536954f3502aaa8176e%5C%2Ffunctions%22%7D

Looking forward to some insight before I am digging deeper trying to more or less trial and error this one 😂

TL;DR
User is experiencing a 404 error when trying to install and authorize the GitHub app in their Appwrite instance. The error is likely related to their reverse proxy setup using Caddy and Traefik. The redirect URL includes a callback code and installation ID. A potential solution would be to check the reverse proxy configuration and ensure the headers are properly passed through for authentication and cookies.
Drake
24 Oct, 2023, 16:26

Uhh did you upgrade Appwrite or was this a clean 1.4 install?

mumble man
24 Oct, 2023, 18:53

Clean install with the docker install script from the docs yesterday

Drake
24 Oct, 2023, 21:14

What's your GitHub app settings?

mumble man
25 Oct, 2023, 19:57

Hey @Steven thanks for your support 🙂 And sry for the late response just got to it now - went step by step according to the docs with special consideration of the order of the callback urls - as I read here that others had problems with a wrong callback order

mumble man
25 Oct, 2023, 20:00

Also double checked the appwrite project envs with the private key having \n for every new line and inserted in the .env in one line

Drake
25 Oct, 2023, 20:19

And you never had appwrite installed right?

mumble man
25 Oct, 2023, 20:39

Nope - first time - put it on my server by executing the install script and all docker containers are running - the backend is running without any issues so far except for this but my Appwrite journey just began so have to test a lot more 🌝 but wanted to test out the functions first 😌

Drake
25 Oct, 2023, 20:47

what version of appwrite did you install?

Drake
25 Oct, 2023, 20:49

The error in the logs regarding installation seem to be related to the webhook events. What did you select for the webhook events in github?

Drake
25 Oct, 2023, 20:51

for account permissions in github, did you set email to read only?

mumble man
25 Oct, 2023, 21:12

Yes E-Mail is set to read-only - webhooks Access is set to read and write like in the docs - otherwise the github events webook URL is configured with the optional webhook secret in place

mumble man
25 Oct, 2023, 21:13

appwrite version btw. is 1.4.5

mumble man
25 Oct, 2023, 21:14

I have a feeling that it has something to do with my reverse proxy setup - that I have caddy in front of traefik - I disabled tls on appwrite traefik.http.routers.appwrite_api_https.tls=false label

mumble man
25 Oct, 2023, 21:15

and also on the appwrite-realtime with traefik.http.routers.appwrite_realtime_wss.tls=false

mumble man
25 Oct, 2023, 21:15

because I am handling the https cert via caddy

Drake
25 Oct, 2023, 21:18

i would leave this stuff default and reverse proxy to traefik using https

Drake
25 Oct, 2023, 21:18

in my scenario, I do this but with nginx proxy manager in front of appwrite

Drake
25 Oct, 2023, 21:19

read and write? I mean the events selected should only be Pull and Push:

mumble man
25 Oct, 2023, 21:20

Okay I will try - I had configured caddy without specifying https so maybe that will do the trick - when enabling tls as is right now I get a 404 from my appwrite URL - but I will get back to you, after I tried with explicit https in the address in caddy

Drake
25 Oct, 2023, 21:20

traefik will have a self signed cert...im not sure what other settings you need to set in caddy to make sure to allow/accept that self signed cert

mumble man
25 Oct, 2023, 21:22

Okay I can probably figure that out with caddy 🙂 Yes it is set only for Pull request and push 👍

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