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

Github action failed to pull environment: Error: auth headless is missing the following inputParams facebookAppIdUserPool, facebookAppSecretUserPool, googleAppIdUserPool, googleAppSecretUserPool #12

Open
dcfranca opened this issue Jul 7, 2020 · 6 comments

Comments

@dcfranca
Copy link

dcfranca commented Jul 7, 2020

Note: If your issue/bug is regarding the AWS Amplify Console service, please log it in the
Amplify Console GitHub Issue Tracker

Describe the bug
My Github Action is failing to pull the environment backend

It is failing on the following command:

    # Setup Amplify
    - name: configure amplify
      uses: ambientlight/[email protected]
      with:
        amplify_command: configure
        amplify_env: dev
      env:
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        AWS_REGION: us-xxxx

This command is giving the output:

amplify version Scanning for plugins...
Plugin scan successful
4.23.0
found existing environment dev
- Fetching updates to backend environment: dev from the cloud.
✔ Successfully pulled backend environment dev from the cloud.
✖ There was an error pulling the backend environment dev.
auth headless is missing the following inputParams facebookAppIdUserPool, facebookAppSecretUserPool, googleAppIdUserPool, googleAppSecretUserPool
Error: auth headless is missing the following inputParams facebookAppIdUserPool, facebookAppSecretUserPool, googleAppIdUserPool, googleAppSecretUserPool
    at updateConfigOnEnvInit (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-auth/provider-utils/awscloudformation/index.js:370:15)
    at /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-auth/index.js:240:28
    at /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/promise-sequential/index.js:16:18
    at process._tickCallback (internal/process/next_tick.js:68:7)

There is a similar issue with the Amplify Console, however, there is a workaround with a custom version of amplifypush: aws-amplify/amplify-hosting#206

But it doesn't seem to be this case, I imagine that I should pass it to the action, but it doesn't have any documentation regarding it: https://github.com/marketplace/actions/amplify-cli-action

There are 2 changes that I have done that could have been the culprit of this error:

  1. Updated amplify-cli to 4.22.0, but it seems that the version running on Github actions is different anyway.
  2. Added more redirect urls to authentication, using a similar solution as the last one listed here

When I run pull/push locally it works fine

I also have seen a recent commit that might be related: aws-amplify/amplify-cli#4684
But I'm not sure.

Looking at the code of the action: https://github.com/ambientlight/amplify-cli-action/blob/master/entrypoint.sh
It looks like it might be needed to add smt similar to what was added to myamplifypush
Something like:

AUTHCONFIG="{\
\"googleAppIdUserPool\":\"${GOOGLE_CLIENT_ID}\",\
\"googleAppSecretUserPool\":\"${GOOGLE_CLIENT_SECRET}\",\
\"facebookAppIdUserPool\":\"${FACEBOOK_APP_ID}\",\
\"facebookAppSecretUserPool\":\"${FACEBOOK_APP_SECRET}\"\
}"

But again, I'm not sure, and I wonder why this error started happening only now?

I thought about also removing the redirect URLs I have added, but the amplify-cli doesn't give an option to remove them, only Add/Edit

Amplify CLI Version
You can use amplify -v to check the amplify cli version on your system
4.22.0

To Reproduce
Steps to reproduce the behavior or terminal output if applicable

  • Have a project with authentication and social logins (Facebook/Google)
  • Add different redirect URLs (dev/staging/production) for the oAuth workflow
  • Create a workflow on Github Action, using ambientlight/[email protected] to pull your environment
  • Commit/push your changes to Github

Expected behavior
The Github action should run the pull successfully, update the backend and continue to run

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. Mac/Windows/Ubuntu] Mac
  • Node Version. You can use node -v to check the node version on your system
    v13.13.0

Additional context
If I pull/push it locally it works fine

@ambientlight
Copy link
Owner

I haven't experienced this myself, thanks a lot for the detailed description, will look into it.

It looks like it might be needed to add smt similar to what was added to myamplifypush

Can you try forking this, making this change and seeing if it solves for you. I will be very happy for accept any PR here

@mrwatts88
Copy link

This worked for me:

- name: Configure Amplify Integration
  uses: ambientlight/[email protected]
  with:
    amplify_command: configure
    amplify_env: int
    amplify_arguments: --categories {"auth":{"googleAppIdUserPool":"googleAppId","googleAppSecretUserPool":"googleAppSecret"}}
 env:
   AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
   AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
   AWS_REGION: us-east-1

Idea from here: aws-amplify/amplify-cli#2877

@dseeker
Copy link

dseeker commented Sep 17, 2020

similar to #10
it started happening again when I tried upgrading to a newest CLI version (currently 4.18)

@dseeker
Copy link

dseeker commented Sep 17, 2020

@sky4git
Copy link

sky4git commented Sep 19, 2020

It is happening with cli 4.29.2 as well.
I already have environment variables setup for the following in amplify console.

AMPLIFY_FACEBOOK_CLIENT_ID
AMPLIFY_FACEBOOK_CLIENT_SECRET
AMPLIFY_GOOGLE_CLIENT_ID
AMPLIFY_GOOGLE_CLIENT_SECRET

It was working fine. now its not.

@pbirsinger
Copy link

what's the fix? i had fixed this now magically broken again ....................

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants