Appengine appears to be serving from the wrong region

133 views
Skip to first unread message

Eli Dourado

unread,
Jan 17, 2016, 10:10:23 AM1/17/16
to Google App Engine

I have an appengine app that I created in the europe-west region that has been running fine for months, but inexplicably, a couple days ago it seems to have stopped being served from that region. I am using the app to access the Betfair API, which is restricted from the US but available in Europe. Because of the sudden change, the app's attempts to log in to Betfair are now failing. In the console, the location is still listed as europe-west, but I guess the IP it is being served from geolocates to Mountain View, and this is breaking my app. What can I do? Is there a configuration option for app.yaml or something similar to force the app to serve from Europe?

Adam (Cloud Platform Support)

unread,
Jan 19, 2016, 2:20:33 PM1/19/16
to Google App Engine
Are you accessing the Betfair API via URL Fetch or Sockets? Are you able to share the feedback from Betfair on which IP is sending the request? Also, does Betfair share any information on how they perform geolocation on IPs (such as a public database, regional registry lookup or other method)?

One thing you could try is switching to Sockets if you are currently using URL Fetch or vice-versa.

Eli Dourado

unread,
Jan 20, 2016, 8:23:50 PM1/20/16
to google-a...@googlegroups.com
Thanks for the reply, Adam. I’m using a library that uses a socket because I need to access Betfair with a client-side certificate. Is there a way to use a client-side certificate with URL Fetch?

Relevant Go code for the method that communicates with Betfair is here:

cert, err := tls.LoadX509KeyPair(s.config.CertFile, s.config.KeyFile)
if err != nil {
return nil, err
}
ssl := &tls.Config {
Certificates: []tls.Certificate{cert},
InsecureSkipVerify: true,
}
ssl.Rand = rand.Reader
s.httpClient = &http.Client {
Transport: &http.Transport {
Dial: func(network, addr string) (net.Conn, error) {
return socket.Dial(c, network, addr)
},
TLSClientConfig: ssl,
},
}

res, err := s.httpClient.Do(req)





--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/8ofMpp05MgQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/f7ba94c4-e7b2-418f-a32e-500413699c9e%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Adam (Cloud Platform Support)

unread,
Jan 25, 2016, 4:16:53 PM1/25/16
to Google App Engine
Currently client-side certificates are only supported when using Sockets. There is an open issue to add support for them in URL Fetch in the future. However there is no guarantee that using URL Fetch would solve your problem.

It may be helpful to find out how BetFair performs its geolocation (eg. is it route based or simply a RIR lookup on the originating IP?). You may need to set up an intermediate proxy in order to work around BetFair's method of geolocation.
To unsubscribe from this group and all its topics, send an email to google-appengine+unsubscribe@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.

Eli Dourado

unread,
Jan 25, 2016, 4:19:08 PM1/25/16
to google-a...@googlegroups.com
Thanks, Adam. The frustrating thing is that my site was working for months, and then suddenly stopped. I’m not sure if the change was on Google’s end or Betfair’s. But I will check with them.

To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/8ofMpp05MgQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages