braintree / braintree-web

A suite of tools for integrating Braintree in the browser
https://developer.paypal.com/braintree/docs/start/hello-client/javascript/v3
MIT License
444 stars 134 forks source link

BraintreeError: Cannot contact the gateway at this time #296

Closed jasonfb closed 6 years ago

jasonfb commented 7 years ago

General information

Issue description

We get this error running our specs under Poltergeist and Phantom JS. We are using Phantom JS 2.1.1

I have attempted setting --ssl-protocol=tlsv1.2 to our Phantom JS config but this does not fix the error.

crookedneighbor commented 7 years ago

First, can you upgrade to the latest version (3.15.0)?

Second, if the issue persists, can you provide a github repo that reproduces the problem with instructions for installing any dependencies and how to run the tests?

jasonfb commented 7 years ago

Maybe, and yes. I will try to put together a sample app for reproducing

reidcooper commented 7 years ago

@crookedneighbor

My coworker is on vacation this week so I took over this ticket at our company. Here (https://github.com/reidcooper/braintree-error-cannot-connect) I have a sample application.

However, I cannot seem to reproduce the bug at the moment. Will try and determine if it is due a specific commit within our production application.

crookedneighbor commented 7 years ago

@reidcooper It sounds like there is nothing actionable for us as this moment.

I'm going to close this for now. But as soon as it's reproducible, comment here and I'll re-open it.

jasonfb commented 7 years ago

@crookedneighbor -- for the posterity of the issue, just waned to report back for others that we confirmed the root cause of this was (unintentional) double-invocations of window.braintree.client(...) functional itself.. When we corrected our code not to double invoke that function, the problem went away. As explained above, symptom did not seem to manifest in Production, only in the phantomjs (with capybara/rspec) test environment.

Good to close as this was from our own refactor.

jasonfb commented 7 years ago

cross posted to https://stackoverflow.com/questions/44217489/braintreeerror-cannot-contact-the-gateway-at-this-time-during-system-integrati/44217509#44217509

crookedneighbor commented 7 years ago

Thanks for the update!

carlosds730 commented 6 years ago

Hello there, since this morning I'm having this same issue with the Sandbox.

The error is the following

{
    code: "CLIENT_GATEWAY_NETWORK",
    details: {
        originalError: "error"
    },
    message: "Cannot contact the gateway at this time.",
    name: "BraintreeError",
    type: "NETWORK"
}

I can only reproduce the problem on Chrome.

I'm ussing BT JS Version 3.31

jasonfb commented 6 years ago

did you contact support at support@braintreepayments.com

unless it's on your end, I'd reckon a network error is on their end.

sounds unrelated to code implementation.

carlosds730 commented 6 years ago

Well, the issue is that it works on Firefox, IE and Edge, it only fails on Chrome

jasonfb commented 6 years ago

huh?

Ah yes sorry didn't read closely.

not sure if it is related but you can see our notes on the fix related to the original issue above

carlosds730 commented 6 years ago

I've read your post on the fix, however, I'm using JS SDK version 3.31, which already has that fix in place. Is this possible that it is related to this issue https://github.com/braintree/braintree-web/issues/343 ?

carlosds730 commented 6 years ago

It now fails on Firefox, Edge and Chrome (all in Windows). I've tested with Firefox and Chrome on Ubuntu and it works fine. What could it be?

jasonfb commented 6 years ago

it's possible. are you experiencing this in actual Chrome or in chromedriver driving chrome?

If you are seeing this in the spec suite (using chromedriver), be sure to update chromedriver to the latest.

carlosds730 commented 6 years ago

I'm having the problem with real Chrome Version 64.0.3282.167 (Official Build) (64-bit)

jasonfb commented 6 years ago

ohhhh… in this case definitely contact support.

you're saying the symptom happens in sandbox but not in Prod?

are you seeing any SSL/TLS error(s) or any other errors in the chrome developer console?

carlosds730 commented 6 years ago

It only happens in the sandbox. I see no other errors in the sandbox. It appears to be a CONNECTION_CLOSED.

crookedneighbor commented 6 years ago

@carlosds730 Definitely contact support so we can get more details about it. I'll re-open the issue.

carlosds730 commented 6 years ago

Ok, I'll send them an email, and put a link to this issue

carlosds730 commented 6 years ago

I opened a Support Ticket and somehow it got fixed. I guess you can close the issue. Thanks for everything

carlosds730 commented 6 years ago

It's happening again

crookedneighbor commented 6 years ago

I checked our ticketing system and it looks like the issue is resolved for you now. Going to close this.

genisgetman commented 5 years ago

I had the same error and I solve it! Http request does reject because request headers non include the 'Access-Control-Allow-Origin' header I resolved this problem by adding Access-Control-Allow-Origin plugin to Chrome extensions.

crookedneighbor commented 5 years ago

@genisgetman I assume this is a limitation with something in your development environment, and not in production.

MatissJanis commented 5 years ago

We've been lately receiving quite a lot of these exceptions in our bugnsag account. Not sure how to reproduce.

crookedneighbor commented 5 years ago

@MatissJanis please reach out to our support team: https://help.braintreepayments.com/

thanatos11 commented 4 years ago

I also have this problem: JS SDK Environment: sandbox Browser: Chrome Version 79.0.3945.130 (Official Build) (64-bit) Error function: Braintree.client.create() Error Output: { name: "BraintreeError" code: "CLIENT_GATEWAY_NETWORK" message: "Cannot contact the gateway at this time." type: "NETWORK" }

GeorgeLinut commented 4 years ago

We experience the same problem as @thanatos11.

g-anedda commented 4 years ago

We too

dmolnarqu commented 4 years ago

Must be on their end. It started happening in the middle of testing today.

dnwilson commented 4 years ago

Just here to say me too 😢 . Glad to know we're all in this together today 💪

riccardomessineo commented 4 years ago

Not working :(

image Why bother having a status page that displays wrong information? I really don't get it. And it's not just a Braintree problem, every status page of every online service I've seen says it's ok while it isn't!

dnwilson commented 4 years ago

Looks like it's working again

dnwilson commented 4 years ago

It started working on my staging but still down on my local env

crookedneighbor commented 4 years ago

Anyone that is having issues, please contact our support team so we can dig into what is going on. https://help.braintreepayments.com/

simeyla commented 3 years ago

Edit: As @crookedneighbor mentioned below this was a mistake on my part. Some VPN software may have similar issues but not necessarily this specific message.


If you're getting CLIENT_GATEWAY_NETWORK errors please note that simply having an HTTP debugging proxy tool (such as Fiddler) open can cause CORS errors which can trigger this error. There may be other reasons, but if a customer or tester is getting this error it may be worth asking if they are using such a tool.

I just opened this issue in hopes of further exploration: https://github.com/braintree/braintree-web/issues/562

crookedneighbor commented 3 years ago

Just to follow up on this, the comment about Fiddler was because @simeyla had custom rules on without realizing it: https://github.com/braintree/braintree-web/issues/562#issuecomment-806357436

reyesvicente commented 3 years ago

Getting this error now python sdk v4.12.0 hosted fields v3.80.0

{
  "name": "BraintreeError",
  "code": "CLIENT_GATEWAY_NETWORK",
  "message": "Cannot contact the gateway at this time.",
  "type": "NETWORK",
  "details": {
    "originalError": "error"
  }
}
yongchengchen commented 2 years ago

Getting the error today. hosted fields v3.80.0. there's one of our customer, keep get the error. first use his home network, then change to mobile phone hot spot, both got error. { "name": "BraintreeError", "code": "CLIENT_GATEWAY_NETWORK", "message": "Cannot contact the gateway at this time.", "type": "NETWORK", "details": { "originalError": "error" } }

crookedneighbor commented 2 years ago

@yongchengchen that indicates that the Braintree API was not reachable. I expect that since it was limited to one customer, there was something wrong with their specific device. If the issue is persisting with that customer, please reach out to our support team so we can troubleshoot. https://developer.paypal.com/braintree/help