Skip to content
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

Error: auth headless is missing the following inputParams userPoolId, webClientId, nativeClientId, identityPoolI #2039

Closed
4 tasks done
wvidana opened this issue Jul 9, 2021 · 9 comments
Labels

Comments

@wvidana
Copy link

wvidana commented Jul 9, 2021

Before opening, please confirm:

App Id

d59j1tvmglhyl

Region

eu-west-1

Amplify Console feature

Backend builds

Describe the bug

It is not possible to deploy the backend with an imported Auth component, the CI/CD build fails with:

Error: auth headless is missing the following inputParams userPoolId, webClientId, nativeClientId, identityPoolId

Locally pushing the changes with amplify push causes no error. The information is in there, in some config files, is just that the deployment in the Amplify console is not reading it correctly.

I'm trying to figure out if there is something missing in the amplifyPush.sh script, but the one in this repository seems outdated 🤷

Expected behavior

The full-stack app gets deployed correctly without errors

Reproduction steps

  1. Import a cognito user pool and identity pool with amplify import auth
  2. Push with amplify push to apply the changes
  3. Commit your changes and wait for the CI/CD to start the build in the Amplify console
  4. ...ERROR

Build Settings

No response

Additional information

No response

@github-actions
Copy link

github-actions bot commented Jul 9, 2021

Hi 👋, thanks for opening! While we look into this...

If this issue is related to custom domains, be sure to check the custom domains troubleshooting guide to see if that helps. Also, there is a more general troubleshooting FAQ that may be helpful for other questions.

Lastly, please make sure you've specified the App ID and Region in the issue!

@wvidana
Copy link
Author

wvidana commented Jul 9, 2021

Adding env vars and using them in amplipyPush.sh seems to fix the issue:

Diff from https://github.com/aws-amplify/amplify-console/blob/081895f49291f3c1508c63ae68d42bc09a846ab9/scripts/amplifyPush.sh

 }"
 CATEGORIES=""
 if [[ -z ${AMPLIFY_FACEBOOK_CLIENT_ID} && -z ${AMPLIFY_GOOGLE_CLIENT_ID} && -z ${AMPLIFY_AMAZON_CLIENT_ID} ]]; then
-    CATEGORIES=""
+    if [[ -z ${AMPLIFY_USERPOOL_ID} && -z ${AMPLIFY_WEBCLIENT_ID} && -z ${AMPLIFY_NATIVECLIENT_ID} && -z ${AMPLIFY_IDENTITYPOOL_ID} ]]; then
+        CATEGORIES=""
+    else
+        AUTHCONFIG="{\
+        \"userPoolId\":\"${AMPLIFY_USERPOOL_ID}\",\
+        \"webClientId\":\"${AMPLIFY_WEBCLIENT_ID}\",\
+        \"nativeClientId\":\"${AMPLIFY_NATIVECLIENT_ID}\"\
+        \"identityPoolId\":\"${AMPLIFY_IDENTITYPOOL_ID}\"\
+        }"
+        CATEGORIES="{\
+        \"auth\":$AUTHCONFIG\
+        }"
+    fi
 else
     AUTHCONFIG="{\
     \"facebookAppIdUserPool\":\"${AMPLIFY_FACEBOOK_CLIENT_ID}\",\

The problem is that depending on the environment this values changes... Is there anyway of loading them from team-profider-info.json or just make the script load them like the amplify push command?

@eddiekeller
Copy link

I have the same issue but going in reverse - I created a backend via the console and am trying to pull it down.

#2040

@Narrator
Copy link
Contributor

Narrator commented Dec 1, 2021

@wvidana Please refer to this comment. Our docs need to be updated, but the solution is to provide the missing values via environment variables in the app's build settings.

Please see here for all available environment variables.

@ghost ghost added the bug Something isn't working label Dec 3, 2021
@bmccann36
Copy link

bmccann36 commented May 3, 2022

I am having the exact same issue as described
setting these env vars does not resolve the issue for me

@Narrator
Copy link
Contributor

@bmccann36 Could you please share your app id and region?

@tjordanahp
Copy link

tjordanahp commented May 19, 2022

Testing out Auth with Amplify, the same issue.

Following the documents here: https://docs.amplify.aws/start/getting-started/installation/q/integration/vue/

When I got to the add "Add authentication", then ran this command [ amplify add auth ], the build failed after a push. The build error is below.

@Narrator If you want, I'll keep the App Id: d2lervtrgi1bea up. Region: us-east-1

2022-05-19T04:17:58.049Z [INFO]: �[0mAmplify AppID found: d2lervtrgi1bea. Amplify App name is: ahpreports�[0m
2022-05-19T04:17:58.099Z [INFO]: �[0mBackend environment dev found in Amplify Console app: ahpreports�[0m
2022-05-19T04:17:58.701Z [WARNING]: - Fetching updates to backend environment: dev from the cloud.
2022-05-19T04:17:59.243Z [WARNING]: - Building resource auth/ahpreports
2022-05-19T04:17:59.285Z [WARNING]: ✔ Successfully pulled backend environment dev from the cloud.
2022-05-19T04:17:59.298Z [WARNING]: ✖ There was an error initializing your environment.
2022-05-19T04:17:59.300Z [INFO]: �[31mFailed to pull the backend.�[39m
2022-05-19T04:17:59.302Z [INFO]: 🛑 auth headless is missing the following inputParams userPoolId, webClientId, nativeClientId
2022-05-19T04:17:59.302Z [INFO]: Error: auth headless is missing the following inputParams userPoolId, webClientId, nativeClientId
at ensureHeadlessParameters (/snapshot/repo/build/node_modules/@aws-amplify/amplify-category-auth/lib/provider-utils/awscloudformation/import/index.js:877:15)
at headlessImport (/snapshot/repo/build/node_modules/@aws-amplify/amplify-category-auth/lib/provider-utils/awscloudformation/import/index.js:782:42)
at importedAuthEnvInit (/snapshot/repo/build/node_modules/@aws-amplify/amplify-category-auth/lib/provider-utils/awscloudformation/import/index.js:633:49)
at async updateConfigOnEnvInit (/snapshot/repo/build/node_modules/@aws-amplify/amplify-category-auth/lib/provider-utils/awscloudformation/index.js:36:76)
at async /snapshot/repo/build/node_modules/@aws-amplify/amplify-category-auth/lib/index.js:272:28
2022-05-19T04:17:59.318Z [ERROR]: !!! Build failed

@tjordanahp
Copy link

tjordanahp commented May 20, 2022

Okay, so I figured it out. For my issues, I just added the variables to the "Environment variables" settings within the Amplify app settings.

@Narrator provided the web page Please see here for all available environment variables.

Some of the documentation doesn't make this clear. This was more of stubble into the answer and what if I do this and that to get this to work.

image

@ghost ghost added documentation and removed bug Something isn't working labels May 24, 2022
@Narrator Narrator closed this as completed Jun 6, 2022
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot added the archived This issue has been locked. label Oct 28, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants