React Twitter OAuth Callback Status Code 401 - node.js

Wanted to test Twitter OAuth callback with my React app on localhost.
Saw that you could use http://127.0.0.1:8000 in the Twitter App Console for both Website and Callback URL fields for it to work with localhost.
const twitterStream = new Twitter(twitterConfig.TWITTER_CONFIG);
I am using the twitter npm and getting the following 401 status code error --
Error: Status Code: 401
at Request.<anonymous> (/Users/me/Projects/project-name/node_modules/twitter/lib/twitter.js:277:28)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at Request.onRequestResponse (/Users/me/Projects/pproject-name/node_modules/request/request.js:986:10)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:474:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)
at TLSSocket.socketOnData (_http_client.js:363:20)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at TLSSocket.Readable.push (_stream_readable.js:134:10)
at TLSWrap.onread (net.js:548:20)
Appreciate the help.

You need to set http://127.0.0.1:8000/auth/twitter/callback as the callback URL in application settings back on Twitter.

Related

Mongoose deployment issues

I am trying to connect to Mongolab through the Expressjs. But when I run ,I am getting failed to connect to the server
Error Message :
MongoError: failed to connect to server [ds033066.mlab.com:33066] on first con
nect [MongoError: connect ETIMEDOUT 54.80.215.206:33066]
at Pool.<anonymous> (C:\Users\rkishore\Documents\node\node_modules\mongoose\
node_modules\mongodb-core\lib\topologies\server.js:328:35)
at emitOne (events.js:96:13)
at Pool.emit (events.js:188:7)
at Connection.<anonymous> (C:\Users\rkishore\Documents\node\node_modules\mon
goose\node_modules\mongodb-core\lib\connection\pool.js:280:12)
at Connection.g (events.js:292:16)
at emitTwo (events.js:106:13)
at Connection.emit (events.js:191:7)
at Socket.<anonymous> (C:\Users\rkishore\Documents\node\node_modules\mongoos
e\node_modules\mongodb-core\lib\connection\connection.js:177:49)
at Socket.g (events.js:292:16)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at emitErrorNT (net.js:1277:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
name: 'MongoError',
message: 'failed to connect to server [ds033066.mlab.com:33066] on first conne
ct [MongoError: connect ETIMEDOUT 54.80.215.206:33066]'
Any Help/Suggestion greatly appreciated.

nodejs, http, legacy servers, and "HPE_UNEXPECTED_CONTENT_LENGTH"

Running a simple http request in nodejs for web crawling purposes.
Unfortunately, one website we're trying to crawl is configured such that it has the Content-Length header twice.
This is throwing an error on nodejs:
Error: Parse Error
at Error (native)
at Socket.socketOnData (_http_client.js:363:20)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:548:20) bytesParsed: 239, code:'HPE_UNEXPECTED_CONTENT_LENGTH' },
isOperational: true,
bytesParsed: 239,
code: 'HPE_UNEXPECTED_CONTENT_LENGTH'
I'm trying to find a workaround that doesn't involve downgrading my nodejs server... Any ideas?

Firebase: ApiError: Unauthorized Error

I have firebase cloud function working, but today I am seeing following error:
Please suggest what is wrong with firebase functions.
ApiError: Unauthorized
at new util.ApiError (/user_code/node_modules/#google-cloud/storage/node_modules/#google-cloud/common/src/util.js:107:10)
at Object.parseHttpRespMessage (/user_code/node_modules/#google-cloud/storage/node_modules/#google-cloud/common/src/util.js:149:33)
at Object.handleResp (/user_code/node_modules/#google-cloud/storage/node_modules/#google-cloud/common/src/util.js:124:18)
at Duplexify.<anonymous> (/user_code/node_modules/#google-cloud/storage/src/file.js:711:21)
at emitOne (events.js:96:13)
at Duplexify.emit (events.js:188:7)
at emitOne (events.js:96:13)
at DestroyableTransform.emit (events.js:188:7)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
Note: I know they were migrating to newer nodejs, Is it because of it?
Solution here solved the problem:
https://stackoverflow.com/a/43106877/1590595
I am keeping an eye, if it occurs, I will update the answer.

cannot connect loopback with mongodb

i'm trying to execute the commande "slc run" to access to API loopback but ther's a problem with mongodb even if i run mongod it display this error :
MongoError: Authentication failed.
at Function.MongoError.create (C:\Users\abdessamad\ingeweb_workspace\roll-lo
opback\node_modules\mongodb-core\lib\error.js:31:11)
at C:\Users\abdessamad\ingeweb_workspace\roll-loopback\node_modules\mongodb-
core\lib\connection\pool.js:483:72
at authenticateStragglers (C:\Users\abdessamad\ingeweb_workspace\roll-loopba
ck\node_modules\mongodb-core\lib\connection\pool.js:429:16)
at Connection.messageHandler (C:\Users\abdessamad\ingeweb_workspace\roll-loo
pback\node_modules\mongodb-core\lib\connection\pool.js:463:5)
at Socket.<anonymous> (C:\Users\abdessamad\ingeweb_workspace\roll-loopback\n
ode_modules\mongodb-core\lib\connection\connection.js:319:22)
at emitOne (events.js:96:13)
at Socket.emit (events.js:189:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:551:20)

Node.JS Bot Error SteamGuardMobile

I keep getting this error when ever I start Steam Bot.
[2016-05-03 03:00:03.184] [DEBUG] [default] - [Error: SteamGuardMobile]
Error: SteamGuardMobile
at SteamCommunity.<anonymous> (C:\Users\Administrator\Desktop\BOTNEW\node_mo
dules\steamcommunity\index.js:128:14)
at Request._callback (C:\Users\Administrator\Desktop\BOTNEW\node_modules\ste
amcommunity\components\http.js:62:14)
at Request.self.callback (C:\Users\Administrator\Desktop\BOTNEW\node_modules
\request\request.js:200:22)
at emitTwo (events.js:87:13)
at Request.emit (events.js:172:7)
at Request.<anonymous> (C:\Users\Administrator\Desktop\BOTNEW\node_modules\r
equest\request.js:1067:10)
at emitOne (events.js:82:20)
at Request.emit (events.js:169:7)
at IncomingMessage.<anonymous> (C:\Users\Administrator\Desktop\BOTNEW\node_m
odules\request\request.js:988:12)
at emitNone (events.js:72:20)
bot.js http://pastebin.com/07uXJgdJ
bot_manager.js http://pastebin.com/RfJbkrQe
Any help would be amazing and if you are looking for anymore information to help me solve this issue just ask, But I am pretty new to Steam Bot's!

Resources