I have made one webserver on web2py. It runs perfectly sometime and sometime it throws error: <class 'urllib2.HTTPError'> HTTP Error 404: Not Found
I am not able to understand it this error. Why my application runs smoothly sometime and sometime throws this kind of error.
Traceback (most recent call last):
File "/opt/web-apps/web2py/gluon/restricted.py", line 217, in restricted
exec ccode in environment
File "/opt/web-apps/web2py/applications/CleavPredict/controllers/default.py", line 1143, in <module>
File "/opt/web-apps/web2py/gluon/globals.py", line 372, in <lambda>
self._caller = lambda f: f()
File "/opt/web-apps/web2py/applications/CleavPredict/controllers/default.py", line 983, in pdbid_res
return pdbid_result()
File "/opt/web-apps/web2py/applications/CleavPredict/controllers/default.py", line 955, in pdbid_result
responsemmpn = urllib2.urlopen(requestmmpn)
File "/usr/lib64/python2.6/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib64/python2.6/urllib2.py", line 397, in open
response = meth(req, response)
File "/usr/lib64/python2.6/urllib2.py", line 510, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib64/python2.6/urllib2.py", line 429, in error
result = self._call_chain(*args)
File "/usr/lib64/python2.6/urllib2.py", line 369, in _call_chain
result = func(*args)
File "/usr/lib64/python2.6/urllib2.py", line 616, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "/usr/lib64/python2.6/urllib2.py", line 397, in open
response = meth(req, response)
File "/usr/lib64/python2.6/urllib2.py", line 510, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib64/python2.6/urllib2.py", line 435, in error
return self._call_chain(*args)
File "/usr/lib64/python2.6/urllib2.py", line 369, in _call_chain
result = func(*args)
File "/usr/lib64/python2.6/urllib2.py", line 518, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 404: Not Found
It also shows the code where this error is coming:
params4 = {'from':'ID', 'to':'P_ENTREZGENEID', 'format':'tab', 'query':mmpn}
data6 = urllib.urlencode(params4)
requestmmpn = urllib2.Request('http://www.uniprot.org/mapping/', data6)
responsemmpn = urllib2.urlopen(requestmmpn)