Skip to content

Recent installation of parsec construct download URL wrongly #35

@pcm32

Description

@pcm32

A recent installation of parsec (last couple of weeks) over pip produces the following error on an attempt to download a dataset:

GalaxyInstance object for Galaxy at http://platform.persist-seq.org/galaxy/
Traceback (most recent call last):
  File "/mymachine/myuser/venvs/galaxy-parsec/lib64/python3.9/site-packages/parsec/decorators.py", line 18, in custom_exception
    return wrapped(*args, **kwargs)
  File "/mymachine/myuser/venvs/galaxy-parsec/lib64/python3.9/site-packages/parsec/decorators.py", line 36, in json_output
    output = wrapped(*args, **kwargs)
  File "/mymachine/myuser/venvs/galaxy-parsec/lib64/python3.9/site-packages/parsec/commands/datasets/download_dataset.py", line 46, in cli
    return ctx.gi.datasets.download_dataset(dataset_id, file_path=file_path, use_default_filename=use_default_filename, require_ok_state=require_ok_state, maxwait=maxwait)
  File "/mymachine/myuser/venvs/galaxy-parsec/lib64/python3.9/site-packages/bioblend/galaxy/datasets/__init__.py", line 115, in download_dataset
    r.raise_for_status()
  File "/mymachine/myuser/venvs/galaxy-parsec/lib64/python3.9/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://platform.persist-seq.org/api/histories/fbaae07cedf84009/contents/70f561ec53a10e88/display?to_ext=h5ad

404 Client Error: Not Found for url: http://platform.persist-seq.org/api/histories/fbaae07cedf84009/contents/70f561ec53a10e88/display?to_ext=h5ad

For some reason, this pip install also uses a very old version of bioblend (not sure why requirements get resolved like that, but I remember seeing this before, since it worked I didn't pay attention to it):

pip list
Package            Version
------------------ ---------
bioblend           0.16.0
boto               2.49.0
certifi            2024.8.30
charset-normalizer 3.4.0
click              8.1.7
future             1.0.0
galaxy-parsec      1.16.0
idna               3.10
junit-xml          1.7
justbackoff        0.6.0
pip                20.2.4
PyYAML             6.0.2
requests           2.32.3
requests-toolbelt  1.0.0
setuptools         50.3.2
six                1.16.0
urllib3            2.2.3
wrapt              1.16.0
xunit-wrapper      0.12

The problem seems to be in this line of the installed bioblend:

        download_url = dataset['download_url'] + '?to_ext=' + file_ext
        url = urljoin(self.gi.base_url, download_url)

where, when joining the correct URL stored in the gi object (in this case http://platform.persist-seq.org/galaxy/) with the download_url /api/histories/fbaae07cedf84009/contents/70f561ec53a10e88/display?to_ext=h5ad the prefix galaxy gets stripped and the end URL ends up being:

http://platform.persist-seq.org/api/histories/fbaae07cedf84009/contents/70f561ec53a10e88/display?to_ext=h5ad

without galaxy, which of course doesn't exists. I'm guessing issue must be between some old version of bioblend and newer versions or urlib perhaps? Not sure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions