use google+ api oauth2 service error - hyperledger-fabric

I have followed the document(https://hyperledger.github.io/composer/latest/tutorials/google_oauth2_rest) setup my business network , and use my own google accounts.
when I access http://localhost:3000/auth/google , then operated allow action, got error after minutes waiting.
error as follows:
{
  "error":{
    "statusCode":500,
    "name":"InternalOAuthError",
    "message":"Failed to obtain access token",
    "oauthError":{
      "code":"ECONNREFUSED",
      "errno":"ECONNREFUSED",
      "syscall":"connect",
      "address":"172.217.24.13",
      "port":443
    },
    "stack":"Error: connect ECONNREFUSED 172.217.24.13:443
at Strategy.OAuth2Strategy._createOAuthError (/home/composer/node_modules/passport-oauth2/lib/strategy.js:379:17)
at /home/composer/node_modules/passport-oauth2/lib/strategy.js:166:45
at /home/composer/node_modules/oauth/lib/oauth2.js:191:18
at ClientRequest.<anonymous> (/home/composer/node_modules/oauth/lib/oauth2.js:162:5)
at emitOne (events.js:116:13)
at ClientRequest.emit (events.js:211:7)
at TLSSocket.socketErrorListener (_http_client.js:387:9)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)"
  }
}

Its trying to contact accounts.google.com with the IP address 172.217.24.13.
https://ipinfo.io/172.217.24.13
That is almost certainly some kind of local networking problem. Are you in an office with a firewall, or a proxy enabled? Because of this, it cannot go to the next step which is to redirect to http://localhost:3000/explorer
Maybe you need HTTPS_PROXY set for https requests. AFAIK, it may be either a complete URL or a “host[:port]” etc.

Related

Why does Stripe API output "Request metrics buffer is full, dropping telemetry message."?

In Node v12 with the Stripe API client v, I am running a client.getSubscription() call on about 200 items in a loop.
I get this message in the output (--trace-warnings is turned on):
Getting subscription data for a#email.com...
Getting subscription data for b#email.com...
Getting subscription data for c#email.com...
(node:25078) Stripe: Request metrics buffer is full, dropping telemetry message.
at Object.emitWarning (/home/nick/src/project/node_modules/stripe/lib/utils.js:437:18)
at Constructor._recordRequestMetrics (/home/nick/src/project/node_modules/stripe/lib/StripeResource.js:370:15)
at IncomingMessage.<anonymous> (/home/nick/src/project/node_modules/stripe/lib/StripeResource.js:192:14)
at Object.onceWrapper (events.js:481:28)
at IncomingMessage.emit (events.js:387:35)
at IncomingMessage.emit (domain.js:470:12)
at endReadableNT (internal/streams/readable.js:1317:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
(node:25078) Stripe: Request metrics buffer is full, dropping telemetry message.
at Object.emitWarning (/home/nick/src/project/node_modules/stripe/lib/utils.js:437:18)
at Constructor._recordRequestMetrics (/home/nick/src/project/node_modules/stripe/lib/StripeResource.js:370:15)
at IncomingMessage.<anonymous> (/home/nick/src/project/node_modules/stripe/lib/StripeResource.js:192:14)
at Object.onceWrapper (events.js:481:28)
at IncomingMessage.emit (events.js:387:35)
at IncomingMessage.emit (domain.js:470:12)
at endReadableNT (internal/streams/readable.js:1317:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
(node:15748) Stripe: Request metrics buffer is full, dropping telemetry message.
...
I think this error is coming from an underlying library that Stripe is using, since I cannot find any information on Google or Stripe's docs with that specific error in it.
It also does not appear to be a critical error, the calls succeed.
This is a warning that's emitted from stripe-node when request telemetry can't be sent because the buffer is full: https://github.com/stripe/stripe-node/blob/12ebce4220c22e1e1a6a0480ba96c2baffe01b8c/lib/StripeResource.js#L395
The telemetry is latency information which is sent to Stripe for metrics purposes.
It's safe to ignore these as they are just warnings and won't affect the actual API operations. If however they are a bit too noisy for your liking you can disable telemetry entirely with the config object:
const stripe = Stripe('sk_test_...', {
telemetry: false,
});

Why am I getting a rate limiting error on post requests?

Whenever I send a post request, I'm getting the following error. I couldn't track down where it is coming from.
SentryError: HTTP Error (429): Creation of this event was denied due to rate limiting
at new SentryError (/home/bwsuser/bws-verwaltung/node_modules/#sentry/core/dist/error.js:9:28)
at ClientRequest.<anonymous> (/home/bwsuser/bws-verwaltung/node_modules/#sentry/node/dist/transports/base.js:46:44)
at Object.onceWrapper (events.js:315:30)
at emitOne (events.js:116:13)
at ClientRequest.emit (events.js:211:7)
at HTTPParser.parserOnIncomingClient (_http_client.js:543:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:112:17)
at TLSSocket.socketOnData (_http_client.js:440:20)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at TLSSocket.Readable.push (_stream_readable.js:208:10)
at TLSWrap.onread (net.js:597:20)
anyone has any idea what might be causing that? or at least where to start looking.
I ran out of ideas here :/
anyone has any idea what might be causing that? or at least where to start looking. I ran out of ideas here :/
Yes, certainly, you need to look here at Quota Management | Sentry Documentation. It mostly happens when you run an app from a local dev server. Here's the summary right from the doc ...
Sentry completes a thorough evaluation of each event to determine if it counts toward your quota, as outlined in this overview. Detailed documentation for each evaluation is linked throughout. Before completing any of these evaluations, Sentry confirms that each event includes a valid DSN and project as well as whether the event can be parsed. In addition, for error events, Sentry validates that the event contains valid fingerprint information. If any of these items are missing or incorrect, the event is rejected.
Another hint, try to disable all your browser extensions and check if that call is gone. I just figure out it is called by a chrome extension for me.
Hope helps

Connection to Mongodb Atlas cluster is closing unexpectedly

I am getting mongo error ie 'connection to MongoDB closed' for every other database request that I am making, I looked it up and the solutions were
whitelisting IP - added 0.0.0.0/0 to allowed IP,
setting up the URI correctly,
Checking connection - was able to connect from Studio 3t application,
The error Log says:
MongoError: connection 72 to cluster0-shard-00-01-****.mongodb.net:27017 closed
at Function.MongoError.create (/**/node_modules/mongodb-core/lib/error.js:29:11)
at TLSSocket.<anonymous> (/**/node_modules/mongodb-core/lib/connection/connection.js:214:22)
at Object.onceWrapper (events.js:285:13)
at TLSSocket.emit (events.js:202:15)
at TLSSocket.EventEmitter.emit (domain.js:446:20)
at _handle.close (net.js:611:12)
at Socket.done (_tls_wrap.js:412:7)
at Object.onceWrapper (events.js:285:13)
at Socket.emit (events.js:197:13)
at Socket.EventEmitter.emit (domain.js:446:20)
at TCP._handle.close (net.js:611:12)
I have tried everything with no results, If someone can help me out for which direction to look into or anyone who has faced it and resolved it who can guide me, it would be much appreciated.
Go to your cluster network access and add again your IP address in the IP Whitelist. I am using wi-fi and my id change periodically.

IBM Watson Conversation - Unable to connect node.js to watson conversation

I have a Problem with an IBM Watson Conversation Application.
I have my Application set up and try to connect it to my node.js Application. I’m following this tutorial here:
https://github.com/watson-developer-cloud/node-sdk#conversation
and i am using the official node.js api ibm provides.
Unfortunately it does not work and i get following error.
{ Error: Not Authorized
at Request._callback (/Volumes/hd2/Projekte/vi-com-bot-service/node_modules/watson-developer-cloud/lib/requestwrapper.js:87:15)
at Request.self.callback (/Volumes/hd2/Projekte/vi-com-bot-service/node_modules/watson-developer-cloud/node_modules/request/request.js:188:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.<anonymous> (/Volumes/hd2/Projekte/vi-com-bot-service/node_modules/watson-developer-cloud/node_modules/request/request.js:1171:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage.<anonymous> (/Volumes/hd2/Projekte/vi-com-bot-service/node_modules/watson-developer-cloud/node_modules/request/request.js:1091:12)
at IncomingMessage.g (events.js:291:16)
at emitNone (events.js:91:20)
code: 401,
error: 'Not Authorized',
description: '2017-06-01T08:57:57-04:00, Error ERCDPLTFRM-DNLKUPERR occurred when accessing https://gateway.watsonplatform.net/conversation/api/v1/workspaces/dc8097e8-fea7-47a3-80ed-57c43321377e/message?version=2017-04-21, Tran-Id: gateway-dp01-2475007148 - Invalid UserId and/or Password. Please confirm that your credentials match the end-point you are trying to access. A common error is trying to use credentials from an experimental or beta release against a GA release or vice versa' }
The Credentials i provide are correct.
Do you have ay idea, why i does not work?
Best, ben
Bluemix has a number of regions where you can host services. There are different gateways into each region. By default it is https://gateway.watsonplatform.net.
For Germany + France Regions you would set the following URL variable in the code:
url: 'https://gateway-fra.watsonplatform.net/conversation/api/'
Like so:
var conversation = new ConversationV1({
username: '<username>',
password: '<password>',
url: 'https://gateway-fra.watsonplatform.net/conversation/api/',
version_date: ConversationV1.VERSION_DATE_2017_05_26
});
For other regions, you can go into the Watson conversation service credentials to see the URL. Or the conversation workspace "Deploy" then "Credentials" section.
This is the link to the revised IBM Cloud API for Watson Assistant including code samples for node.js and a list of URLs (see 'Service Endpoint').
var ConversationV1= require('watson-developer-cloud/conversation/v1');
var conversation = new ConversationV1({
username:'<username>',
password: '<Password>',
version_date: 'Date'
});
conversation.message({
workspace_id:'<Workspace Id>',
context: userContext,
input: {
"text": "<text>"
}
},function(err,resp){
});

429 Too Many Requests Error While Running Mocha Test - NodeJS / Swagger API

I used swagger (swagger.io) to built my app's API and everything works fine in production environment. However, when I ran some mocha tests on these APIs, I keep getting this error regarding status code 429 Too Many Requests:
Unhandled rejection Error: Too Many Requests
at Request.callback (..../node_modules/superagent/lib/node/index.js:698:17)
at IncomingMessage.<anonymous> (..../node_modules/superagent/lib/node/index.js:922:12)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:926:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)
Usually this error happens after I ran the mocha test twice in a row (ie start throwing this error from the third time onwards). I suspected I was overloading my localhost server, but the error persisted even after I closed and reopened the server.
Would be super grateful if someone could point me towards the right direction to solve this problem.

Resources