This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Ncbi Entrez Server Issues

Dear All, I am using entrez protein data base for searching a list 40 000 of protein ids, I set stop time (0.3) to keep ncbi server happy my program runs OK at first, but after running 1hrs or so..it shows

 File "snpinfo_new.py", line 31, in <module>
    fg=Entrez.efetch(db='protein', id=uid, rettype='fasta').read()
  File "/opt/python-2.7/lib/python2.7/site-packages/Bio/Entrez/__init__.py", line 113, in efetch
    return _open(cgi, variables)
  File "/opt/python-2.7/lib/python2.7/site-packages/Bio/Entrez/__init__.py", line 360, in _open
    raise exception
urllib2.HTTPError: HTTP Error 500: Internal Server Error

..how I fix this?

Thanks a lot!

biopython entrez ncbi protein dbsnp

Thanks a lot :-) !!

1 answer

Like any web-based API, you will sometimes get intermittent errors from Entrez - the standard approach would be to wrap the call in a try/except block and retry it (e.g. three retries, with a pause between each).

Log in to answer this question.