emojipacks icon indicating copy to clipboard operation
emojipacks copied to clipboard

Batch Upload - Permission Denied

Open r0ug3 opened this issue 6 years ago • 10 comments

I copied the batchUploadExample.sh file and edited the top fields. Saved as batchUpload.sh and tried running ./batchUpload.sh I am getting a permission error but my shell is running as root.

In addition: Running just one file upload throws an app error after I put in 2FA. Uh oh! Error: Application Error: unable to find api token on login page

r0ug3 avatar Dec 16 '18 06:12 r0ug3

Same issue here!

elloboblanco avatar Mar 06 '19 05:03 elloboblanco

Same!

kmcgaire avatar Mar 06 '19 14:03 kmcgaire

I was able to fix it by manually generating a token at: https://api.slack.com/custom-integrations/legacy-tokens and replacing the line opts.apiToken = match[1]; in lib/slack.js with the token itself and commenting out the http request. I am assuming the lack of a generated auth token is the issue?

DavidWatkins avatar Apr 01 '19 15:04 DavidWatkins

fix didn't work for me, assuming i replaced the token properly. Did you put it inside the match[]. or put the token after the =? I've tried multiple different ways no luck

davem-git avatar Apr 24 '19 22:04 davem-git

I tried this approach, https://github.com/lambtron/emojipacks/issues/164#issuecomment-478619697, but the api is returning {"ok":false,"error":"not_allowed_token_type"}

jkogara avatar May 07 '19 11:05 jkogara

I was able to fix it by manually generating a token at: https://api.slack.com/custom-integrations/legacy-tokens and replacing the line opts.apiToken = match[1]; in lib/slack.js with the token itself and commenting out the http request. I am assuming the lack of a generated auth token is the issue?

Just to clarify what @DavidWatkins did (and does work for me), commenting lines 153-158 (or simply remove) and making it read:

//TODO: it may be necessary in the future to replace this with a user-supplied token
// var match = apiTokenRegex.exec(res[0].body);
// if (!match || !match[1]) {
//   throw new Error('Application Error: unable to find api token on login page');
// }

// opts.apiToken = match[1];  
opts.apiToken = "xxx-your-token-here";
return this.opts = opts;

mcconkiee avatar May 09 '19 18:05 mcconkiee

So now this doesn't error but it doesn't do anything either

davem-git avatar May 13 '19 18:05 davem-git

mcconkiee's tip seemed to work for me but I'm not seeing them in the actual application even after three hours.

I found an alternative solution using chrome extensions.

  • Copy the urls provided in the yaml files in this repo.
  • Download images that list of images using the tab save extension https://chrome.google.com/webstore/detail/tab-save/lkngoeaeclaebmpkgapchgjdbaekacki
  • Then drag those into the bulk uploader https://chrome.google.com/webstore/detail/neutral-face-emoji-tools/anchoacphlfbdomdlomnbbfhcmcdmjej

jungledre avatar Jul 25 '19 20:07 jungledre

Sometimes the URL filenames do not match the emoji's name. Here is my solution.

In theory someone could make a browser extension that reads a YAML file, downloads the data and then uploads it to slack.

robhawkins avatar Aug 24 '19 03:08 robhawkins

I am having the same issue @davem-git is having. I modified the lib/slack.js file by adding my test API token using the following steps indicated by @mcconkiee but still a recurring issue. Anyone else coming across this issue?

Starting import
Got tokens
Logged in
Uh oh! Error: Login error: could not get emoji upload crumb for https://thyhomiez.slack.com
(node:12726) UnhandledPromiseRejectionWarning: Error: Login error: could not get emoji upload crumb for https://thyhomiez.slack.com
    at Slack.emoji (/Users/tims/.nvm/versions/node/v10.16.0/lib/node_modules/emojipacks/lib/slack.js:162:34)
    at Slack.emoji.next (<anonymous>)
    at onFulfilled (/Users/tims/.nvm/versions/node/v10.16.0/lib/node_modules/emojipacks/node_modules/co/index.js:65:19)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:12726) 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:12726) [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.
packs//fika.yaml

timsully avatar Mar 19 '20 18:03 timsully