phac-nml / snvphyl-galaxy-cli

A command line interface for the SNVPhyl Galaxy pipeline.
Apache License 2.0
2 stars 2 forks source link

bioblend.ConnectionError when running with --deploy-docker #9

Closed PierreLyons closed 8 months ago

PierreLyons commented 8 months ago

Hello, I'm trying to run snyphyl-galaxy-cli on a local server as I don't have access to Galaxy. Here is my run command:

python igas/snvphyl-galaxy-cli/bin/snvphyl.py --deploy-docker --fastq-dir igas/test --reference-file igas/data/AE009949.1.fasta --min-coverage 5 --output-dir igas/output/test

However, upon running I get the following error/output:

Error: bioblend.ConnectionError: GET: error 403

Deploying Docker Container
==========================
Running 'docker run --detach --publish 48888:80 --volume /home/vitalite-dev/igas/test:/snvphyl-data/fastq phacnml/snvphyl-galaxy-1.0.1:1.0.1b'
Docker id 29770d99961911c4fa25181b0d175f88d3b6cbc8eea01abca3319e7cda603a3d
Waiting for docker to complete launching Galaxy on port 48888 .....finished.  Galaxy in Docker has (hopefully) started successfully.
Took 0.31 minutes to deploy docker

Examining input fastq files
===========================
Structuring data in directory '/home/vitalite-dev/igas/test' like:
igas-8-20240205_S5_L001: paired {forward: /home/vitalite-dev/igas/test/igas-8-20240205_S5_L001_R1_001.fastq.gz, reverse: /home/vitalite-dev/igas/test/igas-8-20240205_S5_L001_R2_001.fastq.gz}

Set up workflow input
=====================
setting parameter {irida.corefacility.ca/galaxy-shed/repos/nml/consolidate_vcfs/consolidate_vcfs/1.8.0, snv_abundance_ratio, 0.75}
setting parameter {irida.corefacility.ca/galaxy-shed/repos/nml/consolidate_vcfs/consolidate_vcfs/1.8.0, coverage, 5}
setting parameter {irida.corefacility.ca/galaxy-shed/repos/nml/verify_map/verify_map/1.8.0, mindepth, 5}
setting parameter {irida.corefacility.ca/galaxy-shed/repos/nml/consolidate_vcfs/consolidate_vcfs/1.8.0, mean_mapping, 30}
setting parameter {irida.corefacility.ca/galaxy-shed/repos/nml/find_repeats/findrepeat/1.8.0, length, 150}
setting parameter {irida.corefacility.ca/galaxy-shed/repos/nml/find_repeats/findrepeat/1.8.0, pid, 90}
setting parameter {irida.corefacility.ca/galaxy-shed/repos/nml/consolidate_vcfs/consolidate_vcfs/1.8.0, use_density_filter.threshold, 2}
setting parameter {irida.corefacility.ca/galaxy-shed/repos/nml/consolidate_vcfs/consolidate_vcfs/1.8.0, use_density_filter.window_size, 500}

Undeploying and cleaning up Docker Container
=============================================
Running 'docker rm -f -v 29770d99961911c4fa25181b0d175f88d3b6cbc8eea01abca3319e7cda603a3d'
29770d99961911c4fa25181b0d175f88d3b6cbc8eea01abca3319e7cda603a3d
Traceback (most recent call last):
  File "/home/vitalite-dev/igas/snvphyl-galaxy-cli/bin/snvphyl.py", line 1302, in <module>
    main(snvphyl_version_settings, **dic)
  File "/home/vitalite-dev/igas/snvphyl-galaxy-cli/bin/snvphyl.py", line 973, in main
    main_galaxy(url, key, snvphyl_version, workflow_id, fastq_dir, fastq_history_name, reference_file, run_name, relative_snv_abundance, min_coverage, min_mean_mapping,  File "/home/vitalite-dev/igas/snvphyl-galaxy-cli/bin/snvphyl.py", line 1051, in main_galaxy
    snvphyl_workflow=find_workflow_uuid(gi.workflows.get_workflows(), workflow_settings.attrib['uuid'])
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vitalite-dev/mambaforge/envs/igas/lib/python3.12/site-packages/bioblend/galaxy/workflows/__init__.py", line 63, in get_workflows
    workflows = self._get(params=params)
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vitalite-dev/mambaforge/envs/igas/lib/python3.12/site-packages/bioblend/galaxy/client.py", line 134, in _get
    raise ConnectionError(
bioblend.ConnectionError: GET: error 403: b'{"err_msg": "API authentication required for this request", "err_code": 403001}', 0 attempts left: {"err_msg": "API authentication required for this request", "err_code": 403001}

Is a Galaxy API Key/account needed to run the docker-deployed version of snyphyl (I am a bit unfamiliar with how Galaxy and Docker interact)?

Other stats: Running on Ubuntu 22.04 Docker version 24.0.6, build ed223bc Python 3.12.1

Thanks for any help with this, Pierre

apetkau commented 8 months ago

Hello @PierreLyons , you will likely have to install the exact version of bioblend found in the requirements.txt for this to work (https://github.com/phac-nml/snvphyl-galaxy-cli/blob/development/requirements.txt). Also, potentially you would have to downgrade Python.

This method of running SNVPhyl is out of date and no longer being supported. We have just (as of today) released a version of SNVPhyl within Nextflow, which you can find here: https://github.com/phac-nml/snvphylnfc

PierreLyons commented 8 months ago

Hi @apetkau. Thanks for the quick reply and for letting me know about the new NF version of this pipeline, I will go that route.

Note: I have tried with bioblend 0.7.0 as specified in the requirements.txt of the dev branch, but the same issue comes up. Either way, I'll be moving to the NF pipeline!

Thanks again for the help!

apetkau commented 8 months ago

You're welcome. I'm glad I could help 😄

hgibling commented 6 months ago

For anyone else running into the same issue, I was able to get it running by downgrading python to 3.11. Newer python versions don't work with bioblend 0.7.0.