lambtron/emojipacks

UnhandledPromiseRejectionWarning

tdmalone opened this issue · 14 comments

This is on Windows, tried in two different shells (cmd & mingw64). Also tried both with supplying all the options via command-line, and with interactive responses. Any ideas?

Slack subdomain: xxxxxxxxxxx
Email address login: xxxxxxxxxxx
Password: ****************
Path or URL of Emoji yaml file: ./pokemon_emojipack.yml
Starting import
Got tokens
Logged in
Getting emoji page
Uploading undefined with undefined
(node:14684) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): TypeError: Cannot read property 'name' of undefined
(node:14684) 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.

After this the execution appears to hang.

Hmm.. might have partly been my issue, just realised the YAML file was not formatted correctly, but after fixing that I'm getting a slightly different error:

Got tokens
Logged in
Uh oh! Error: Login error: could not get emoji upload crumb for https://xxxxxxxxxxx.slack.com
(node:10700) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Login error: could not get emoji upload crumb for https://xxxxxxxxxxx.slack.com
(node:10700) 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.

Hey @tdmalone , thanks for reporting. How does your organization sign in (do you use regular login methods)? Do you use 2FA?

Hi Zach!

The particular account I was using for this is just username/password (I do use 2FA on my own account but figured that might get in the way of things!)

I actually came back a bit later and tried this again, and it worked then. So perhaps it had reached some sort of rate-limit with my earlier tries...

So in retrospect, there might not actually be a problem - other than some unhandled error situations which left me guessing :)

Thanks for replying and for the excellent work on this - sure makes it easy getting hundreds of emoji in at once!!

Awesome! Yeah it was probably a rate limiting problem. I'm going to close this though because testing a feature to handle this case might get us banned... But if it comes up again maybe someone can post a regex or scanner to let users know! Glad to help.

I'm also having the same issue though this occurred on my first attempt:

 ~  emojipacks
Slack subdomain: ***
Email address login: ***
Password: ***
Path or URL of Emoji yaml file: https://raw.githubusercontent.com/Surgo/aws_emojipacks/master/noprefix-emojipacks.yml
Starting import
Got tokens
Logged in
Uh oh! Error: Login error: could not get emoji upload crumb for https://***.slack.com
(node:25050) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Login error: could not get emoji upload crumb for https://***.slack.com
(node:25050) [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.

I am also having this issue, running version 0.2.1

Edit: The issue might have something to with having special characters in your password

I'm also having this issue. Mac OS X, 10.13.6 Beta.

Flynn:emoji brandon$ sh batchemoji.sh emojipacks
./packs/*.yaml
Starting import
Got tokens
Logged in
Getting emoji page
(node:2176) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot convert undefined or null to object
(node:2176) 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.

same issue

Run with -d(ebug) option

Starting import
Got tokens
Logged in
Uh oh! Error: Login error: could not get emoji upload crumb for https://.slack.com
(node:15347) UnhandledPromiseRejectionWarning: Error: Login error: could not get emoji upload crumb for https://
.slack.com
at Slack.emoji (/usr/local/lib/node_modules/emojipacks/lib/slack.js:162:34)
at Slack.emoji.next ()
at onFulfilled (/usr/local/lib/node_modules/emojipacks/node_modules/co/index.js:65:19)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:15347) 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(). (rejection id: 1)
(node:15347) [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.

I am getting the same issue as tsunghao. I've used this on many teams before but it's not working now. I'm an admin in my workspace as well

@breadstickguy
I am able to use emojipacks after switching to this commit:


commit 3651dd8 (HEAD -> update-selector-for-upload-page-rewrite, jackellenberger/update-selector-for-upload-page-rewrite)
Author: jackellenberger jellenberger@uchicago.edu
Date: Mon Aug 27 00:19:50 2018 -0500

remove excessive debugers

Good Luck!

@TsungHao 's fix worked great, thank you!

Actually, check that: I can't confirm that it didn't just work because I stopped trying to use NPM, and installed straight from source (using git+make) instead. This issue (#158) seems to suggest it's just because the NPM distro is very out of date.

@TsungHao thanks! Building from that commit worked for me as well. For other folks, I checked out commit 3651dd8 and then ran make from the root of the project as the README advises. After that I was able to install my emjois without the Login error around emoji upload crumb.