Firebase: ApiError: Unauthorized Error - node.js

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.

Related

Why is my app deployed through App Engine not able to connect to Cloud SQL postgres database?

I attempted to follow the guide here https://cloud.google.com/appengine/docs/flexible/nodejs/using-cloud-sql-postgres
to integrate my app with the Cloud SQL postgres instance. However I keep getting an error:
Updating service [default] (this may take several minutes)...failed.
ERROR: (gcloud.app.deploy) Error Response: [9] Application startup
error:
testpostgres#1.0.0 start /app node app.js
Unhandled rejection SequelizeConnectionError: connect ENOENT
/cloudsql/test-postgress:us-central1:testpostgress/.s.PGSQL.5432 at
connection.connect.err
(/app/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:128:24) at Connection.connectingErrorHandler
(/app/node_modules/pg/lib/client.js:123:14) at emitOne
(events.js:116:13) at Connection.emit (events.js:211:7) at
Socket.reportStreamError
(/app/node_modules/pg/lib/connection.js:71:10) at emitOne
(events.js:116:13) at Socket.emit (events.js:211:7) at emitErrorNT
(internal/streams/destroy.js:64:8) at _combinedTickCallback
(internal/process/next_tick.js:138:11) at process._tickCallback
(internal/process/next_tick.js:180:9)
It must be a problem with my configuration, but I have tried everything I can think of. You can see or clone my project here:
https://github.com/fractalfrenzy/GCS_postgres_test
I know nothing of Node.js, but have a long experience with Java/Python/Go runtime.
Have you opened your CloudSQL instance for connection?
Try this: Configuring IP Connectivity

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?

React Twitter OAuth Callback Status Code 401

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.

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