elixir-cloud-aai / cwl-WES

Trigger CWL workflows via GA4GH WES and TES
Apache License 2.0
16 stars 18 forks source link

Setting username and password in the configuration URL does not work #246

Open lvarin opened 2 years ago

lvarin commented 2 years ago

Describe the bug

Funnel (https://ohsu-comp-bio.github.io/funnel/docs/storage/ftp/) requires (for the moment) to add the username and password to any FTP URL sent in a task. If you do so, cwl-WES fails as interprets the username and password as part of the host.

To Reproduce Steps to reproduce the behavior:

  1. Go to cwl-wes' configuration, and set a FTP with the username and password embedded
  2. Run any workflow
  3. Check the task log and discover an error: socket.gaierror: [Errno -2] Name or service not known

Expected behavior

It should not fail, no explosions

Screenshots

/usr/local/bin/cwl-tes 0.2.0 with cwltool 1.0.20181217162649
Resolved "/data/output/4KLTDG/workflow_files/cat-numbered.cwl" to "file:///data/output/4KLTDG/workflow_files/cat-numbered.cwl"
Unhandled error:
  [Errno -2] Name or service not known
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/cwltool/main.py", line 816, in main
    logger=_logger)
  File "/app/src/cwl-tes/cwl_tes/main.py", line 220, in tes_execute
    process, job_order, remote_storage_url, ftp_access)
  File "/app/src/cwl-tes/cwl_tes/main.py", line 392, in upload_job_order_ftp
    remote_storage_url, ftp_access)
  File "/app/src/cwl-tes/cwl_tes/main.py", line 323, in upload_dependencies_ftp
    ftp_upload, remote_storage_url, ftp_access))
  File "/usr/local/lib/python3.7/site-packages/cwltool/utils.py", line 214, in visit_class
    visit_class(rec[d], cls, op)
  File "/usr/local/lib/python3.7/site-packages/cwltool/utils.py", line 212, in visit_class
    op(rec)
  File "/app/src/cwl-tes/cwl_tes/main.py", line 77, in ftp_upload
    if not fs_access.isdir(base_url):
  File "/app/src/cwl-tes/cwl_tes/ftp.py", line 163, in isdir
    ftp = self._connect(fn)
  File "/app/src/cwl-tes/cwl_tes/ftp.py", line 78, in _connect
    ftp.connect(host)
  File "/usr/local/lib/python3.7/ftplib.py", line 154, in connect
    source_address=self.source_address)
  File "/usr/local/lib/python3.7/socket.py", line 707, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/usr/local/lib/python3.7/socket.py", line 752, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

Software

elixircloud/cwl-wes:20220825

Additional context Add any other context about the problem here.