genouest / biomaj-download

Download microservice for BioMAJ
GNU Affero General Public License v3.0
1 stars 7 forks source link

Add PWD answer code #42

Closed braffes closed 2 years ago

braffes commented 2 years ago

When trying to do directftp, we got the following error :

2022-07-05 15:40:02,575 ERROR [root][MainThread] Error while listing ftp://xxxxx:xxxxx@dbnsfp.softgenetics.com/ - 257
2022-07-05 15:40:02,575 ERROR [root][MainThread] Error while listing ftp://xxxxx:xxxxx@dbnsfp.softgenetics.com/ - Error while listing ftp://dbnsfp:xxxxx@dbnsfp.softgenetics.com/ - 257                                                                                                                                                          
2022-07-05 15:40:02,575 INFO  [root][MainThread] Workflow:DownloadService:CleanSession
2022-07-05 15:40:02,575 ERROR [root][MainThread] Workflow:wf_release:Exception:Error while listing ftp://xxxxx:xxxxx@dbnsfp.softgenetics.com/ - 257
Traceback (most recent call last):
  File "/opt/biomaj/lib/python3.8/site-packages/biomaj/workflow.py", line 742, in wf_release
    (file_list, dir_list) = release_downloader.list()
  File "/opt/biomaj/lib/python3.8/site-packages/biomaj_download/download/direct.py", line 126, in list
    raise e
  File "/opt/biomaj/lib/python3.8/site-packages/biomaj_download/download/direct.py", line 122, in list
    raise Exception(msg)
Exception: Error while listing ftp://xxxx:xxxxxx@dbnsfp.softgenetics.com/ - 257

We add 257 as a good return code to permit listing and download.

osallou commented 2 years ago

I dont understand

Code 257 is related to dir creation:

A 257 code is used as a successful response to the creation of a new directory from the MKD command or in response to a PWD command.

braffes commented 2 years ago

As we see on the following trace, there is a answer to a PWD command, I don't know why ...

220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 5 of 25 allowed.
220-Local time is now 12:15. Server port: 21.
220-This is a private system - No anonymous login
220 You will be disconnected after 15 minutes of inactivity.
USER dbnsfp
331 User dbnsfp OK. Password required
PASS xxxxx
230 OK. Current restricted directory is /
PWD
257 "/" is your current location
QUIT
221-Goodbye. You uploaded 0 and downloaded 0 kbytes.
221 Logout.

The database configuration if you want to try to reproduce :

remote.file.0.server=dbnsfp:xxxx@dbnsfp.softgenetics.com
remote.file.0.path=/dbNSFP%(remoterelease)s.zip
remote.file.0.name=dbNSFP%(remoterelease)s.zip
remote.file.0.protocol=directftp

In case I add 257 as OK return code :

220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 4 of 25 allowed.
220-Local time is now 12:29. Server port: 21.
220-This is a private system - No anonymous login
220 You will be disconnected after 15 minutes of inactivity.
USER dbnsfp
331 User dbnsfp OK. Password required
PASS dbnsfp
230 OK. Current restricted directory is /
PWD
257 "/" is your current location
EPSV
229 Extended Passive mode OK (|||30009|)
TYPE A
200 TYPE is now ASCII
LIST
150 Accepted data connection
226-Options: -l 
226 7 matches total
QUIT
221-Goodbye. You uploaded 0 and downloaded 0 kbytes.
221 Logout.
osallou commented 2 years ago

Ok, i am fine for merging this, but this is a weird return code....