-
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 Console Build Failure - facebookAppId, amazonAppId, googleClientId, hostedUIProviderCreds] must have values #206
Comments
@KidSysco are you creating a new backend environment through the Amplify Console or are you reusing one created through the CLI? |
That is a really good question, I guess it is unclear what I am supposed to do here. I use the CLI to push everything and test my code locally. In the Amplify Console, I noticed there is a setting only available when setting up the app for the first time. It asks me if I want to deploy the backend, or only deploy the front end. I tried to change this setting after the app was created but I was unable to find a way. The only way to change that setting appears to be to delete the app from the Amplify Console and add it again. Even when I deleted the app, added it again so I could try to only deploy the front end, I ran into permissions problems. I followed the directions to remove the aws-exports.js file from the GitIgnore file. But once I hit save, it complained about the role that is needed to deploy backend resources and gave me an error. However, it still added the app, but it would not deploy and just gives me a permissions error about the account needed to deploy the backend resources whenever it tries to build. |
@KidSysco The
This worked on my app. If you could not reproduce it, please let me know. |
I'm having similar issues, or at least they appear to be closely related. I posted details here https://github.com/aws-amplify/amplify-cli/issues/2833 |
Yep, looks exactly the same as my experience. |
@KidSysco what are you doing in the meantime? Are you just deploying via |
Pushing locally worked fine, and all functions worked fine locally. So I could develop locally but I just couldn't get it to production. I decided to give amplify publish a try by setting up the publishing options in Amplify that would post the website to an S3 bucket, instead of using the Amplify Console. However, amplify publish to S3 did not work for me either. Same error. I think what Joycehao19 said above is correct... "The amplifyPush script has an issue with new stack creation when using social federation." Official AWS Support just sent me to GitHub for Amplify support, but I was already here. So I froze the idea there and moved on to write classic Restify services on an EC2 linux instance. I think you could try to remove all social media functions and try it. I want to say I tried that and it did not work either, but based on what Joyce said above, it might work. I can't remember from a month ago. I also don't have any more time to sink into testing this for AWS. I already have a job, and a boss, and many deadlines of my own. lol However, I am keeping on eye on Amplify and this issue. I will still comment and help out the community if I can. I absolutely love the idea of Amplify, they need to keep pushing... But if you really need to go serverless, the best option right now is Azure. AWS is very new to writing dev tools, MS has been doing this since the dawn of time. The MS tools are very slick, from ORM (Entity Framework), to Web Server, source control, to multiple environments of Cloud resources. All one company. They are light years ahead in that game. Fortunately for me, I do not NEED to go serverless right now, we are not huge fans of MS either. And we still get lots done on EC2, in record time. Keep us posted if you make any break throughs! |
Thanks for all of the info, the insight / experiences you've had are super helpful as I think through this stuff. RE: try without social, in my case social sign in is actually the ONLY option that I want to support. My "app" is for a limited set of "internal" users (hint: it's actually my family :)), but I want to build something robust / secure as a way to learn a new set of tools (e.g. Amplify) for evaluation in future professional projects. In my case, I know my family members all have gmail accounts so I want them to just sign in with Google credentials and save worry about / thinking about anything else. RE: switching to something else, honestly Amplify is just sort of the entry point for a bunch of other things going on. Most important is AWS IoT, which I've spent a decent chunk of time implementing on physical hardware I'm making, so I'm pretty married to AWS at the moment. I think for now I'll wait and watch this ticket and see what happens. I don't need to go to "production" at the moment, and truthfully I could live with only a single production environment if that solved my issue. |
I understand completely. As a Node.js programmer, the huge answer for social media SSO is passport.js. However, I prefer Restify over Express, which has lead a pretty big divide in the Node community I'd say. Passport.js is express based. There are other services out there that are like Cognito, and we could use them too. I even have some training here from Udemy.com on getting AWS Developer certified. That class teaches new folks how to use Cognito directly using an older jQuery style of programming. It was not Vue, or React. However, my instructor clearly indicated to his class that Amplify was not ready for production. I didn't believe him. I ended up here anyway because AWS makes amplify sound so awesome. I couldn't resist, even though I was warned by my instructor who was an Amplify Beta user. I eventually decided that oAuth and social SSO logins are not really worth it on this platform yet. Restify seems to have a real problem with JWT, and the AWS answer for something like that is just too much work to justify. There are easier ways to get social media SSO, but honestly, just writing my own login form seems to be much less work than all of this. Once I gave up on this, I started making huge gains in progress just writing it myself. Now on Azure... OAuth was all super slick. This is why Amplify deserves a chance... Years ago when I was on Azure, the default new project in Visual Studio for creating a new site, ships with oAuth stuff built in, all you need to do is fill in the keys and secrets into your code. No services needed, no passport.js, no express, OAuth just worked there. And that was back in 2015. I know how it is supposed to work, because I have seen things like this elsewhere. So it's just not worth fighting the platform. If it's not ready, then it's just not ready yet. But DOn't get me wrong, I am still AWS 4 LYFE!!!! WOOT!!!! So I agree, let's watch and see what happens next! |
Confirming @Joycehao19 's workaround. This worked also on my end. Just did a little adjustment on the AUTH_CONFIG for social feds authentication. Created config variables per
Then push and redeploy environment(s). I have 3 environments as of the moment |
@Joycehao19 's workaround seemed to work for me for the "Backend" phase of the build process which now passes, but now it hangs on the "Frontend" phase (which was working fine before I ended up in this mess) because it seams the file aws-exports.js is no longer generated. Any suggestions? |
Facing |
Based on the comment, I modified the script from here and it worked for me #!/usr/bin/env bash
set -e
IFS='|'
help_output () {
echo "usage: amplify-push <--environment|-e <name>> <--simple|-s>"
echo " --environment The name of the Amplify environment to use"
echo " --simple Optional simple flag auto-includes stack info from env cache"
exit 1
}
init_env () {
ENV=$1
AMPLIFY=$2
PROVIDERS=$3
CODEGEN=$4
AWSCONFIG=$5
CATEGORIES=$6
echo "# Start initializing Amplify environment: ${ENV}"
if [[ -z ${STACKINFO} ]];
then
echo "# Initializing new Amplify environment: ${ENV} (amplify init)"
amplify init --amplify ${AMPLIFY} --providers ${PROVIDERS} --codegen ${CODEGEN} --categories ${CATEGORIES} --yes;
echo "# Environment ${ENV} details:"
amplify env get --name ${ENV}
else
echo "STACKINFO="${STACKINFO}
echo "# Importing Amplify environment: ${ENV} (amplify env import)"
amplify env import --name ${ENV} --config "${STACKINFO}" --awsInfo ${AWSCONFIG} --categories ${CATEGORIES} --yes;
echo "# Initializing existing Amplify environment: ${ENV} (amplify init)"
amplify init --amplify ${AMPLIFY} --providers ${PROVIDERS} --codegen ${CODEGEN} --categories ${CATEGORIES} --yes;
echo "# Environment ${ENV} details:"
amplify env get --name ${ENV}
fi
echo "# Done initializing Amplify environment: ${ENV}"
}
ENV=""
IS_SIMPLE=false
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case ${key} in
-e|--environment)
ENV=$2
shift
;;
-r|--region)
REGION=$2
shift
;;
-s|--simple)
IS_SIMPLE=true
shift
;;
*)
POSITIONAL+=("$1")
shift
;;
esac
done
set -- "${POSITIONAL[@]}"
# if no provided environment name, use default env variable, then user override
if [[ ${ENV} = "" ]];
then
ENV=${AWS_BRANCH}
fi
if [[ ${USER_BRANCH} != "" ]];
then
ENV=${USER_BRANCH}
fi
# Check valid environment name
if [[ -z ${ENV} || "${ENV}" =~ [^a-zA-Z0-9\-]+ ]] ; then help_output ; fi
AWSCONFIG="{\
\"configLevel\":\"project\",\
\"useProfile\":true,\
\"profileName\":\"default\"\
}"
AMPLIFY="{\
\"envName\":\"${ENV}\"\
}"
PROVIDERS="{\
\"awscloudformation\":${AWSCONFIG}\
}"
CODEGEN="{\
\"generateCode\":false,\
\"generateDocs\":false\
}"
AUTHCONFIG="{\
\"facebookAppIdUserPool\":\"XXXXXXXXXXXXXX\",\
\"facebookAppSecretUserPool\":\"XXXXXXXXXXXXXX\"\
}"
CATEGORIES="{\
\"auth\":$AUTHCONFIG\
}"
# Handle old or new config file based on simple flag
if [[ ${IS_SIMPLE} ]];
then
echo "# Getting Amplify CLI Cloud-Formation stack info from environment cache"
export STACKINFO="$(envCache --get stackInfo)"
init_env ${ENV} ${AMPLIFY} ${PROVIDERS} ${CODEGEN} ${AWSCONFIG} ${CATEGORIES}
echo "# Store Amplify CLI Cloud-Formation stack info in environment cache"
STACKINFO="$(amplify env get --json --name ${ENV})"
envCache --set stackInfo ${STACKINFO}
echo "STACKINFO="${STACKINFO}
else
# old config file, above steps performed outside of this script
init_env ${ENV} ${AMPLIFY} ${PROVIDERS} ${CODEGEN} ${AWSCONFIG} ${CATEGORIES}
fi |
For some reason I am really struggling with the --categories parameter on Every time I run the script, I am unable to add environment variables like @paulbartocillo to the script. In the team-provider-info.json file I expect:
Instead, I get all empties:
Anyone who can point me in the right direction? I am using Many thanks! |
Any update on this issue that is not the workaround mentioned above? |
Make sure you have the right amount of quotes and backslashes when adding your own "AUTH" variables. It didn't work for me either because I had a "/" too much. |
I face this problem and solve it.
2- In amplify console --> App Settings ----> Environment variables add FACEBOOK_CLIENT_ID, FACEBOOK_CLIENT_SECRET, GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET to the environment varibale and set values for each environment 3- Change console --> App Settings ---->Build Setting to
|
I'm getting the following message: I don't have a frontend setup in the amplify console, i don't use the hosted UI at all. This is the only issue that i found related to my error message. can someone help? |
I have the same issue @ohadts |
@kimfucious that's correct; the standard social credentials login will not require a custom amplifyPush script |
Thanks for that clarification, @litwicki Things seem to be working now! No need to disconnect and re-attach the front-end, too! Thanks to you, @swaminator, and the Amplify team for addressing this issue and getting it resolved. |
Finally closign this issue as it has been resolved. For those landing here now, check out this post |
Shouldn't the |
For those who still have problems verify if you don't have whitespaces in front or at the end. This was my stupid issue, because of copy-paste. +1 for not adding this variables by hand 😄 |
@ianmartorell good feedback. Docs are updated: https://docs.amplify.aws/lib/auth/social/q/platform/js#deploying-to-amplify-console |
@abhi7cr @swaminator as by 01/11/2020 this issue still appears when I turn on PR Previews that create a new backend environment for every PR. I have done as suggested in your comment, the required env variables are set for all branches: The Is this a known bug? Do I need a custom build script if I want to turn on PR previews? |
Same goes here @jackscotti thanks for posting! |
I followed the instructions for setting up the environment variables in the web console for my automatic github deploys and that worked well for me. Afterward I ran into issues where amplify push would fail after adding user pools to my auth. I was able to fix it by amplify pulling which prompted me for my identity provider keys, and the next push worked. For anyone that runs into the same issue. |
I just created a new amplify environment so i do not interfere with a team member. After successfully creating the new backend I made some changes to a function. Pushing those changes with amplify push failes with |
@swaminator This issue needs to be reopened. I'm seeing the same thing @jackscotti sees. |
Hey Everyone! Why is this behavior different for headless mode ? Why isn't the configuration as simple as it is for non headless mode ? Why is app secrets even required for this process ? Everything is so bleak... What exactly is the solution/workaround for this? Shouldn't this be documented in the headless cli page ? The issue seems to be open for almost 2 year and we still don't have clarity |
I ran into this as well once I tried "Previews". It throws an error for a missing |
@adi518 did you follow https://docs.aws.amazon.com/amplify/latest/userguide/environment-variables.html#creating-a-new-backend-environment-with-authentication-parameters @DeerajTheepshi could you also share your appid? |
you can unsubscribe
On Sep 4, 2021, at 3:31 PM, Ryan Segura ***@***.***> wrote:
I only showed up here to get off of this list. I submitted this issue nearly 2 years ago. I have since changed jobs, and I work on the Google Cloud Platform now which has no issues like this. Let's face it folks, Amplify is a mess and it is not at all what AWS has claimed it should be. IMO, Amplify still needs a few more years before it is ready for production use.
Mainly, I just want this issue to stop hitting my inbox. 2 years of watching this problem unfold over and over again is quite enough. I remember the pain of Amplify, hopefully I never need to go through any of those failed, and broken promises from AWS ever again!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#206 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACQF3YW3RUGXO7DQQZVUDQLUAINT5ANCNFSM4JDRK43A>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Yeah, our user-generated environments work just fine. It's these Preview builds that have issues. However, at this point in time, I already found the bug, it's the To add to that, Preview builds have another serious issue. If an error occurs during the first build, where the environment is created, it always fails the rollback at some point and doesn't save the partially completed environment metadata (since it exits with non-zero), so at the next build, it tries to build the same environment and expectedly, fails. When an error occurs in the first build, it should catch that error, delete everything and start from scratch on the next build. That would be easier than trying to rollback. I've had build failures for all kinds of reasons, sometimes it's an availability issue, another time it's a limit issue, etc'. I'm afraid we might have to abandon Amplify for these issues, because it's been really time-consuming, as in weeks and weeks of having to deal with things that should have worked out of the box. |
Also getting headaches' worth of issues with this... We added a few commands to the backend phase of our
which still resulted in the same error
but we also observed a few 'interesting things...
Furthermore, the script doesn't read from the environment variables that were set in the previous commands... it only reads from the env variables set in the console. This is awful behavior... as these env variables are not checked into git, and it becomes very hard to redeploy the project in another account without forgetting about all of these ad-hoc console settings that have to be entered manually. Please Amplify, can this issue be reopened and fixed once and for all? |
I can't believe this is still an issue. This project is a complete joke. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I added auth to my project with the Facebook, Google, and Amazon Logins. I got Cognito working well, so I decided to add an API using the AppPool for security.
I added the default graphQL API that adds todos with a simple one-to-many relationship, I ran
amplify push
and everything worked great. AppSync, Dynamo, and Cognito were all looking perfectly in each console.I committed my code to git and pushed, which kicked off an Amplify Console build that failed with the following error message. Notice how it is complaining that it cannot find values for my facebookAppId, amazonAppId, googleClientId, hostedUIProviderCreds. That is confusing because Cognito is working perfectly with all 3 providers...
I expected the Amplify console to be able to build and deploy this project since
amplify push
worked fine from my machine.If I remove the API, Cognito still works fine, I can commit and push at this point and the Amplify Console will build and deploy my project fine.
Any insight is always appreciated.
The text was updated successfully, but these errors were encountered: