enasearch icon indicating copy to clipboard operation
enasearch copied to clipboard

requests.exceptions.HTTPError: 500 Server Error

Open nick-youngblut opened this issue 3 years ago • 2 comments

>>> enasearch.retrieve_run_report(accession="ERR1558694", fields="run_accession,instrument_platform,library_strategy,read_count,fastq_ftp")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/ebio/abt3_projects/software/dev/miniconda3_dev/envs/database/lib/python2.7/site-packages/enasearch/__init__.py", line 737, in retrieve_run_report
    file=file)
  File "/ebio/abt3_projects/software/dev/miniconda3_dev/envs/database/lib/python2.7/site-packages/enasearch/__init__.py", line 721, in retrieve_filereport
    return request_url(url, "text", file)
  File "/ebio/abt3_projects/software/dev/miniconda3_dev/envs/database/lib/python2.7/site-packages/enasearch/__init__.py", line 375, in request_url
    r.raise_for_status()
  File "/ebio/abt3_projects/software/dev/miniconda3_dev/envs/database/lib/python2.7/site-packages/requests/models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://www.ebi.ac.uk/ena/portal/api/filereport

conda env

# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
backports                 1.0                      py27_1    conda-forge
biopython                 1.76             py27h516909a_0    conda-forge
blas                      1.0                         mkl
brotlipy                  0.7.0           py27h516909a_1000    conda-forge
ca-certificates           2021.7.5             h06a4308_1
certifi                   2020.6.20          pyhd3eb1b0_3
cffi                      1.14.0           py27he30daa8_1
chardet                   3.0.4           py27h8c360ce_1006    conda-forge
click                     8.0.0              pyhd3eb1b0_0
configparser              4.0.2                    py27_0
contextlib2               0.6.0.post1                py_0    conda-forge
cryptography              2.8              py27h2c19f6a_2    conda-forge
dicttoxml                 1.7.4                    py27_0    conda-forge
enasearch                 0.2.2                    py27_1    bioconda
enum34                    1.1.10           py27h8c360ce_1    conda-forge
flake8                    3.8.3              pyh9f0ad1d_0    conda-forge
idna                      2.10               pyh9f0ad1d_0    conda-forge
importlib-metadata        1.5.0            py27h8c360ce_1    conda-forge
intel-openmp              2021.3.0          h06a4308_3350
ipaddress                 1.0.23                     py_0    conda-forge
libffi                    3.3                  h58526e2_2    conda-forge
libgcc-ng                 11.1.0               hc902ee8_8    conda-forge
libgfortran-ng            7.5.0               h14aa051_19    conda-forge
libgfortran4              7.5.0               h14aa051_19    conda-forge
libgomp                   11.1.0               hc902ee8_8    conda-forge
libstdcxx-ng              11.1.0               h56837e0_8    conda-forge
mccabe                    0.6.1                    py27_0    conda-forge
mkl                       2020.2                      256
mkl-service               2.3.0            py27he904b0f_0
mkl_fft                   1.0.15           py27ha843d7b_0
mkl_random                1.1.0            py27hd6b4f25_0
more-itertools            5.0.0                      py_0    conda-forge
ncurses                   6.2                  h58526e2_4    conda-forge
numpy                     1.16.6           py27hbc911f0_0
numpy-base                1.16.6           py27hde5b4d6_0
openssl                   1.1.1k               h7f98852_1    conda-forge
pathlib2                  2.3.5            py27h8c360ce_1    conda-forge
pip                       20.1.1             pyh9f0ad1d_0    conda-forge
pycodestyle               2.6.0              pyh9f0ad1d_0    conda-forge
pycparser                 2.20               pyh9f0ad1d_2    conda-forge
pyflakes                  2.2.0              pyh9f0ad1d_0    conda-forge
pyopenssl                 20.0.1             pyhd3eb1b0_1
pysocks                   1.7.1            py27h8c360ce_1    conda-forge
python                    2.7.18               ha1903f6_2
python_abi                2.7                    1_cp27mu    conda-forge
readline                  8.1                  h46c0cb4_0    conda-forge
requests                  2.25.1             pyhd3deb0d_0    conda-forge
scandir                   1.10.0           py27hdf8410d_1    conda-forge
setuptools                44.0.0                   py27_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
sqlite                    3.36.0               h9cd32fc_0    conda-forge
tk                        8.6.10               hed695b0_1    conda-forge
urllib3                   1.26.6             pyhd8ed1ab_0    conda-forge
wheel                     0.37.0             pyhd8ed1ab_1    conda-forge
xmltodict                 0.12.0                     py_0    conda-forge
zipp                      1.0.0                      py_0    conda-forge
zlib                      1.2.11            h516909a_1010    conda-forge

nick-youngblut avatar Aug 19 '21 08:08 nick-youngblut

Also, curl "https://www.ebi.ac.uk/ena/data/warehouse/filereport?accession=ERR1558694&result=read_run&fields=run_accession,instrument_platform,library_strategy,read_count,fastq_ftp" (as written in the docs) returns nothing, instead of:

ERR1558694  ILLUMINA    WGS 1259641 ftp.sra.ebi.ac.uk/vol1/fastq/ERR155/004/ERR1558694/ERR1558694_1.fastq.gz;ftp.sra.ebi.ac.uk/vol1/fastq/ERR155/004/ERR1558694/ERR1558694_2.fastq.gz

nick-youngblut avatar Aug 19 '21 08:08 nick-youngblut

Changing line 706 in __init__.py to url = baseUrl + "portal/api/filereport?" fixes the issue. enasearch has the old url hardcoded

nick-youngblut avatar Aug 21 '21 13:08 nick-youngblut