aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.81k stars 819 forks source link

encountering `Parameters: [hostedUI] do not exist in the template` after updating API #12926

Closed Arnav7501 closed 1 year ago

Arnav7501 commented 1 year ago

Before opening, please confirm:

JavaScript Framework

React Native

Amplify APIs

Authentication, GraphQL API, DataStore

Amplify Categories

auth, storage, api

Environment information

``` # Put output below this line -duplicates --npmGlobalPackages System: OS: macOS 13.3 CPU: (8) arm64 Apple M1 Memory: 122.83 MB / 8.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.4.0 - /opt/homebrew/bin/node Yarn: 1.22.19 - ~/node_modules/.bin/yarn npm: 9.8.0 - ~/Downloads/lbnapp_new/node_modules/.bin/npm Watchman: 2023.07.03.00 - /opt/homebrew/bin/watchman Browsers: Chrome: 114.0.5735.198 Safari: 16.4 npmPackages: @angular/cli: ^15.0.1 => 15.2.9 @azure/core-asynciterator-polyfill: ^1.0.2 => 1.0.2 @babel/core: ^7.20.0 => 7.20.12 (7.9.0) @bam.tech/react-native-make: ^3.0.3 => 3.0.3 @expo/config-plugins: ~7.2.2 => 7.2.5 @expo/webpack-config: ^0.17.0 => 0.17.4 @react-native-async-storage/async-storage: 1.18.2 => 1.18.2 @react-native-community/cli: ^10.1.0 => 10.2.5 (11.3.3) @react-native-community/netinfo: 9.3.10 => 9.3.10 @react-native-picker/picker: 2.4.10 => 2.4.10 @react-navigation/bottom-tabs: ^6.5.3 => 6.5.8 @react-navigation/native: ^6.0.12 => 6.1.7 @react-navigation/native-stack: ^6.8.0 => 6.9.13 HelloWorld: 0.0.1 amazon-cognito-identity-js: ^5.2.10 => 5.2.14 (6.3.1) amazon-cognito-identity-js/internals: undefined () aws-amplify: ^5.0.9 => 5.3.3 aws-amplify-react-native: ^7.0.2 => 7.0.2 dependencies: ^0.0.1 => 0.0.1 expo: ^49.0.0 => 49.0.0 expo-clipboard: ~4.3.0 => 4.3.0 expo-image-picker: ~14.3.1 => 14.3.1 expo-splash-screen: ~0.20.4 => 0.20.4 expo-status-bar: ~1.6.0 => 1.6.0 expo-updates: ~0.18.8 => 0.18.8 gradle: ^1.2.4 => 1.2.4 graphql: ^16.6.0 => 16.7.1 (15.8.0) ini: ^1.3.5 => 1.3.8 (3.0.1, 4.1.1) inquirer: ^6.5.1 => 6.5.2 (8.2.4) install: ^0.13.0 => 0.13.0 npm: ^9.1.2 => 9.8.0 react: 18.2.0 => 18.2.0 react-dom: 18.2.0 => 18.2.0 react-hook-form: ^7.37.0 => 7.45.1 react-live-clock: ^6.0.6 => 6.1.14 react-native: 0.72.1 => 0.72.1 react-native-get-random-values: ~1.8.0 => 1.8.0 react-native-make: ^1.0.1 => 1.0.1 react-native-picker: 4.0.3 => 4.0.3 react-native-really-awesome-button: ^2.0.3 => 2.0.4 react-native-reanimated: ~3.3.0 => 3.3.0 react-native-responsive-fontsize: ^0.5.1 => 0.5.1 react-native-safe-area-context: 4.6.3 => 4.6.3 react-native-screens: ~3.22.0 => 3.22.1 react-native-web: ~0.19.6 => 0.19.6 react-native-webview: 13.2.2 => 13.2.2 uuid: ^9.0.0 => 9.0.0 (3.4.0, 8.3.2, 7.0.3) whatwg-fetch: ^2.0.4 => 2.0.4 (3.6.2) npmGlobalPackages: npm: 9.7.2 ```

Describe the bug

If I run amplify update api and update my api key, after running amplify push i get this error: Deployment failed. Deploying root stack SocialMediaApp [ ==========------------------------------ ] 1/4 amplify-socialmediaapp-stagin… AWS::CloudFormation::Stack UPDATE_ROLLBACK_COMPLETE_CLEA… apiSocialMediaApp AWS::CloudFormation::Stack UPDATE_FAILED
storages3socialmediaappstorag… AWS::CloudFormation::Stack UPDATE_COMPLETE
authSocialMediaApp AWS::CloudFormation::Stack UPDATE_FAILED
Deployed api SocialMediaApp [ ======================================== ] 13/13

🛑 The following resources failed to deploy: Resource Name: authSocialMediaApp (AWS::CloudFormation::Stack) Event Type: update Reason: Parameters: [hostedUI] do not exist in the template URL: https://console.aws.amazon.com/cloudformation/home?region=us-west-1#/stacks/arn%3Aaws%3Acloudformation%3Aus-west-1%3A340844696662%3Astack%2Famplify-socialmediaapp-staging-11043%2F37571350-394a-11ed-a0aa-0249e3d09a1d/events

🛑 Resource is not in the state stackUpdateComplete

I have tried every other method possible, from "CreateAPIKey": 0 to manually adding an API key in the graphql interface, and i checked the various methods online, but in the end the push always fails with this same error.

Expected behavior

I expected the API Key to rotate.

Reproduction steps

  1. Run amplify update api
  2. Make changes to the graphQL API Key
  3. run amplify push

Code Snippet

// Put your code below this line.

Log output

``` // Put your logs below this line ```

aws-exports.js

No response

Manual configuration

/ eslint-disable / // WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.

const awsmobile = { "aws_project_region": "us-west-1", "aws_appsync_graphqlEndpoint": "https://uzg65om2zndhtnwfa4qwnrgc7a.appsync-api.us-west-1.amazonaws.com/graphql", "aws_appsync_region": "us-west-1", "aws_appsync_authenticationType": "API_KEY", "aws_appsync_apiKey": "da2-zydyqxmcrnhojctvdnuijbaata", "aws_cognito_identity_pool_id": "us-west-1:c5ca7116-4e3c-4119-bac9-840c558ccde5", "aws_cognito_region": "us-west-1", "aws_user_pools_id": "us-west-1_KyYUYtU9h", "aws_user_pools_web_client_id": "70lpo834a3snibile7ksa4jp99", "oauth": {}, "aws_cognito_username_attributes": [], "aws_cognito_social_providers": [], "aws_cognito_signup_attributes": [ "NAME", "EMAIL" ], "aws_cognito_mfa_configuration": "OFF", "aws_cognito_mfa_types": [ "SMS" ], "aws_cognito_password_protection_settings": { "passwordPolicyMinLength": 7, "passwordPolicyCharacters": [] }, "aws_cognito_verification_mechanisms": [ "EMAIL" ], "aws_user_files_s3_bucket": "socialmediaapp-storage-8135690111043-staging", "aws_user_files_s3_bucket_region": "us-west-1" };

export default awsmobile;

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

nadetastic commented 1 year ago

Hi @Arnav7501, thanks for opening this issue, since its related to the CLI, I'll transfer it over to the CLI repo for better assistance. Thanks1

Arnav7501 commented 1 year ago

My bad, made the issue in the wrong repo

josefaidt commented 1 year ago

Hey @Arnav7501 :wave: thanks for raising this! While the issue title alludes to an issue that is currently an active bug, I'm curious about this hostedUI missing parameter. Would you mind sharing the project ID output from amplify diagnose --send-report?

Arnav7501 commented 1 year ago

Project Identifier: 8741d2665676fac5a5554da0cf079d3b

josefaidt commented 1 year ago

Hey @Arnav7501 thanks for sending that over! Do you currently have an override applied to your auth resource?

Arnav7501 commented 1 year ago

not that i'm aware of

josefaidt commented 1 year ago

Hey @Arnav7501 looking at the report captured from diagnose the parameters and template seem fine for auth. If you visit the AWS CloudFormation Console and navigate to your project's root stack, are you able to see any errors from other resources? Were you able to recreate your GraphQL API key?

Arnav7501 commented 1 year ago

unfortunately, I'm still getting the same error image these are the stacks that are failing

josefaidt commented 1 year ago

Hey @Arnav7501 if you drill into that API stack what is the error you're seeing there?

Arnav7501 commented 1 year ago
image image
josefaidt commented 1 year ago

Hey @Arnav7501 can you try the workaround noted here to resolve the API key issue? https://github.com/aws-amplify/amplify-category-api/issues/636#issuecomment-1288164584

Arnav7501 commented 1 year ago

I already tried that workaround before opening the issue, gave the same error

josefaidt commented 1 year ago

Hey @Arnav7501 can you check for drift on your stack with the "Detect Drift" option under "Stack Actions" in the AWS CloudFormation console?

Arnav7501 commented 1 year ago

failedDrift

josefaidt commented 1 year ago

Hey @Arnav7501 what is the current status of the API key? Does your API currently have a valid API key? Taking a look at the files captured by diagnose I see hostedUI is properly noted in the cli-inputs.json and built CloudFormation template.

If you pull this project into a new sibling directory do you encounter the same issue?

josefaidt commented 1 year ago

Hey @Arnav7501 I wanted to follow-up here 🙂 are you still experiencing this?

josefaidt commented 1 year ago

Closing due to inactivity

github-actions[bot] commented 1 year ago

⚠️COMMENT VISIBILITY WARNING⚠️

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. If you wish to keep having a conversation with other community members under this issue feel free to do so.