Firebase functions logging with winston papertrail gives ECONNRESET error - google-cloud-functions

When developing node-js app's I enjoy using winston logging in combination with papertrail (a logging SaaS provider).
I can get the logging from firebase-functions working with papertrail, however, my problem is that when the functions instance is closing down, winston-papertrail throws an error:
Papertrail connection error: { Error: read ECONNRESET
at exports._errnoException (util.js:1020:11)
at TLSWrap.onread (net.js:580:26) code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'read' }
I try to close down the winston-papertrail with code like this, at the end of my functions:
logger.close();
However the errors arrive in the firebase console like this:
I would love to know if anyone has a working setup with no errors, or could maybe point me in the right direction.

Related

Autodesk-Forge View Your Models Tutorial Model not uploading

I have followed the Autodesk "View Your Models" Tutorial...incredibly helpful. I believe I have followed the tutorial, the site loads, and my existing buckets are shown with their current models listed. However when I create a new bucket and attempt to upload a model it does not show as having arrived in the bucket (I have refreshed, and waited 12 hours). There is a white arrow for expanding the bucket (to show its child models), but when clicked it just goes away.
The files I have attempted to upload are in the "Uploads" folders. Models I had in already existing buckets load and can be viewed.
I receive the following error:
/usr/local/bin/node start.js
events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::3000
at Server.setupListenHandle [as _listen2] (net.js:1360:14)
at listenInCluster (net.js:1401:12)
at Server.listen (net.js:1485:7)
at Function.listen (/Users/ben/Documents/GitHub/sampleForgeNode/node_modules/express/lib/application.js:618:24)
at Object.<anonymous> (/Users/ben/Documents/GitHub/sampleForgeNode/start.js:21:5)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
Glad you enjoyed the tutorial! :-)
About the error, EADDRINUSE usually indicates the port (e.g. 3000) is already in use by another process. In most cases, it's another nodejs sample you left running or stopped working. On Windows, open the Task Manager and end all nodejs processes. For MacOS, open the Activity Monitor and kill all nodejs processes.
From your description, I would say that the upload is failing and, after that, a Nodejs process remains running and causing the EADDRINUSE error. As mentioned by Petr Broz, please check the terminal console for any error message that can identify the problem (probably during upload). You may try with a small file to get started, big files can cause timeout errors.

MoonMail installation issue - error during CloudFormation

While trying to install MoonMail, I'm running the following command:
sls resources deploy
and I'm getting the following error:
/usr/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:61
fn = function () { throw arg; };
^
ServerlessError: ServerlessError: An error occurred while provisioning your cloudformation: The following resource(s) failed to create: [ScheduledEmailsTable, AttachSenderTopic, SentEmailsTable, SendCampaignTopic, PrecompileEmailTopic, AttachRecipientsTopic, CampaignsTable, TemplatesTable, AttachListRecipientsTopic, RecipientsTable, AutomationActionsTable, ClicksReportTable, UnsubscribedRecipientTopic, LinksTable, ExpertsTable, UpdateUserReputationTopic, EmailNotificationsTopic, OpensStream, UpdateCampaignTopic, OpensTable]. . Delete requested by user.
I've already tried giving the IAM user admin access, unfortunately it didn't help.
Go to your AWS dashboard, CloudFormation section, and select the stack where you're deploying the project. You'll see exactly the error that prevented you from creating the stack, serverless errors are not really descriptive when it comes to CloudFormation

Getting an error while trying to deploy with Modolus

I am following this tutorial (using meteor on modulus) to test telescope app and how the deploy works
I am getting this error :
Unable to connect to any application instances.
And this is the log:
/mnt/data/1/node_modules/fibers/future.js:245
throw(ex);
^ TypeError: Cannot read property 'name' of undefined
at app/server/migrations.js:469:43
at [object Object]._.extend.forEach (packages/mongo/mongo_driver.js:965:1)
at [object Object].Cursor.(anonymous function) [as forEach] (packages/mongo/mongo_driver.js:812:1)
at Object.migrationsList.updateUserNames (app/server/migrations.js:462:14)
at runMigration (app/server/migrations.js:45:52)
at app/server/migrations.js:10:5
at Array.forEach (native)
at Function..each..forEach (packages/underscore/underscore.js:105:1)
at Meteor.methods.removeMigration.Migrations.remove.name (app/server/migrations.js:9:5)
at /mnt/data/1/programs/server/boot.js:229:5 [2015-04-09T22:31:49.395Z] Failed to start application.
Thank you !!
This is a common issue when you don't redeploy the application after the first step.
run this 2 commands.
modulus project restart
modulus deploy
NOTE be sure the URL don't have any blank space either.
From step three of the tutorial,
The Meteor app is not quite ready yet and the logs will show errors. We have to deploy first in order to receive a URL for Meteor's required environment variables.
Have you goen through and correctly defined all of the environment variables?

ENOENT with nodejs mysql and sequelize

I have struggled with this for a few days and cannot figure out what is wrong.
I am using:
-node.js 0.10.4
-mysql 5.5.29
-node mysql 2.0.0.alpha7
-node sequelize 1.6.0
When I try to execute any queries, I get an error message with ENOENT somewhere in it. From my research it seems like that is a generic node error message for a filesystem issue like a file not existing or insufficient permissions. I have checked and my credentials are correct. So, my create statements fail and then when my app goes to query the database, no tables exist and I get something like:
Error: connect ENOENT
at errnoException (net.js:883:11)
at Object.afterConnect [as oncomplete] (net.js:874:19)
--------------------
at Handshake.Sequence (/home/greg/snipit/node_modules/mysql/lib/protocol/sequences/Sequence.js:15:21)
at new Handshake (/home/greg/snipit/node_modules/mysql/lib/protocol/sequences/Handshake.js:9:12)
at Protocol.handshake (/home/greg/snipit/node_modules/mysql/lib/protocol/Protocol.js:41:50)
at Connection.connect (/home/greg/snipit/node_modules/mysql/lib/Connection.js:63:18)
at Connection._implyConnect (/home/greg/snipit/node_modules/mysql/lib/Connection.js:162:10)
at Connection.query (/home/greg/snipit/node_modules/mysql/lib/Connection.js:88:8)
at module.exports.connect (/home/greg/snipit/node_modules/sequelize/lib/dialects/mysql/connector-manager.js:247:16)
at Object.pool.Pooling.Pool.create (/home/greg/snipit/node_modules/sequelize/lib/dialects/mysql/connector-manager.js:111:19)
at dispense (/home/greg/snipit/node_modules/sequelize/node_modules/generic-pool/lib/generic-pool.js:216:17)
at Object.me.acquire (/home/greg/snipit/node_modules/sequelize/node_modules/generic-pool/lib/generic-pool.js:260:5)
What type of thing usually causes this? Thanks so much.
I checked the way I was making my connections, and it turns out I had a typo. My application reads in credentials from a json file, but I was accidentally passing the mysql password I read in to my connection as the port to connect on! So I was trying to connect at localhost:'password'. haha. This explains why half of my workers were experiencing no issue... they has no mysql password and so the connection port was defaulting.

Meteor OAuth Exception while invoking method 'login'

While trying to login using the Meteor packages accounts-facebook and accounts-google, I'm getting an OAuth handler exception. Packages accounts-twitter appears to work fine and logs in perfectly. I haven't written any code, this is right out of the box using the accounts-ui package
The front end simply says "Internal Server Error" in red text, and the Meteor stack trace is the following:
Exception in oauth request handler [Error: failed]
Exception while invoking method 'login' Error: failed
at Request.Meteor.http.call [as _callback] (app/packages/http/httpcall_server.js:117:19)
at Request.init.self.callback (/usr/lib64/meteor/lib/node_modules/request/main.js:122:22)
at Request.EventEmitter.emit (events.js:96:17)
at Request.<anonymous> (/usr/lib64/meteor/lib/node_modules/request/main.js:654:16)
at Request.EventEmitter.emit (events.js:123:20)
at IncomingMessage.Request.start.self.req.self.httpModule.request.buffer (/usr/lib64/meteor/lib/node_modules/request/main.js:616:14)
at IncomingMessage.EventEmitter.emit (events.js:123:20)
at IncomingMessage._emitEnd (http.js:366:10)
at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23)
at CleartextStream.socketOnData (http.js:1366:20)
I'm running the Meteor app on my own infrastructure with a working domain name. Any idea what's going on?
I had the same issue, and it turned out my service was not configured correctly, specifically I had the wrong Facebook app secret. Go into your mongo shell and check your meteor_accounts_loginServiceConfiguration to ensure it's set up correctly.
Start up Meteor, then go into the mongo shell via meteor mongo
Then type 'db.meteor_accounts_loginServiceConfiguration.find()' to show the documents in that collection. Now check your Facebook document to ensure it matches the app you created on Facebook exactly.
I did this and everything worked immediately.
Sorry for that. Our error reporting in these cases sucked. A fix is coming out in the soon-to-be-released Meteor 0.6.2.