Switch from automatic to manual deployments fails
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
d3mqvgiptwomr
AWS Region
eu-central-1
Amplify Hosting feature
Deployments, Manual deploys
Frontend framework
Angular
Next.js version
N/A
Next.js router
N/A
Describe the bug
We connected our git repo through the amplify console and set it up for automatic deployments on each commit about 1.5 years ago. Because the amplify CI/CD does not cover all of our needs, we'd now like to change to manual deployments via amplify publish and do the deployment in the pipeline of our git provider, instead.
We disconnected all the branches in the amplify console (for lack of disconnecting the entire repo) and then added hosting via the cli with "amplify add hosting":
➜ amplify add hosting
✔ Select the plugin module to execute · Hosting with Amplify Console (Managed hosting with custom domains, Continuous deployment)
? Choose a type Manual deployment
You can now publish your app using the following command:
Command: amplify publish
However, when then running "amplify publish", while the backend deployment passes without any issues, for the frontend deployment we get the following error:
✖ Deployment failed! Please report an issue on the Amplify Console GitHub issue tracker at https://github.com/aws-amplify/amplify-console/issues.
:octagonal_sign: Operation not supported. App is already connected a repository.
Expected behavior
amplify publish works and deploys the backend and frontend.
Reproduction steps
- Create an amplify application and add hosting through the amplify console by connecting the git repository
- Disconnect all the branches in the console (since there's no way to disconnect the repo)
- Run "amplify add hosting", choose "Hosting with Amplify Console" and "Manual deployment"
- Run "amplify publish"
- See error
Build Settings
No response
Log output
# amplify publish output
...
Done in 16.39s.
✔ Zipping artifacts completed.
✖ Deployment failed! Please report an issue on the Amplify Console GitHub issue tracker at https://github.com/aws-amplify/amplify-console/issues.
:octagonal_sign: Operation not supported. App is already connected a repository.
Resolution: Please report this issue at https://github.com/aws-amplify/amplify-cli/issues and include the project identifier from: 'amplify diagnose --send-report'
Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/
Session Identifier: 8722b71e-2bd2-46d6-ab33-ec17fce9ef90
:white_check_mark: Report saved: /tmp/<project-name>/report-1693310878055.zip
✔ Done
Project Identifier: 809daeeb99aae0ff84c097e535188112
Additional information
A similar issue was reported before and from the reactions I see there, it seems like a lot of people are confused that it was closed without a resolution: https://github.com/aws-amplify/amplify-hosting/issues/956
Hi @hanna-becker 👋 , thanks for raising this and for sharing detailed information about your use case.
Unfortunately, we do not support the workflow of converting an existing git based CI/CD Amplify app to a manually deployed Amplify app.
The only workaround in this case would be to create a new Amplify app for your frontend to perform manual deployments and then maybe you can consider sharing your backend across apps: https://docs.aws.amazon.com/amplify/latest/userguide/reuse-backends.html
Hi @Jay2113, thank you for the suggested workaround and the link. We will investigate this option.
So is it correct that there is currently no way to completely disconnect a repository from an Amplify app once it has been connected through the console? I think there should have been clear communication in the form of a big red warning box in the docs that taking this step is a one-way door that cannot be undone. (There may be now, actually, I haven't checked.)
I also wonder why this gap hasn't been closed, yet, by the Amplify team. I might be mislead, but from a user's perspective it doesn't seem like it would be a terribly large development effort to implement allowing users to disconnect their repositories.
Hi @Jay2113, one question about your suggested approach: If we create a new app that reuses the existing backend, will we be able to delete the old app afterward, while keeping the original backend?