Search code examples
uber-api

Uber API randomly timeout


Since a couple of months we are facing a lot of timeout on the Uber estimates API. We are making requests using curl, here is what the verbose output print on my test server when it timeouts

curl -v \
-H 'Authorization: Token [my token]' \
-H 'Accept-Language: fr_FR' \
-H 'Content-Type: application/json' \
'https://api.uber.com/v1.2/estimates/price? start_latitude=48.8676689&start_longitude=2.3677804&end_latitude=48.8791163&end_longitude=2.3560725'
*   Trying 104.36.195.168...

When curl halts on connection I try to nc at the same time on the 443 port

nc -vz 104.36.195.157 443

No response either

After a few seconds the same nc command respond success but the curl call still halts.

After a few minutes curl will timeout and retry and it will finally work here is the curl output

*   Trying 104.36.194.191...
* TCP_NODELAY set
* connect to 104.36.194.191 port 443 failed: Connection timed out
*   Trying 104.36.195.168...
* TCP_NODELAY set
* After 85223ms connect time, move on!
* connect to 104.36.195.168 port 443 failed: Connection timed out
*   Trying 104.36.195.165...
* TCP_NODELAY set
* Connected to api.uber.com (104.36.195.165) port 443 (#0)

After the curl manage to connect successfully, I get the response from the API.

Sometime the curl call will work directly and respond the right API result.

Also, when I ping api.uber.com it sometimes does not respond

$ dig api.uber.com
; <<>> DiG 9.11.3-1ubuntu1.3-Ubuntu <<>> api.uber.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12152
;; flags: qr rd ra; QUERY: 1, ANSWER: 7, AUTHORITY: 0, ADDITIONAL:

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:

;api.uber.com.          IN  A

;; ANSWER SECTION:
api.uber.com.       60  IN  CNAME   frontends.uber.com.
frontends.uber.com. 59  IN  CNAME   frontends-dca1.uber.com.
frontends-dca1.uber.com. 8  IN  A   104.36.195.158
frontends-dca1.uber.com. 8  IN  A   104.36.194.159
frontends-dca1.uber.com. 8  IN  A   104.36.194.134
frontends-dca1.uber.com. 8  IN  A   104.36.195.165
frontends-dca1.uber.com. 8  IN  A   104.36.195.162

;; Query time: 44 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Thu Jan 17 12:33:30 CET 2019
;; MSG SIZE  rcvd: 174

$ ping 104.36.195.158
PING 104.36.195.158 (104.36.195.158) 56(84) bytes of data.
^C
--- 104.36.195.158 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2047ms

$ ping 104.36.194.159
PING 104.36.194.159 (104.36.194.159) 56(84) bytes of data.
64 bytes from 104.36.194.159: icmp_seq=1 ttl=48 time=86.0 ms
64 bytes from 104.36.194.159: icmp_seq=2 ttl=48 time=85.6 ms
64 bytes from 104.36.194.159: icmp_seq=3 ttl=48 time=85.6 ms
^C
--- 104.36.194.159 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 85.639/85.772/86.031/0.183 ms

My test server is an Ubuntu 18 on AWS EC2. I tried to reproduce the issue on my local environment (Mint 18.3 Sylvia Ubuntu 16.04) but it always work!

When the test server was on Ubuntu 16.04 we didn't seem to have the problem either. Is there a problem on my current test environment ?

Is anyone experiencing the same behavior ?

Thanks for your time!


Solution

  • A few days ago the problem solved itself without any action on my side.