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


On Monday, December 21, 2015 at 5:26:20 AM UTC-5, Sofia S wrote:
>
> 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)
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
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/a367c316-a6c8-4231-a5d8-f0cbd28b44c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to