Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Timestamp is null #15

Open
gregorskii opened this issue Feb 16, 2016 · 8 comments
Open

Error: Timestamp is null #15

gregorskii opened this issue Feb 16, 2016 · 8 comments

Comments

@gregorskii
Copy link

Hi there,

I am seeing this error when running in AWS:

InvalidParameterException: 1 validation error detected: Value null at 'logEvents.1.member.timestamp' failed to satisfy constraint: Member must not be null
    at Request.extractError (/api/node_modules/aws-sdk/lib/protocol/json.js:43:27)
    at Request.callListeners (/api/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
    at Request.emit (/api/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/api/node_modules/aws-sdk/lib/request.js:596:14)
    at Request.transition (/api/node_modules/aws-sdk/lib/request.js:21:10)
    at AcceptorStateMachine.runTo (/api/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /api/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/api/node_modules/aws-sdk/lib/request.js:37:9)
    at Request.<anonymous> (/api/node_modules/aws-sdk/lib/request.js:598:12)
    at Request.callListeners (/api/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
    at Request.emit (/api/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/api/node_modules/aws-sdk/lib/request.js:596:14)
    at Request.transition (/api/node_modules/aws-sdk/lib/request.js:21:10)
    at AcceptorStateMachine.runTo (/api/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /api/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/api/node_modules/aws-sdk/lib/request.js:37:9)

I have configured the logger like so:

module.exports = function() {

    var bunyan = require('bunyan'),
        Bunyan2Loggly = require('bunyan-loggly').Bunyan2Loggly,
        bformat = require('bunyan-format'),
        formatOut = bformat({ outputMode: 'short' }),
        log
    ;

    if (process.env.NODE_ENV === 'local') {
        log = bunyan.createLogger({'name': 'LOCAL', stream: formatOut});
    } else {
        log = bunyan.createLogger({
            name: process.env.LOGGLY_ALIAS.replace('.%s', ''),
            streams: [
                {
                    level: 'error',
                    type: 'raw',
                    stream: new Bunyan2Loggly({
                        token: process.env.LOGGLY_TOKEN,
                        subdomain: process.env.LOGGLY_SUBDOMAIN
                    })
                },
                {
                    level: 'fatal',
                    type: 'raw',
                    stream: require('bunyan-cloudwatch')({
                        logGroupName: process.env.OPSGENIE_CW_GROUP,
                        logStreamName: 'service-api-ops-cloudwatch-stream',
                        cloudWatchLogsOptions: {
                            accessKeyId: process.env.AWS_KEY,
                            secretAccessKey: process.env.AWS_SECRET,
                            region: process.env.AWS_REGION
                        }
                    })
                }
            ]
        });
    }

    return log;

};

Using the logger:

log.fatal('TESTING CLOUDWATCH');

Thanks

@torgeir
Copy link

torgeir commented Aug 4, 2016

Same thing here. Did you find a workaround @gregorskii ?

@torgeir
Copy link

torgeir commented Aug 4, 2016

For the record, setting { stream: cloudwatchStream, type: "raw" } fixed this issue for me 🎉
#16 (comment)

@mirkokiefer
Copy link
Owner

As specified in the readme type: 'raw' always needs to be set.

@gregorskii
Copy link
Author

I believe I had raw set, correct?

@mirkokiefer mirkokiefer reopened this May 8, 2017
@mirkokiefer
Copy link
Owner

Ah true was mislead by the comment below - you were not able to resolve the issue @gregorskii ?

@gregorskii
Copy link
Author

I fixed it in #16. Dunno if it's the best way to do it, but it worked.

@mirkokiefer
Copy link
Owner

Hm thats weird - maybe you can test with the latest version. Its testing with bunyan 2.0 now.

@RavidAshurov
Copy link

I am having the same issue.

I am using the "raw" options and the following package versions:
"bunyan": "^1.8.15",
"bunyan-cloudwatch": "^2.2.0",
"bunyan-format": "^0.2.1"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants