DNS lookup failed for URL

327 views
Skip to first unread message

Sofia S

unread,
Dec 21, 2015, 5:26:20 AM12/21/15
to Google App Engine
This code works fine in the simulator (i.e. GoogleAppEngineLauncher). I get an DNS error when run on the GAE server. How can I fix this?

#!/usr/bin/env python

import webapp2
from google.appengine.api import urlfetch

class MainHandler(webapp2.RequestHandler):
  
  def get(self):
    self.response.headers['Content-Type'] = 'text/html; charset=windows-1251'
    
    try:
      result = urlfetch.fetch("http://rutracker.org/")
      self.response.write(result.content)
    except Exception as e:
      self.response.write(e)
    
app = webapp2.WSGIApplication([
    ('/.*', MainHandler)
], debug=True)



Nick (Cloud Platform Support)

unread,
Dec 21, 2015, 1:43:46 PM12/21/15
to Google App Engine
Including the text of the error would be useful. It's unclear as of this moment where the root cause of the issue lies. I've attempted to reproduce using the code you supplied, but instead saw either no error, or one time, "deadline exceeded" from urlfetch, which could be caused by a high load on the server. A dig query from a GCE machine shows they have records in place, and curl can successfully retrieve a page from rutracker.org

Is this still happening to you?

dig rutracker.org ANY

; <<>> DiG 9.9.5-3ubuntu0.6-Ubuntu <<>> rutracker.org ANY
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57269
;; flags: qr rd ra; QUERY: 1, ANSWER: 10, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;rutracker.org.                 IN      ANY

;; ANSWER SECTION:
rutracker.org.          489     IN      SOA     ns1.rutracker.org. hw.rutracker.org. 15122121 3600 900 120960 600
rutracker.org.          489     IN      NS      ns2.rutracker.org.
rutracker.org.          489     IN      NS      ns4.rutracker.org.
rutracker.org.          489     IN      NS      ns1.rutracker.org.
rutracker.org.          489     IN      NS      ns3.rutracker.org.
rutracker.org.          489     IN      NS      ns5.rutracker.org.
rutracker.org.          489     IN      A       195.82.146.214
rutracker.org.          489     IN      AAAA    2a02:4680:22::214
rutracker.org.          489     IN      MX      5 mail.rutracker.org.
rutracker.org.          489     IN      TXT     "v=spf1 mx mx:mail.rutracker.org -all"

;; Query time: 1 msec
;; SERVER: 169.254.169.254#53(169.254.169.254)
;; WHEN: Mon Dec 21 18:42:03 UTC 2015
;; MSG SIZE  rcvd: 285
Message has been deleted

Sofia S

unread,
Dec 22, 2015, 1:57:11 AM12/22/15
to Google App Engine
Yesterday, during the working day I myself observed this mistake. 100% of the requests. Suddenly, everything is fine now. I can not understand what is happening. Many thanks for the quick reply!

Sofia S

unread,
Dec 22, 2015, 2:27:24 AM12/22/15
to Google App Engine
I see in the log my requests 2015-12-21 07:11 GMT - 2015-12-21 13:37 GMT.
This is probably a false alarm protect the server from DDoS attacks.

Nick (Cloud Platform Support)

unread,
Dec 22, 2015, 12:28:19 PM12/22/15
to Google App Engine
Hey Sofia,

Glad to hear it's working. Yes, your estimate might be correct. I did also observe some timeouts and failures even while looking into this. Without rutracker confirming this, it's just a user report, but it does seem possible.
Reply all
Reply to author
Forward
0 new messages