-
Notifications
You must be signed in to change notification settings - Fork 824
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amplify pull failed: auth headless is missing the following inputParams googleAppIdUserPool, googleAppSecretUserPool #9176
Comments
Hey @JackPenney 👋 thanks for raising this! On the latest version of the CLI (7.6.2) I was able to reproduce using the following steps:
|
If any of you could provide your |
@JackPenney Can you confirm if this workflow is working with the latest version? |
Hey @ganipcanot @ammarkarachi I've updated to CLI v7.6.3 and ran
|
Is the bug resolved? I am facing with this issue |
@josefaidt Can we please get an escalation of this issue? This issue seems to still be occurring and is preventing us from having automatic pulling of configurations via |
I'm also being me with limited success using sh pull.sh 1 ✘ 5s
Amplify AppID found: d3xxxxxxxxxxju. Amplify App name is: exampleApp
Backend environment sandbox found in Amplify Console app: exampleApp
✔ Successfully pulled backend environment sandbox from the cloud.
✖ There was an error initializing your environment.
🛑 Could not initialize categories for 'sandbox': auth headless is missing the following inputParams userPoolId, webClientId, nativeClientId, identityPoolId
Resolution: Review the error message and stack trace for additional information.
Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/ pull.sh #!/bin/bash
set -e
IFS='|'
REACTCONFIG="{\
\"SourceDir\":\"src\",\
\"DistributionDir\":\"build\",\
\"BuildCommand\":\"npm run-script build\",\
\"StartCommand\":\"npm run-script start\"\
}"
AWSCLOUDFORMATIONCONFIG="{\
\"configLevel\":\"project\",\
\"useProfile\":true,\
\"profileName\":\"default\"\
}"
AMPLIFY="{\
\"projectName\":\"headlessProjectName\",\
\"appId\":\"d3xxxxxxxxxxju\",\
\"envName\":\"sandbox\",\
\"defaultEditor\":\"code\"\
}"
FRONTEND="{\
\"frontend\":\"javascript\",\
\"framework\":\"react\",\
\"config\":$REACTCONFIG\
}"
PROVIDERS="{\
\"awscloudformation\":$AWSCLOUDFORMATIONCONFIG\
}"
amplify pull \
--amplify $AMPLIFY \
--frontend $FRONTEND \
--providers $PROVIDERS \
--yes As mentioned, no issues when it is not headless: amplify pull --appId d3xxxxxxxxxxju --envName sandbox 1 ✘ 5s
? Select the authentication method you want to use: AWS profile
For more information on AWS Profiles, see:
https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html
? Please choose the profile you want to use default
Amplify AppID found: d3ihuduewsr9ju. Amplify App name is: exampleApp
Backend environment sandbox found in Amplify Console app: exampleApp
? Choose your default editor: Visual Studio Code
? Choose the type of app that you're building javascript
Please tell us about your project
? What javascript framework are you using react
? Source Directory Path: src
? Distribution Directory Path: build
? Build Command: npm run-script build
? Start Command: npm run-script start
? Do you plan on modifying this backend? No
✅ Added backend environment config object to your project.
Run 'amplify pull' to sync future upstream changes. |
The only way that I have been able to get around this is to export the configuration of each environment inside a folder in my project: -- amplifyconfiguration-dev.dart Then, the build process picks up and replaces the amplifyconfiguration file in the root directory of the project before proceeding with the build. While this does function, it is a HUGE limitation because if any configuration details get added/removed/changed in the amplifyconfiguration, it requires the developer to recreate the configuration file and drop it in the correct location before deploying a specific version. I wanted people to have an, albeit ugly and not something I would recommend, workaround versus deployments of different Amplify environments simply not working. Especially when using CI/CD. |
Facing the same issue with amplify-cli 10.7.1. |
Interesting callout @hanna-becker . I have never thought about specific resources impacting this. We also have a Lambda layer in our infrastructure, but have from the beginning (and this process has never worked) ^FYI @danielleadams -> In case you need a starting point. |
Actually I edited my comment because I remembered we're still on 7.3.1 in our prod env without a lambda layer. I tested there and it produced the same error, so I suppose it's unrelated. |
I've found the solution for this problem. Based on: https://docs.amplify.aws/cli/usage/headless/#--categories You can add configurations for the different categories on the init script. Here's the script suggested in the docs: #!/bin/bash
set -e
IFS='|'
REACTCONFIG="{\
\"SourceDir\":\"src\",\
\"DistributionDir\":\"build\",\
\"BuildCommand\":\"npm run-script build\",\
\"StartCommand\":\"npm run-script start\"\
}"
AWSCLOUDFORMATIONCONFIG="{\
\"configLevel\":\"project\",\
\"useProfile\":false,\
\"profileName\":\"default\",\
\"accessKeyId\":\"headlessaccesskeyid\",\
\"secretAccessKey\":\"headlesssecrectaccesskey\",\
\"region\":\"us-east-1\"\
}"
AMPLIFY="{\
\"projectName\":\"headlessProjectName\",\
\"envName\":\"myenvname\",\
\"defaultEditor\":\"code\"\
}"
FRONTEND="{\
\"frontend\":\"javascript\",\
\"framework\":\"react\",\
\"config\":$REACTCONFIG\
}"
PROVIDERS="{\
\"awscloudformation\":$AWSCLOUDFORMATIONCONFIG\
}"
amplify init \
--amplify $AMPLIFY \
--frontend $FRONTEND \
--providers $PROVIDERS \
--yes From https://docs.amplify.aws/cli/usage/headless/#sample-script We can add to that script the "auth" category as it suggests in https://docs.amplify.aws/cli/usage/headless/#--categories: #!/bin/bash
set -e
IFS='|'
REACTCONFIG="{\
\"SourceDir\":\"src\",\
\"DistributionDir\":\"build\",\
\"BuildCommand\":\"npm run-script build\",\
\"StartCommand\":\"npm run-script start\"\
}"
AWSCLOUDFORMATIONCONFIG="{\
\"configLevel\":\"project\",\
\"useProfile\":false,\
\"profileName\":\"default\",\
\"accessKeyId\":\"headlessaccesskeyid\",\
\"secretAccessKey\":\"headlesssecrectaccesskey\",\
\"region\":\"us-east-1\"\
}"
AMPLIFY="{\
\"projectName\":\"headlessProjectName\",\
\"envName\":\"myenvname\",\
\"defaultEditor\":\"code\"\
}"
FRONTEND="{\
\"frontend\":\"javascript\",\
\"framework\":\"react\",\
\"config\":$REACTCONFIG\
}"
PROVIDERS="{\
\"awscloudformation\":$AWSCLOUDFORMATIONCONFIG\
}"
AUTHCONFIG="{\
\"userPoolId\": \"myproject-userpool-id\",\
\"webClientId\": \"appid-web\",\
\"nativeClientId\": \"appid-native\",\
\"identityPoolId\": \"myproject-idp-poolid\"\
}"
CATEGORIES="{\
\"auth\":$AUTHCONFIG\
}"
amplify init \
--amplify $AMPLIFY \
--frontend $FRONTEND \
--providers $PROVIDERS \
--categories $CATEGORIES \
--yes (Notice how i added the The error message complains about #!/bin/bash
set -e
IFS='|'
REACTCONFIG="{\
\"SourceDir\":\"src\",\
\"DistributionDir\":\"build\",\
\"BuildCommand\":\"npm run-script build\",\
\"StartCommand\":\"npm run-script start\"\
}"
AWSCLOUDFORMATIONCONFIG="{\
\"configLevel\":\"project\",\
\"useProfile\":false,\
\"profileName\":\"default\",\
\"accessKeyId\":\"headlessaccesskeyid\",\
\"secretAccessKey\":\"headlesssecrectaccesskey\",\
\"region\":\"us-east-1\"\
}"
AMPLIFY="{\
\"projectName\":\"headlessProjectName\",\
\"envName\":\"myenvname\",\
\"defaultEditor\":\"code\"\
}"
FRONTEND="{\
\"frontend\":\"javascript\",\
\"framework\":\"react\",\
\"config\":$REACTCONFIG\
}"
PROVIDERS="{\
\"awscloudformation\":$AWSCLOUDFORMATIONCONFIG\
}"
AUTHCONFIG="{\
\"userPoolId\": \"myproject-userpool-id\",\
\"webClientId\": \"appid-web\",\
\"nativeClientId\": \"appid-native\",\
\"identityPoolId\": \"myproject-idp-poolid\"\,\
\"googleAppIdUserPool\": \"my-google-client-id\"\,\
\"googleAppSecretUserPool\": \"my-google-client-secret\"\
}"
CATEGORIES="{\
\"auth\":$AUTHCONFIG\
}"
amplify init \
--amplify $AMPLIFY \
--frontend $FRONTEND \
--providers $PROVIDERS \
--categories $CATEGORIES \
--yes And the init command runs successfully. I've tested it in Github Actions and runs fine. |
Closing as fix released with v12.0.0 |
|
problem: [Amplify pull failed: auth headless is missing the following inputParams googleAppIdUserPool, googleAppSecretUserPool] problem: [Amplify pull failed: auth headless is missing the following inputParams googleClientId] problem: https://xxxxxxx-dev.auth.ap-southeast-1.amazoncognito.com/error?error=redirect_mismatch&client_id=xxxxx |
Before opening, please confirm:
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
12.18.4
Amplify CLI Version
7.5.4
What operating system are you using?
Windows
Amplify Categories
auth
Amplify Commands
pull
Describe the bug
While working in my dev environment I ran
amplify pull -y
which gave me the errorauth headless is missing the following inputParams googleAppIdUserPool, googleAppSecretUserPool
I've made no pending changes and ran a pull to make sure everything is up to date
Running
amplify pull --appId ***** --envName localdev
works but if i try to do a standardamplify pull
afterwards the error comes backTried running
amplify update auth
without changing any of my OAuth settings just in case the update triggers a fix for newer versions but no luckThere's an old issue for this here: aws-amplify/amplify-js#7194 and I already have the environment variables AMPLIFY_GOOGLE_CLIENT_ID and AMPLIFY_GOOGLE_CLIENT_SECRET setup which was the suggested solution
I'm not on the latest version of amplify, been told to stick to 7.5.4 as there's issues in the later versions that are also having an impact
Expected behavior
I expect it to pull and apply the changes from my environment
Reproduction steps
run
amplify pull
GraphQL schema(s)
No response
Log output
Additional information
No response
The text was updated successfully, but these errors were encountered: