amplify-cli-action
amplify-cli-action copied to clipboard
Github action failed to pull environment: Error: auth headless is missing the following inputParams facebookAppIdUserPool, facebookAppSecretUserPool, googleAppIdUserPool, googleAppSecretUserPool
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: https://github.com/aws-amplify/amplify-console/issues/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:
- Updated amplify-cli to 4.22.0, but it seems that the version running on Github actions is different anyway.
- 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: https://github.com/aws-amplify/amplify-cli/pull/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
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
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: https://github.com/aws-amplify/amplify-cli/issues/2877
similar to https://github.com/ambientlight/amplify-cli-action/issues/10 it started happening again when I tried upgrading to a newest CLI version (currently 4.18)
https://github.com/aws-amplify/amplify-cli/issues/4790#issuecomment-656422252
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.
what's the fix? i had fixed this now magically broken again ....................