Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Bug Report: Functions Connect to Github goes to 404 Page #6086

Closed
2 tasks done
sunjianan9900 opened this issue Aug 31, 2023 · 13 comments
Closed
2 tasks done

馃悰 Bug Report: Functions Connect to Github goes to 404 Page #6086

sunjianan9900 opened this issue Aug 31, 2023 · 13 comments
Assignees
Labels
bug Something isn't working product / functions Fixes and upgrades for the Appwrite Functions.

Comments

@sunjianan9900
Copy link

馃憻 Reproduction steps

Create A Function with templates "python - Prompt ChatGPT"

Connect to Github

Whichever one you choose will go to a 404 page:
image

it jump to

https://github.com/apps//installations/new?state=%7B%22projectId%22%3A%2264f0462f890e0693f561%22%2C%22success%22%3A%22https%3A%5C%2F%5C%2Fapi.mydomain.top%5C%2Fconsole%5C%2Fproject-64f0462f890e0693f561%5C%2Ffunctions%5C%2Ftemplates%3Ffrom%3Dgithub%26to%3Dtemplate%26step%3D4%26template%3Dprompt-chatgpt%26templateConfig%3D%257B%2522%2524id%2522%253Anull%252C%2522runtime%2522%253A%2522python-3.9%2522%252C%2522name%2522%253A%2522Prompt%2BChatGPT%2522%252C%2522variables%2522%253A%257B%2522OPENAI_API_KEY%2522%253A%2522sb-33e885d5320d95bd99de3496ff7346d1%2522%252C%2522OPENAI_MAX_TOKENS%2522%253A%2522512%2522%257D%252C%2522repositoryBehaviour%2522%253A%2522new%2522%252C%2522repositoryName%2522%253A%2522prompt-chatgpt%2522%252C%2522repositoryPrivate%2522%253Atrue%252C%2522repositoryId%2522%253Anull%257D%22%2C%22failure%22%3A%22https%3A%5C%2F%5C%2Fapi.mydomain.top%5C%2Fconsole%5C%2Fproject-64f0462f890e0693f561%5C%2Ffunctions%5C%2Ftemplates%3Ffrom%3Dgithub%26to%3Dtemplate%26step%3D4%26template%3Dprompt-chatgpt%26templateConfig%3D%257B%2522%2524id%2522%253Anull%252C%2522runtime%2522%253A%2522python-3.9%2522%252C%2522name%2522%253A%2522Prompt%2BChatGPT%2522%252C%2522variables%2522%253A%257B%2522OPENAI_API_KEY%2522%253A%2522sb-33e885d5320d95bd99de3496ff7346d1%2522%252C%2522OPENAI_MAX_TOKENS%2522%253A%2522512%2522%257D%252C%2522repositoryBehaviour%2522%253A%2522new%2522%252C%2522repositoryName%2522%253A%2522prompt-chatgpt%2522%252C%2522repositoryPrivate%2522%253Atrue%252C%2522repositoryId%2522%253Anull%257D%22%7D&redirect_uri=https%3A%2F%2Fapi.mydomain.top%2Fv1%2Fvcs%2Fgithub%2Fcallback

image

馃憤 Expected behavior

create a github project

馃憥 Actual Behavior

open a 404 page

馃幉 Appwrite version

Version 1.4.x

馃捇 Operating system

Linux

馃П Your Environment

No response

馃憖 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

馃彚 Have you read the Code of Conduct?

@sunjianan9900 sunjianan9900 added the bug Something isn't working label Aug 31, 2023
@joeyouss joeyouss added the product / functions Fixes and upgrades for the Appwrite Functions. label Aug 31, 2023
@istornz
Copy link

istornz commented Aug 31, 2023

I can confirm the issue on my server too...

  • Migrated from 1.3.8 to 1.4.0, migration without problem.
  • Migrated from 1.4.0 to 1.4.1, migration with a lot of warnings (don't know if is it ok or not ?).

@safwanyp
Copy link
Contributor

Can confirm this issue exists on a fresh install as well.

  • Setup on localhost
  • Installed 1.4.0
  • Upgraded to 1.4.1 and performed migration
  • Followed steps in the original post, landed on the 404

@TorstenDittmann
Copy link
Contributor

TorstenDittmann commented Aug 31, 2023

Can you check if all environment variables are set?

You can see in the URL the missing part https://github.com/apps//installations/new. see the //

ref: https://appwrite.io/docs/environment-variables#vcs_(version_control_system)

@TorstenDittmann
Copy link
Contributor

Checked really quick, it looks like _APP_VCS_GITHUB_APP_NAME is missing for you 馃憤馃徎

$appName = App::getEnv('_APP_VCS_GITHUB_APP_NAME');
$url = "https://github.com/apps/$appName/installations/new?" . \http_build_query([

@safwanyp
Copy link
Contributor

safwanyp commented Aug 31, 2023

@TorstenDittmann I've got a question.

_APP_VCS_GITHUB_APP_NAME is supposed to be the name of the github app, which quite frankly i don't know about 馃槄

What exactly am I looking for?

@sunjianan9900
Copy link
Author

Checked really quick, it looks like _APP_VCS_GITHUB_APP_NAME is missing for you 馃憤馃徎

$appName = App::getEnv('_APP_VCS_GITHUB_APP_NAME');
$url = "https://github.com/apps/$appName/installations/new?" . \http_build_query([

After I add _APP_VCS_GITHUB_APP_NAME , it not goes to 404
But what I'm very confused about is that he'll jump straight to the github page and never come back.
My function doesn't create anything either

New Project and Select Existing both jump to this page and nothing more!

image

@safwanyp
Copy link
Contributor

safwanyp commented Sep 1, 2023

After I add _APP_VCS_GITHUB_APP_NAME , it not goes to 404 But what I'm very confused about is that he'll jump straight to the github page and never come back. My function doesn't create anything either

New Project and Select Existing both jump to this page and nothing more!

Can confirm this. It goes to the app installation page, and does nothing. Going back to the console shows no new function. Nothing in my github profile as well.

@stnguyen90
Copy link
Contributor

@sunjianan9900, would you please try to uninstall the github app from your github account and then try connecting from appwrite again?

@stnguyen90 stnguyen90 self-assigned this Sep 1, 2023
@stnguyen90 stnguyen90 added this to the 1.4.2 milestone Sep 1, 2023
@acidlake
Copy link

acidlake commented Sep 1, 2023

i'm having the same issue, i think it would be great that this get added to the documentation for the self hosting section, even after an upgrade from 1.3.x to 1.4.x that app never came up, and was a missing env variable, so i think it would be great that this get added to the documentation, what to put on the github app creation etc, after it send me to install appwrite on github, it just stay there, if i go back to create a function, and i choose github ( after is already install on appwrite ) it does the same process as if is going to be installed again

@stnguyen90 stnguyen90 modified the milestones: 1.4.2, 1.4.3 Sep 2, 2023
@stnguyen90
Copy link
Contributor

@sunjianan9900, do you still need help connecting to GitHub? FYI, I'll need to close this due to inactivity soon.

@acidlake, I recommend joining us on Discord if you still need help.

@hinnerkweiler
Copy link

I can confirm (after spending the entire evening) reinstalling the app does not solve this.

@stnguyen90
Copy link
Contributor

stnguyen90 commented Sep 12, 2023

Closing due to inactivity. Anyone else having trouble should create a support post on Discord.

@stnguyen90 stnguyen90 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2023
@stnguyen90 stnguyen90 removed this from the 1.4.3 milestone Sep 12, 2023
@NeKoFu
Copy link

NeKoFu commented Dec 9, 2023

Documentation is unclear.
The value of _APP_VCS_GITHUB_APP_NAME needs to be the application slug.
For example, if your application is named My Amazing App, the value of this variable will be:
_APP_VCS_GITHUB_APP_NAME=my-amazing-app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product / functions Fixes and upgrades for the Appwrite Functions.
Projects
None yet
Development

No branches or pull requests

9 participants