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

No email provided but desired delivery medium was Email #25

Open
fredleger opened this issue Apr 16, 2020 · 2 comments
Open

No email provided but desired delivery medium was Email #25

fredleger opened this issue Apr 16, 2020 · 2 comments

Comments

@fredleger
Copy link

fredleger commented Apr 16, 2020

When restoring a users pool got the following error:

UnhandledPromiseRejectionWarning: InvalidParameterException: No email provided but desired delivery medium was Email
...
(node:61020) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:61020) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Both pools configured exactly the same with terraform creation.

Actually it seems doing the job one by one user and issue the error right after restoring it. It would be nice to have at least a "continue on error" option if some users are buggy

@anilchalissery
Copy link

Having the same issue. I created exact same 2 pools and was not able to import users all users together. It is working only per one user.

@anilchalissery
Copy link

image

I was able to fix the error UnhandledPromiseRejectionWarning: InvalidParameterException: No email provided but desired delivery medium was Email by commenting that part.

instead of
} else if (UsernameAttributes.includes('phone_number')) { params.Username = pluckValue(user.Attributes, 'phone_number') as string; params.DesiredDeliveryMediums = ['EMAIL', 'SMS'] }

i changed to
} else if (UsernameAttributes.includes('phone_number')) { params.Username = pluckValue(user.Attributes, 'phone_number') as string; params.DesiredDeliveryMediums = ['SMS'] }

Then run with npm start where we can run cbr cli commands

NOTE: THIS WILL SEND SMS TO ALL THOSE USERS IMPORTED. TO AVOID THIS YOU CAN SET SNS SPEND LIMIT AS $1 OR $0, SO THAT IT CANT SEND SMS.

Hope it helps

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

2 participants