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-reporting: Errors not sent when providing an API key only #2302

Closed
DominicKramer opened this issue May 11, 2017 · 3 comments
Closed

error-reporting: Errors not sent when providing an API key only #2302

DominicKramer opened this issue May 11, 2017 · 3 comments
Assignees
Labels
api: error-reporting priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@DominicKramer
Copy link
Contributor

  • I ran export NODE_ENV=production
  • I installed express and cloud-errors.
  • I run the following code:

I could not see errors in the Error Reporting UI for this project.
I could successfully send manually errors to this project with this API key (by calling the API from cURL).

var express = require('express');
var app = express();
var errorHandler = require('@google/cloud-errors')({
  projectId: "<my project>",
  key: "<my api key>",
  serviceContext: {
      service: 'steren-test-node',
      version: 'test1'
  }
});

app.get(
  '/errorRoute',
  function ( req, res, next ) {
    // You can push in errors manually
    res.send("Error");
    res.end();
    next(new Error("Got traffic on the errorRoute"));
  }
);

app.get(
  '/anotherRoute',
  function ( req, res, next ) {
    // It'll even log potentially unexpected errors
    JSON.parse("{\"malformedJson\": true");
  }
)

// Just use the express plugin
app.use(errorHandler.express);

app.listen(
  3000
  , function ( ) {
    console.log('Server has been started on port 3000');
  }
);

This issue has been migrated from the cloud-errors-nodejs issue #10.

@DominicKramer DominicKramer added api: error-reporting type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels May 11, 2017
@ivanseidel
Copy link

ivanseidel commented Jul 15, 2017

Same problem here. This is really bad, because it seems it's not even attempting to report errors (watched requests from Charles, and none was to https://clouderrorreporting.clients6.google.com/v1beta1/projects/<myproj>/services?key=....

It seems that it's validating OAuth before sending, but not being able to "check" the token, because there isn't none.

Note: It works when Curl'ing to the endpoint with the same params.

@evaogbe evaogbe added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Aug 7, 2017
@stephenplusplus
Copy link
Contributor

Sorry, handing it over to @ofrobots who oversees the logging-* and error-reporting.

@kjin
Copy link
Contributor

kjin commented Oct 3, 2017

@ivanseidel, and @steren who filed the original bug

This is fixed in error-reporting v0.2.2, please re-open this bug if you have any issues with it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: error-reporting priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

7 participants