roman01la / slack-traductor

Slack bot to translate chat messages of any language into specified language
MIT License
85 stars 14 forks source link

Error: no auth mechanism defined #9

Open pjrobertson opened 8 years ago

pjrobertson commented 8 years ago

When loading this up for the first time I get the following error messages. My .env file seems to be filled out correctly.

< Error: no auth mechanism defined
<     at Auth.onRequest (/some/pathnode_modules/request/lib/auth.js:133:32)
<     at Request.auth (/some/pathnode_modules/request/request.js:1233:14)
<     at Request.init (/some/pathnode_modules/request/request.js:380:10)
<     at new Request (/some/pathnode_modules/request/request.js:129:8)
<     at request (/some/pathnode_modules/request/index.js:55:10)
<     at Function.get (/some/pathnode_modules/request/index.js:63:12)
<     at /some/pathlib/translator.js:35:13
<     at Object.isLang (/some/pathlib/translator.js:33:10)
<     at /some/pathlib/any_to_eng.js:34:18
<     at /some/pathlib/translator.js:57:25

It was working at one point without me changing anything, then it stopped. When it was working I was getting a different error:

TypeError: Cannot read property 'name' of undefined
    at replyToUser (/some/pathlib/message_handler.js:30:64)
    at Bot.<anonymous> (/some/pathlib/message_handler.js:25:15)
    at emitOne (events.js:96:13)
    at Bot.emit (events.js:188:7)
    at Bot.<anonymous> (/some/pathnode_modules/slackbots/index.js:59:18)
    at emitTwo (events.js:106:13)
    at WebSocket.emit (events.js:191:7)
    at Receiver.ontext (/some/pathnode_modules/ws/lib/WebSocket.js:797:10)
    at /some/pathnode_modules/ws/lib/Receiver.js:473:18
    at Receiver.applyExtensions (/some/pathnode_modules/ws/lib/Receiver.js:360:5)
pjrobertson commented 8 years ago

Strange, I recreated a new Microsoft application and updated the credentials and it works fine now. The 2nd error still stands

rogermarlow commented 7 years ago

I get the same problem:

$ npm start

> slack-traductor@1.0.0 start /Users/rogermarlow/github/slack-traductor
> babel-node index.js

Error: no auth mechanism defined
    at Auth.onRequest (/Users/rogermarlow/github/slack-traductor/node_modules/request/lib/auth.js:133:32)
    at Request.auth (/Users/rogermarlow/github/slack-traductor/node_modules/request/request.js:1270:14)
    at Request.init (/Users/rogermarlow/github/slack-traductor/node_modules/request/request.js:379:10)
    at new Request (/Users/rogermarlow/github/slack-traductor/node_modules/request/request.js:128:8)
    at request (/Users/rogermarlow/github/slack-traductor/node_modules/request/index.js:54:10)
    at Function.get (/Users/rogermarlow/github/slack-traductor/node_modules/request/index.js:62:12)
    at /Users/rogermarlow/github/slack-traductor/lib/translator.js:35:13
    at Object.isLang (/Users/rogermarlow/github/slack-traductor/lib/translator.js:33:10)
    at /Users/rogermarlow/github/slack-traductor/lib/any_to_eng.js:34:18
    at /Users/rogermarlow/github/slack-traductor/lib/translator.js:57:25
rogermarlow commented 7 years ago

The problem seems to be with the Azure Text Translation service. I haven't figured it out completely but currently I just get "no response" replies from the Azure end-points, event when I have an authorization token.

bartleman commented 7 years ago

I also have this problem.

$ npm start

> slack-traductor@1.0.0 start /home/admin/bots/slack-traductor
> babel-node index.js

TypeError: Cannot read property 'name' of undefined
    at replyToUser (/home/admin/bots/slack-traductor/lib/message_handler.js:30:64)
    at Bot.<anonymous> (/home/admin/bots/slack-traductor/lib/message_handler.js:25:15)
    at emitOne (events.js:96:13)
    at Bot.emit (events.js:188:7)
    at Bot.<anonymous> (/home/admin/bots/slack-traductor/node_modules/slackbots/index.js:59:18)
    at emitTwo (events.js:106:13)
    at WebSocket.emit (events.js:191:7)
    at Receiver.ontext (/home/admin/bots/slack-traductor/node_modules/ws/lib/WebSocket.js:797:10)
    at /home/admin/bots/slack-traductor/node_modules/ws/lib/Receiver.js:473:18
    at Receiver.applyExtensions (/home/admin/bots/slack-traductor/node_modules/ws/lib/Receiver.js:360:5)
(node:18736) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: no auth mechanism defined