amplify-hosting icon indicating copy to clipboard operation
amplify-hosting copied to clipboard

Github Connection not Working

Open julien-tamade opened this issue 1 year ago • 4 comments

Before opening, please confirm:

  • [X] I have checked to see if my question is addressed in the FAQ.
  • [X] I have searched for duplicate or closed issues.
  • [X] I have read the guide for submitting bug reports.
  • [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • [X] I have removed any sensitive information from my code snippets and submission.

App Id

d37sqsirhqa81j

AWS Region

us-east-2

Amplify Hosting feature

Git providers

Frontend framework

React

Next.js version

N.A

Next.js router

N/A

Describe the bug

I recently transferred my git repo to an organization. Afterward the Amplify Console still says it's connected and there is no option to connect to a different repo. I used the CLI tool aws amplify update-app --app-id [APP ID] --repository [REPO] --access-token [ACCESS TOKEN] to change the repository connected which seemed to work. Afterward however it shows no repo url in the console. See "source repository" below.

Screenshot 2023-12-11 at 5 11 35 PM

when I go to connect to github using the new Github App. it says it connected successfully, however when trying to connect a branch it gives me no options

Screenshot 2023-12-11 at 5 07 58 PM

please help me

when I try to redeploy the existing branches that were setup i get this error

2023-12-12T03:09:35.378Z [INFO]: Git SSH Key acquired 2023-12-12T03:09:35.497Z [INFO]: # Cloning repository: {{my new accurate git url}} 2023-12-12T03:09:35.955Z [INFO]: Agent pid 157 2023-12-12T03:09:35.956Z [INFO]: Enter passphrase for /root/.ssh/git_rsa: 2023-12-12T03:09:35.956Z [ERROR]: !!! CustomerError: Unable to clone repository due to error code: 1 2023-12-12T03:09:35.956Z [INFO]: # Starting environment caching... 2023-12-12T03:09:35.956Z [INFO]: # Environment caching completed Terminating logging...

Expected behavior

I should be able to select a branch to connect after the Github App has been authorized

Reproduction steps

  1. Create an amplify project
  2. transfer the project's git repo using the cli
  3. try to reconnect

Build Settings

No response

Log output

# Put your logs below this line


Additional information

No response

julien-tamade avatar Dec 12 '23 01:12 julien-tamade

Hi @julien-tamade 👋 , thanks for reaching out.

While running the update-app command, it seems that you have set the --repository attribute to [email protected]:tamade-flowly/flowly-web-portal.git which is an incorrect format and it should rather be as follows: https://github.com/tamade-flowly/flowly-web-portal.

You can either re-run the command with the updated repository attribute and then retry or our recommendation would be to create a new Amplify app and connect this repository to it.

Jay2113 avatar Dec 13 '23 00:12 Jay2113

Hi @Jay2113 thank you for your response.

When I run with the https url I get the following error:

Error parsing parameter '--repository': Unable to retrieve https://github.com/tamade-flowly/flowly-web-portal: received non 200 status code of 404

I'm hesitant to make a new amplify project because this project has my whole backend linked to my native ios and android apps as well

I see some others here were having similar issue with no solution posted.

julien-tamade avatar Dec 13 '23 00:12 julien-tamade

Yesterday I had tried using the github url without the github.com/tamade-flowly/flowly-web-portal without the https:// and it succeeded

but when I tried to redeploy one of the branches the build logs failed even earlier

2023-12-13T00:56:05.148Z [ERROR]: !!! Internal error 2023-12-13T00:56:05.218Z [INFO]: # Starting environment caching... 2023-12-13T00:56:05.651Z [INFO]: # Environment caching completed Terminating logging...

julien-tamade avatar Dec 13 '23 00:12 julien-tamade

@julien-tamade - did the comments in this GitHub issue help? https://github.com/aws-amplify/amplify-hosting/issues/288#issuecomment-679405402

mauerbac avatar Dec 13 '23 18:12 mauerbac

Closing as we havent heard back

mauerbac avatar Jun 27 '24 15:06 mauerbac

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.

github-actions[bot] avatar Jun 27 '24 15:06 github-actions[bot]

This issue has been automatically locked.

github-actions[bot] avatar Jun 27 '24 17:06 github-actions[bot]