Skip to content

AWS Amplify reconnect fails after GitHub repo move – “Moved Permanently” webhook URL

0

We have an existing AWS Amplify app using Amplify Gen 1 backend environments (dev/staging/prod).

Our GitHub repository was moved to a different organization. After the move, Amplify “Reconnect repository” fails with the following error:

There was an issue setting up your repository. Please try again later.({"message":"Moved Permanently","url":"https://api.github.com/repositories/538886263/hooks","documentation_url":"https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api#follow-redirects"})

GitHub App “AWS Amplify (eu-central-1)” is installed in the target organization and has access to the repository. OAuth authorization was revoked and re-authorized. The repository currently has no webhooks. All client-side remediation steps have been exhausted.

This appears to be stale internal Amplify metadata (repository ID / webhook ID). Is there a way for AWS to reset the GitHub repository binding for an existing Amplify app without recreating backend environments?

asked 9 months ago190 views

1 Answer
0

The error you're encountering is related to GitHub's API returning a "Moved Permanently" response, which typically occurs when GitHub is redirecting requests for a repository that has been moved to a new location. This suggests that Amplify is still attempting to interact with the old repository location using cached metadata.

Unfortunately, based on the available information about Amplify's webhook management, there isn't a documented self-service method to reset the GitHub repository binding without reconnecting. However, here are some approaches to consider:

Potential Solutions:

  1. Manual Webhook Cleanup: Before attempting to reconnect, ensure that any residual webhooks from the old repository location have been completely removed. Check both the old organization (if you still have access) and the new organization for any lingering Amplify webhooks.

  2. Regional Considerations: All Amplify operations, including webhook migrations and reconnections, are region-based. Ensure you're performing the reconnection in the same AWS region where your Amplify app was originally configured (eu-central-1 in your case, based on the GitHub App name).

  3. Webhook Limit Check: Verify that you haven't reached the maximum number of webhooks allowed by GitHub in the new organization, as this can prevent successful reconnection.

  4. AWS Support Intervention: Given that this appears to be an issue with stale internal metadata that cannot be resolved through standard reconnection procedures, you may need to contact AWS Support directly. They may have the ability to clear the cached repository metadata or webhook references at the backend level without requiring you to recreate your backend environments.

Since your backend environments (dev/staging/prod) are critical and you want to preserve them, AWS Support would be your best path forward to resolve this metadata issue without disrupting your existing infrastructure.
Sources
Simplifying Multi-App Management in AWS Amplify Hosting | Front-End Web & Mobile

answered 9 months ago

EXPERT

reviewed 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.