Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The read operation timed out #75

Closed
mthang opened this issue Nov 7, 2022 · 13 comments
Closed

The read operation timed out #75

mthang opened this issue Nov 7, 2022 · 13 comments

Comments

@mthang
Copy link

mthang commented Nov 7, 2022

Hi there,
I am unable get this the following command to run on my ubuntu VM. The tool was installed using the pip command (pip install ena-upload-cli). My ubuntu VM already has the ftp port 21 open by default. Any thoughts?

ena-upload-cli --action add --center 'BioCommons Australia' --study ENA_template_studies.tsv --sample ENA_template_samples.tsv --experiment ENA_template_experiments.tsv --run ENA_template_runs.tsv --data *gz -d --secret .secret.yml
Check if all required columns are present in the study table.
Check if all required columns are present in the sample table.
Check if all required columns are present in the experiment table.
Check if all required columns are present in the run table.
No valid checksums found, generate now... done.

Connecting to ftp.webin2.ebi.ac.uk....
uploading /home/ubuntu/ena/ENA_TEST1.R1.fastq.gz
ERROR: The read operation timed out
ERROR: If your connection times out at this stage, it propably is because of a firewall that is in place. FTP is used in passive mode and connection will be opened to one of the ports: 40000 and 50000.

Traceback (most recent call last):
File "/home/ubuntu/.local/bin/ena-upload-cli", line 11, in
load_entry_point('ena-upload-cli==0.6.1', 'console_scripts', 'ena-upload-cli')()
File "/home/ubuntu/.local/lib/python3.8/site-packages/ena_upload/ena_upload.py", line 925, in main
submit_data(file_paths, password, webin_id)
File "/home/ubuntu/.local/lib/python3.8/site-packages/ena_upload/ena_upload.py", line 424, in submit_data
print(ftps.storbinary(f'STOR {filename}', open(path, 'rb')))
File "/usr/lib/python3.8/ftplib.py", line 504, in storbinary
conn.unwrap()
File "/usr/lib/python3.8/ssl.py", line 1285, in unwrap
s = self._sslobj.shutdown()
socket.timeout: The read operation timed out

Many thanks,

@bedroesb
Copy link
Collaborator

bedroesb commented Nov 7, 2022

hello @mthang,
Are you connected to a personal network? Because your institute might block ports between 40000 and 50000. Important is that this is a range and they all need to be open. Other option is that there are problems the side of ENA (happened to me in the past)., and retrying after a day or 2 most of the times helps.

@mthang
Copy link
Author

mthang commented Nov 8, 2022

hello @bedroesb
Thank you for your quick response! I worked with our IT specialist to test your tool without opening up the port suggested from the error message. The quick hack was to comment out some of the line under "submit_data" seciton in the ena_upload.py script (see below) and it works . We simply used ftplib.FTP instead of your MyFTP_TLS class.

    #ftps = MyFTP_TLS(timeout=10)
    ftps = ftplib.FTP(ftp_host)
    #ftps.context.set_ciphers('HIGH:!DH:!aNULL')
    #ftps.connect(ftp_host, port=21)
    #ftps.auth()
    ftps.login(webin_id, password)
    #ftps.prot_p()

My impression of using the FTP_TLS is to create a secure connection instead of using the regular FTP connection. My question is Does the ENA portal requires secure connection for connecting the ENA submission portal?

Best,
M

@bedroesb
Copy link
Collaborator

bedroesb commented Nov 8, 2022

@mthang this is indeed for the FTPs connection. 1 year back ENA announced this:

As part of our continuous efforts to improve ENA we are changing the security settings of the http://ftp.dcc-private.ebi.ac.uk/ file download service.
Please note that all users of http://ftp.dcc-private.ebi.ac.uk/ will be affected and should take action to continue using the service uninterrupted.

FTP protocol replaced by FTPS

But from my understanding the old one still works, but it is not secure.

@bedroesb
Copy link
Collaborator

bedroesb commented Nov 8, 2022

This is another ftp server, but I know they recommend using FTPs also for the other one

@mthang
Copy link
Author

mthang commented Nov 14, 2022

Thank you for your feedback ! I think I did come across with the ENA's announcement about upgrading the FTP connection to secure connection. That makes so much sense for them to implement the secure connection. I have not followed up with the latest development of the implementation of the secure FTP connection. I thought they had already finished the implementation. However, it does not seem like they have done it.

We are trying to do upload instead of the download of data from ENA via Galaxy and thought the failed submission job was due to our infrastructure settings. Then, we went ahead and looked at the ena_upload.py code. We have noticed that submitting the data to ENA worked after replacing the FTP_TLS (aka the MyFTP class ) with the insecure FTP. Therefore, I wonder if you would add a few lines in your code to allow ena_upload.py using FTP when FTP_TLS does not work for the current ENA submission portal setting?

Best
M

@bedroesb
Copy link
Collaborator

Hello, I understand your question (are you using the Galaxy wrapper for the tool too than?). I would be interested in trying out FTP as fallback if I know they will keep supporting it.

@mthang
Copy link
Author

mthang commented Nov 17, 2022

hi @bedroesb
Yes. We have installed this tool on the Galaxy Australia and would like to have it available for the researchers in Australia. I would assume that the ENA portal had updated the server using the secure FTP connection. However, the operation time out error from the ena-upload-cli has led me to test the insecure FTP connection and it just worked. BTW, ena-upload-cli tool and the wrapper are great and useful for the data submission via Galaxy. I guess it is also great to have the FTP as the second option if the FTP_LTS option does not work.

Thanks,
M

@bedroesb
Copy link
Collaborator

@mthang I contacted ENA, and they are not planning to take the normal FTP submission way down anytime soon. I will look into adding a parameter or using this as a fallback!

@mthang
Copy link
Author

mthang commented Jan 25, 2023

@bedroesb
Thank you for the update! I am looking forward to the fallback and will install the tool on our Galaxy instance when it is ready

@mthang
Copy link
Author

mthang commented Sep 6, 2023

@bedroesb
I revisited this tool again. Without making any changes of the python script mentioned above, I tested it with the ufw enabled (firewall setting) and it seems to work. Do you know what's your ufw status when testing this tool at your end?

@bedroesb
Copy link
Collaborator

bedroesb commented Sep 7, 2023

@mthang it is great to hear you managed to make a successful submission without making changes to the script. With me ufw is disabled when I test the script. I am afraid that this feature ended up on my low priority list. I am wondering if there is still interest in this? Sorry for the radio silence.

@bedroesb
Copy link
Collaborator

bedroesb commented Sep 7, 2023

These days I putted some time in making spreadsheet templates for the tool that keep themselves updated: https://github.com/ELIXIR-Belgium/ENA-metadata-templates with GitHub Actions

@bedroesb
Copy link
Collaborator

After an internal discussion again, we decided to not support the less secure ftp submission route, since the ports that need to be open are clearly stated in the error code and on the website of ENA.

My apologies if this decision, we can revisit if more people are being limited by this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants