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

Amplify Build failed with version 4.21.3 - Error: auth headless is missing the following inputParams googleAppIdUserPool, googleAppSecretUserPool #7194

Closed
contractorwolf opened this issue Nov 14, 2020 · 3 comments
Labels
to-be-reproduced Used in order for Amplify to reproduce said issue

Comments

@contractorwolf
Copy link

The app works fine locally and uses cognito with a federated login through google. Login works fine running on my local system, as does all the rest of the functionality. It is a simple VUE with just 2 pages but it uses auth, api, and has 2 cron'ed functions that work on the regular schedule. What I am trying to do is deploy my front end but the BUILD fails coming from github triggers on my master branch. Everytime I push to master it tries to deploy to AWS Amplify and I get this when it fails:

2020-11-14T01:03:53.764Z [WARNING]: - Fetching updates to backend environment: dev from the cloud.
2020-11-14T01:03:54.716Z [WARNING]: ✔ Successfully pulled backend environment dev from the cloud.
2020-11-14T01:03:54.758Z [WARNING]: ✖ There was an error initializing your environment.
2020-11-14T01:03:54.764Z [INFO]: Failed to pull the backend.
2020-11-14T01:03:54.766Z [INFO]: auth headless is missing the following inputParams googleAppIdUserPool, googleAppSecretUserPool
2020-11-14T01:03:54.804Z [INFO]: Error: auth headless is missing the following inputParams googleAppIdUserPool, googleAppSecretUserPool
                                 at updateConfigOnEnvInit (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-auth/src/provider-utils/awscloudformation/index.js:134:15)
                                 at /root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-auth/src/index.js:300:28
                                 at /root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/promise-sequential/index.js:16:18
                                 at process._tickCallback (internal/process/next_tick.js:68:7)
2020-11-14T01:03:54.820Z [ERROR]: !!! Build failed

(taken from the downloaded build logs.)

The backend functions and can be accessed when I hit it running the code locally, and I can see all of my data in DynamoDB, so I know the full backend is working. The front end just has an issue deploying. I saw in other comments the suggestion to add some configuration for the google account clientId to the team-provider-info.json file. I noticed that mine (hostedUIProviderCreds in amplifynewsscrapere0220fb9) was in a different format than the suggestion (googleClientId in Cognito node), neither seems to solve the issue:

        "categories": {
            "auth": {
                "amplifynewsscrapere0220fb9": {
                    "hostedUIProviderCreds": "[{\"ProviderName\":\"Google\",\"client_id\":\"XXXXXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com\",\"client_secret\":\"XXXXXXXXXX\"}]"
                },
                "Cognito": {
                    "googleClientId": "XXXXXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com"
                }
            }
        }

Other suggestions included:
sudo amplify init --amplify "{\"envName\":\"dev\"}" --categories "{\"auth\":{\"googleAppIdUserPool\":\"googleAppId\",\"googleAppSecretUserPool\":\"googleAppSecret\"}}" --yes
That executed fine but that also didnt seem to address the issue.

my aws-exports:
`
const awsmobile = {
"aws_project_region": "us-east-1",
"aws_appsync_graphqlEndpoint": "https://XXXXXXXXXXXXXXXXXXXXXXXXX.appsync-api.us-east-1.amazonaws.com/graphql",
"aws_appsync_region": "us-east-1",
"aws_appsync_authenticationType": "API_KEY",
"aws_appsync_apiKey": "XXXXXXXXXXXXXXXXXXXXXXXXX",
"aws_cognito_identity_pool_id": "us-east-1:XXXXXXXXXXXXXXXXXXXXXXXXX",
"aws_cognito_region": "us-east-1",
"aws_user_pools_id": "us-east-1_XXXXXXXXX",
"aws_user_pools_web_client_id": "XXXXXXXXXXXXXXXXXXXXXXXXX",
"oauth": {
"domain": "XXXXXXXXXXXXXXXXXXXXXXXXX-XXXXXXX-dev.auth.us-east-1.amazoncognito.com",
"scope": [
"phone",
"email",
"openid",
"profile",
"aws.cognito.signin.user.admin"
],
"redirectSignIn": "http://localhost:8080/",
"redirectSignOut": "http://localhost:8080/",
"responseType": "code"
},
"federationTarget": "COGNITO_USER_POOLS"
};

`
I would love a good explanation if anyone knows why this is failing. Any help or suggestions would be appreciated. Thanks!

@contractorwolf contractorwolf added the to-be-reproduced Used in order for Amplify to reproduce said issue label Nov 14, 2020
@contractorwolf contractorwolf changed the title Amplify Build failed with version 4.21.3 Error: auth headless is missing the following inputParams googleAppIdUserPool, googleAppSecretUserPool Amplify Build failed with version 4.21.3 - Error: auth headless is missing the following inputParams googleAppIdUserPool, googleAppSecretUserPool Nov 14, 2020
@contractorwolf
Copy link
Author

I found a solution that seemed to solve this for me. In the Amplify console I added the following environmental variables and their values (based on what I saw in another similar post):
AMPLIFY_GOOGLE_CLIENT_ID
AMPLIFY_GOOGLE_CLIENT_SECRET

In the Amplify web console, when you are looking at your project you should see the environmental variables section in the menu. I added the 2 above values in there and then pushed a minor code change up to kick off the build again and it was able to finish building this time without errors.

@amhinson
Copy link
Contributor

@contractorwolf Closing this issue for now, as it appear that you've solved your problem 🙂 Also, for any further help related to deploying your application to the Amplify Console, their repo would probably be a better place to open up an issue for a faster resolution.

@github-actions
Copy link

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

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
to-be-reproduced Used in order for Amplify to reproduce said issue
Projects
None yet
Development

No branches or pull requests

2 participants