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

@aws-amplify/[email protected] breaks build: Failed to pull the backend. auth headless is missing the following inputParams facebookAppIdUserPool, facebookAppSecretUserPool, googleAppIdUserPool, googleAppSecretUserPool #4790

Closed
bwalsh opened this issue Jul 9, 2020 · 15 comments
Assignees
Labels
pending-triage Issue is pending triage platform Issues tied to the general CLI platform

Comments

@bwalsh
Copy link

bwalsh commented Jul 9, 2020

Describe the bug
Version change broke our production deploy

Amplify CLI Version
@aws-amplify/[email protected]

To Reproduce

  phases:	  phases:
    build:	    build:
      commands:
        - npm install -g @aws-amplify/cli
        - amplify pull --providers '{"awscloudformation":{"configLevel":"project","useProfile":true,"profileName":"default"}}' --appId ${BACKEND_APP_ID} --envName ${BACKEND_APP_ENV} --yes

Expected behavior
The pull command to complete

Screenshots

                                 # Starting phase: build
                                 # Executing command: npm install -g @aws-amplify/cli
2020-07-09T22:44:32.415Z [WARNING]: npm WARN deprecated [email protected]: Merge GraphQL Schemas has been deprecated and merged into GraphQL Tools, so it will no longer get updates. Use GraphQL Tools instead to stay up-to-date! Check out https://www.graphql-tools.com/docs/migration-from-merge-graphql-schemas for migration and https://the-guild.dev/blog/graphql-tools-v6 for new changes.
2020-07-09T22:44:33.527Z [WARNING]: npm WARN deprecated @graphql-toolkit/[email protected]: GraphQL Toolkit is deprecated and merged into GraphQL Tools, so it will no longer get updates. Use GraphQL Tools instead to stay up-to-date! Check out https://www.graphql-tools.com/docs/migration-from-toolkit for migration and https://the-guild.dev/blog/graphql-tools-v6 for new changes.
2020-07-09T22:44:35.114Z [WARNING]: npm WARN deprecated @graphql-toolkit/[email protected]: GraphQL Toolkit is deprecated and merged into GraphQL Tools, so it will no longer get updates. Use GraphQL Tools instead to stay up-to-date! Check out https://www.graphql-tools.com/docs/migration-from-toolkit for migration and https://the-guild.dev/blog/graphql-tools-v6 for new changes.
2020-07-09T22:44:35.673Z [WARNING]: npm WARN deprecated @graphql-toolkit/[email protected]: GraphQL Toolkit is deprecated and merged into GraphQL Tools, so it will no longer get updates. Use GraphQL Tools instead to stay up-to-date! Check out https://www.graphql-tools.com/docs/migration-from-toolkit for migration and https://the-guild.dev/blog/graphql-tools-v6 for new changes.
2020-07-09T22:44:39.326Z [WARNING]: npm WARN
2020-07-09T22:44:39.328Z [WARNING]: deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
2020-07-09T22:44:41.184Z [WARNING]: npm WARN deprecated [email protected]: GraphQL Import has been deprecated and merged into GraphQL Tools, so it will no longer get updates. Use GraphQL Tools instead to stay up-to-date! Check out https://www.graphql-tools.com/docs/migration-from-import for migration and https://the-guild.dev/blog/graphql-tools-v6 for new changes.
2020-07-09T22:44:43.483Z [WARNING]: npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
2020-07-09T22:44:59.670Z [INFO]: /root/.nvm/versions/node/v10.16.0/bin/amplify -> /root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/bin/amplify
2020-07-09T22:44:59.748Z [INFO]: > [email protected] postinstall /root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-graphql-types-generator/node_modules/core-js
                                 > node -e "try{require('./postinstall')}catch(e){}"
2020-07-09T22:44:59.811Z [INFO]: �[96mThank you for using core-js (�[94m https://github.com/zloirock/core-js �[96m) for polyfilling JavaScript standard library!�[0m
                                 �[96mThe project needs your help! Please consider supporting of core-js on Open Collective or Patreon: �[0m
                                 �[96m>�[94m https://opencollective.com/core-js �[0m
                                 �[96m>�[94m https://www.patreon.com/zloirock �[0m
                                 �[96mAlso, the author of core-js (�[94m https://github.com/zloirock �[96m) is looking for a good job -)�[0m
2020-07-09T22:44:59.820Z [INFO]: > [email protected] postinstall /root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/core-js
                                 > node -e "try{require('./postinstall')}catch(e){}"
2020-07-09T22:44:59.882Z [INFO]: > [email protected] postinstall /root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/core-js-pure
                                 > node -e "try{require('./postinstall')}catch(e){}"
2020-07-09T22:44:59.986Z [INFO]: > [email protected] postinstall /root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/ejs
                                 > node --harmony ./postinstall.js
2020-07-09T22:45:00.045Z [INFO]: Thank you for installing �[35mEJS�[0m: built with the �[32mJake�[0m JavaScript build tool (�[32mhttps://jakejs.com/�[0m)
2020-07-09T22:45:00.049Z [INFO]: > @aws-amplify/[email protected] postinstall /root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli
                                 > node scripts/post-install.js
2020-07-09T22:45:00.225Z [INFO]: 
2020-07-09T22:45:00.227Z [INFO]: ----------------------------------------
2020-07-09T22:45:00.227Z [INFO]: Successfully installed the Amplify CLI
                                 ----------------------------------------
                                 JavaScript Getting Started - https://docs.amplify.aws/start
                                 Android Getting Started - https://docs.amplify.aws/start/q/integration/android
                                 iOS Getting Started - https://docs.amplify.aws/start/q/integration/ios
2020-07-09T22:45:00.239Z [WARNING]: npm
2020-07-09T22:45:00.239Z [WARNING]: WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/@aws-amplify/cli/node_modules/chokidar/node_modules/fsevents):
                                    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
                                    npm WARN [email protected] requires a peer of inquirer@^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
                                    npm WARN [email protected] requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
                                    npm WARN
2020-07-09T22:45:00.240Z [WARNING]: [email protected] requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.
2020-07-09T22:45:00.241Z [INFO]: + @aws-amplify/[email protected]
                                 added 397 packages from 212 contributors, removed 1555 packages, updated 297 packages and moved 65 packages in 40.275s
2020-07-09T22:45:00.271Z [INFO]: # Executing command: amplify pull --providers '{awscloudformation:{configLevel:project,useProfile:true,profileName:default}}' --appId XXXXXXxjq1 --envName prod --yes
2020-07-09T22:45:01.060Z [INFO]: Scanning for plugins...
2020-07-09T22:45:01.096Z [INFO]: Plugin scan successful
2020-07-09T22:45:05.270Z [INFO]: For more information on AWS Profiles, see:
2020-07-09T22:45:05.271Z [INFO]: https://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html
2020-07-09T22:45:05.934Z [INFO]: Amplify AppID found: XXXXXXxjq1. Amplify App name is: XXX-prod
2020-07-09T22:45:06.125Z [INFO]: Backend environment prod found in Amplify Console app: XXX-prod
2020-07-09T22:45:06.269Z [INFO]: 
2020-07-09T22:45:06.270Z [WARNING]: - Fetching updates to backend environment: prod from the cloud.
2020-07-09T22:45:06.797Z [WARNING]: ✖ There was an error pulling the backend environment prod.
2020-07-09T22:45:06.798Z [INFO]: Failed to pull the backend.
                                 auth headless is missing the following inputParams facebookAppIdUserPool, facebookAppSecretUserPool, googleAppIdUserPool, googleAppSecretUserPool
2020-07-09T22:45:06.799Z [INFO]: Error: auth headless is missing the following inputParams facebookAppIdUserPool, facebookAppSecretUserPool, googleAppIdUserPool, googleAppSecretUserPool
                                 at updateConfigOnEnvInit (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-auth/provider-utils/awscloudformation/index.js:370:15)
                                 at /root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-auth/index.js:240: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-07-09T22:45:06.811Z [ERROR]: !!! Build failed
2020-07-09T22:45:06.923Z [ERROR]: !!! Non-Zero Exit Code detected
2020-07-09T22:45:06.924Z [INFO]: # Starting environment caching...
2020-07-09T22:45:06.924Z [INFO]: # Environment caching completed
Terminating logging...

Desktop (please complete the following information):
NA default build container

@bwalsh
Copy link
Author

bwalsh commented Jul 9, 2020

workaround: fallback to 4.21.3

    build:
      commands:
        - npm install -g @aws-amplify/[email protected]
        - amplify pull --providers '{"awscloudformation":{"configLevel":"project","useProfile":true,"profileName":"default"}}' --appId ${BACKEND_APP_ID} --envName ${BACKEND_APP_ENV} --yes

@jhockett jhockett added pending-triage Issue is pending triage platform Issues tied to the general CLI platform labels Jul 9, 2020
@SwaySway
Copy link
Contributor

SwaySway commented Jul 9, 2020

Hello @bwalsh
Do you have HostedUI setup in your project?

@jasonergle
Copy link

I am suddenly getting the same error.

@davidmfox
Copy link

yep me too

@SwaySway
Copy link
Contributor

SwaySway commented Jul 9, 2020

Previous builds with the CLI would fail on a push as the social provider credentials were not available in the project on doing a pull. This was an issue in #3642 by adding those hosted credentials on a pull this would avoid a failed push.
You can provide the social credentials using this example here: #3642 (comment)

Ref Issues
#3642
aws-amplify/amplify-hosting#206

@davidmfox
Copy link

My fix:

    build:
      commands:
        - '# Execute Amplify CLI with the helper script'
        - amplifyPush --simple

Then in the Amplify console add the environment variables:

AMPLIFY_AMAZON_CLIENT_ID
AMPLIFY_AMAZON_CLIENT_SECRET
AMPLIFY_FACEBOOK_CLIENT_ID
AMPLIFY_FACEBOOK_CLIENT_SECRET
AMPLIFY_GOOGLE_CLIENT_ID
AMPLIFY_GOOGLE_CLIENT_SECRET

@bwalsh
Copy link
Author

bwalsh commented Jul 10, 2020

Hello @bwalsh
Do you have HostedUI setup in your project?

@SwaySway Yes. We use the HostedUI

@bwalsh
Copy link
Author

bwalsh commented Jul 10, 2020

Puzzled. Why client id's and secrets needed when they already exist in cognito? Thought the point of pull was to retrieve that from stack. Our build simply deploys the app, does not make changes to auth.

@geoseong
Copy link

same here. my temp solution was to downgrade cli version to 4.20. and I also submitted the issue #4806.

@geoseong
Copy link

geoseong commented Jul 13, 2020

I finally resolved that issue. even though it is temp fix... here is my comment in issue

@SwaySway
Copy link
Contributor

@bwalsh Correct though to change credentials we expose this value. We realize this workflow isn't convenient as you would need to resend the credentials. In the long term we are looking at changing this, as noted in aws-amplify/amplify-hosting#206 (comment).

Closing this issue. Should you experience any other issues related to the auth config on the CLI please comment below to re-open.

@nipoonp
Copy link

nipoonp commented Jul 17, 2020

My fix:

    build:
      commands:
        - '# Execute Amplify CLI with the helper script'
        - amplifyPush --simple

Then in the Amplify console add the environment variables:

AMPLIFY_AMAZON_CLIENT_ID
AMPLIFY_AMAZON_CLIENT_SECRET
AMPLIFY_FACEBOOK_CLIENT_ID
AMPLIFY_FACEBOOK_CLIENT_SECRET
AMPLIFY_GOOGLE_CLIENT_ID
AMPLIFY_GOOGLE_CLIENT_SECRET

Worked for me!

@karrettgelley
Copy link

karrettgelley commented Jul 18, 2020

Same issue. Using social federation with facebook, google, and amazon. Never had this issue until upgrading recently. I believe it was 4.22 that broke my code. The credentials were properly set up through the cli and have not changed since. I have CD set up through the amplify console. Again, not sure why my pushes are failing now since they never have before. If anyone could elaborate on whether or not this will be fixed, or if in fact this is not a bug, that'd be great

edit: I was able to temporarily fix this issue in a similar way as @bwalsh
I simply edited the _LIVE_UPDATES environment variable in the environment variables tab of the amplify console

Before

_LIVE_UPDATES [{"name":"Amplify CLI","pkg":"@aws-amplify/cli","type":"npm","version":"latest"}]

After

_LIVE_UPDATES [{"name":"Amplify CLI","pkg":"@aws-amplify/cli","type":"npm","version":"4.21.3"}]

@mjza
Copy link

mjza commented Dec 22, 2020

@nipoonp

Hi there, how did you generate the values for the following variables?

AMPLIFY_AMAZON_CLIENT_ID
AMPLIFY_AMAZON_CLIENT_SECRET
AMPLIFY_FACEBOOK_CLIENT_ID
AMPLIFY_FACEBOOK_CLIENT_SECRET
AMPLIFY_GOOGLE_CLIENT_ID
AMPLIFY_GOOGLE_CLIENT_SECRET

@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 for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pending-triage Issue is pending triage platform Issues tied to the general CLI platform
Projects
None yet
Development

No branches or pull requests

9 participants