-
Notifications
You must be signed in to change notification settings - Fork 116
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 import auth causes build failure - auth headless init is missing the following inputParams userPoolId, webClientId, nativeClientId #1271
Comments
I have the same issue with importing auth. I get it working with the script. It saved me. |
Got the same issue and the script fixed it! thanks! |
Also am seeing the same issue |
Thanks for the script. Unfortunately it didn't work for me (my I hope the Amplify console team can adopt the CI/CD soon to the new |
Also can confirm the same issue |
Just hit this issue as well. Two weeks and not even an acknowledgement from the AWS Amplify team? |
@tfmorris No contact yet from AWS Amplify team. |
@fujiwaka2408 @tfmorris @davegravy @morgler @patrickcze @marcioibm @OsenLiu @fujiwaka2408 apologies for the delayed response. Have you followed these instructions: https://docs.aws.amazon.com/amplify/latest/userguide/environment-variables.html#creating-a-new-backend-environment-with-authentication-parameters |
I have followed this one : https://docs.amplify.aws/cli/auth/import And all worked well except deployment in Amplify console as mentioned in this issue |
I did the same as @mlecoq. I'm importing/reusing a Cognito user pool defined in a different Amplify app. |
@tfmorris @mlecoq could you please follow these instructions as well: https://docs.aws.amazon.com/amplify/latest/userguide/environment-variables.html#creating-a-new-backend-environment-with-authentication-parameters |
@swaminator Yes, I have followed this instructions: https://docs.aws.amazon.com/amplify/latest/userguide/environment-variables.html#creating-a-new-backend-environment-with-authentication-parameters I added userPoolId, webClientId and nativeClientId to the environment variables from the Amplify Console and did So, I created |
Thanks for the workaround ! We also have the same issue after importing auth. However, even the environment variables added into the custom script were not available for us, so we needed to add them manually (either in the amplify.yml build file, or in the amplify console). |
@swaminator There's nothing on that page relevant to my configuration. I'm not using "social" signin, and besides, the auth config is totally defined in the user pool that I imported. @kevin-verschaeve You need to define those environment variables yourself to use the workaround from @fujiwaka2408. It worked for me, but I have too many apps & environments to go around settings all those environment variables by hand, so I updated the script to figure out this information on its own. Here's an improved workaround. If you add this line just before
The actual bug is in the Amplify CLI in some combination of |
resources is not created why I used this script. |
@guizler I modified backend:
phases:
preBuild:
commands:
- chmod u+x ./scripts/amplify-push.sh
build:
commands:
- ./scripts/amplify-push.sh
- amplify push --yes
# ... |
For anyone else running into this issue, all I had to do is add the following Environment Variables in AWS Amplify console. AMPLIFY_USERPOOL_ID I was receiving the same error when using |
@swaminator Has this been fixed? What version of the Amplify CLI has the fix? |
I fixed this by following @damianthekreeeytor 's advice, but had to add an environment variable for the identity pool as well: I could not find any mention of these variables in the documenation. |
Why is this closed??? This issue is still not resolved in 4.42.0 for me. Thank you @fujiwaka2408 for posting a workaround. |
If you have an amplify backend and frontend, it means you need your app to be detected as fullstack.
In order to have a fullstack amplify app, see my comment #448 (comment)
Now you can deploy 😸 |
what exactly is the AMPLIFY_NATIVECLIENT_ID? It looks like from the screenshot above in @FredrikMeyer post it could be the same as the AMPLIFY_AMAZON_CLIENT_ID, but I don't know where that value is coming from either |
I think it is one of the user pool clients. The one with a generated password. |
@FredrikMeyer you're right, it's the id of the app client which has a generated secret. |
Just a heads up: After moving the app to a monorepo the Amplify Console builds started inexplicably failing again for me without any related changes to the |
The issue still exists in |
Any suggestions on how to make this work for multiple environments? Setting the 3 environment variables (AMPLIFY_USERPOOL_ID, AMPLIFY_NATIVECLIENT_ID, AMPLIFY_WEBCLIENT_ID) was enough to get a continuous integration build working with CodeCommit. However, I have multiple environments (i.e. dev, beta, prod) and I'm trying to figure out how to have different values for each environment - currently they share the same environment variables. My amplify/team-provider-info.json file has an auth section per environment with attributes corresponding to the environment variables mentioned above (userPoolId, nativeClientId, webClientId). If amplify would use these values we would not need the environment variables and it would solve my issue of how to make this work for multiple environments. A suggestion to work around this amplify bug/missing-feature would be appreciated. |
I'll answer my own question here. Three solutions are ranked from best to worst:
|
I removed then imported a new auth then encountered the same problem. |
Amplify version 6.1.0 - still broken. |
I unsubscribed to this issue because I'm so blissfully happy with Vercel |
I just started a new Amplify project following these instructions https://docs.amplify.aws/cli/auth/import/ to test importing from an existing Cognito user pool and also hit the same problem. At the very least the documentation should be updated to explain the problem and the workaround. |
I just ran into the same issue and adding the environmental variables seems to have resolved it. However, I'm now seeing this error:
I'm running a React app on the frontend. Is there another missing env var? Full trace:
|
I have this problem too now. There are two open issues for this problem: #2306 #2251 |
Fortunately I was able to simply create a new Cognito pool to workaround the issue. I'm nevertheless always amazed at the lack of consistency and support of AWS technologies despite its overall success. |
Facing the same issue "The "path" argument must be of type string. Received undefined". Did you create the new user pool using aws cli or directly through aws console? I presume you must have set the environment variables accordingly afterwards to build the CI/CD using amplify |
Hello, we are facing the exactly same issue when imported an existing auth. |
Hi 👋🏽 @SriniSanthanam-energism @julienlaurent-migso @OskarD @kbokarius - apologies for the delay. For anyone running into the Ref: Related CLI Issue |
@hloriana since not even AWS Premium Support was able to help me in over a week's time, I today decided to delete the whole project and start all over again. It worked as long as I used the CLI to create and configure everything (Very labor intensive), until I added a simple default API and it suddenly couldn't push. I committed my Amplify changes to my repository, and the build server managed to deploy my Amplify configuration - so that was good. But now that I tried to set up the data modeling in the Amplify Admin UI, it tells me "auth headless is missing the following inputParams googleClientId.". I know I put it in the CLI when I added the Amplify Authentication configuration, and I know it's defined as an environment variable in my build environment, but I guess this thing has its own unconfigurable environment that doesn't use any of those? I'm starting to feel like I would have been better off using Vercel or just straight up a Raspberry Pi for deploying my product at this point. I wish you guys would make at least either the CLI or the UI work properly. Then I wouldn't have to spend half my development time trying to figure out all your edge cases and workarounds for bugs. I was hoping Amplify would be a way to speed up my development process, but I'm starting to feel that I'm just a beta tester for a 4 year old product that is never going to be ready for release. Maybe that's why it's released? I mean honestly, is my user flow such an anomaly? A JS web app that has Cognito and DataStore? I feel like that should be the type of project that Amplify was built for from the beginning. If this doesn't work, does anything? |
Hi @OskarD, thank you for providing your feedback on your experience with Amplify. We understand that you've experienced delays of increased development times and we would like to schedule a call with you to expedite solving the data modeling error with the Admin UI. Please reach out to [email protected] with your information so we can further assist you. |
I faced the same issue .I can only say that Amplify Sucks. Every step there is failure . Going to use Firebase for my app , better . |
The same issue here. Why is this issue closed? |
@ivantichy @chittasec we have reopened the issue. |
same issue for me, is there anything better then this script ? |
Does it mean I can't fix it while running only backend on Amplify? I have tried pretty much everything already except turning the app to fullstack. |
Ran into this with non-Amplify-console CI/CD as well (Gitlab). Had to add --categories with auth config detail to the build script. I'm surprised this info can't be pulled from team-provider-info.json. |
Still An issue with no current fix from either the Amplify team or AWS support. Is there any hope on this? @swaminator |
This issue still happens to me, I don't want to push version: 1
applications:
- backend:
phases:
build:
commands:
- '# Execute Amplify CLI with the helper script'
- sed -i '102s/CATEGORIES=""/CATEGORIES="{\\"auth\\":{\\"userPoolId\\":\\"${AMPLIFY_USERPOOL_ID}\\",\\"webClientId\\":\\"${AMPLIFY_WEBCLIENT_ID}\\",\\"nativeClientId\\":\\"${AMPLIFY_NATIVECLIENT_ID}\\"}}"/g' $(which amplifyPush)
- amplifyPush --environment staging --simple |
My problem was causes : solution:
solution 2(no modification of aws-export.js): |
Hi,
I used
amplify import auth
to import an existing Cognito UserPool into my project. I committed my code to git and pushed, which kicked off an Amplify Console pipeline, the build of the backend failed with the following error message.Error: auth headless init is missing the following inputParams userPoolId, webClientId, nativeClientId
Since
amplify push
worked fine from the local machine, I expected the build and deployment in the amplify console to work fine as well.In this Issue, you will see similar errors for parameters such as facebookAppId, amazonAppId, googleClientId, etc. They had added these parameters as environment variables to amplifyPush.sh. So I added error inputParams as environment variables and the build was successful.
This problem occurs only when I do
amplify import auth
(notamplify add auth
).Is it because the environment variables in the shell script are missing, i.e., the shell script does not yet support import auth? Or are there other possible causes?
Here is the actual script (myamplifyPush.sh) that I used.
In addition, I added three environment variables to the Amplify Console (AMPLIFY_USERPOOL_ID, AMPLIFY_WEBCLIENT_ID, and AMPLIFY_NATIVECLIENT_ID) and wrote
amplify.yml
as followsAny insight is always appreciated.
The text was updated successfully, but these errors were encountered: