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

FTP Node: normalizeFtpItem: Cannot create property 'modifyTime' on string #11159

Open
tautv opened this issue Oct 8, 2024 · 4 comments
Open
Labels
in linear Issue or PR has been created in Linear for internal review

Comments

@tautv
Copy link

tautv commented Oct 8, 2024

Bug Description

When trying to LIST '/' of this one specific FTP, I get errors:

TypeError: Cannot create property 'modifyTime' on string '-rw-rw-rw- 1 generic 12663348 Oct 04 01:32 Complete Catalog 04.zip'
at normalizeFtpItem (/Users/tautv/.npm/_npx/a8a7eec953f1f314/node_modules/n8n-nodes-base/nodes/Ftp/Ftp.node.ts:105:17)
at /Users/tautv/.npm/_npx/a8a7eec953f1f314/node_modules/n8n-nodes-base/nodes/Ftp/Ftp.node.ts:700:10
at Array.forEach ()
at Object.execute (/Users/tautv/.npm/_npx/a8a7eec953f1f314/node_modules/n8n-nodes-base/nodes/Ftp/Ftp.node.ts:699:22)
at Workflow.runNode (/Users/tautv/.npm/_npx/a8a7eec953f1f314/node_modules/n8n-workflow/src/Workflow.ts:1382:8)
at /Users/tautv/.npm/_npx/a8a7eec953f1f314/node_modules/n8n-core/src/WorkflowExecute.ts:1168:27
at /Users/tautv/.npm/_npx/a8a7eec953f1f314/node_modules/n8n-core/src/WorkflowExecute.ts:1888:11

Looks like this specific FTP is returning a string instead of an object?
Screenshot 2024-10-08 at 12 28 01

Everything works fine if I try to directly download this file.
Screenshot 2024-10-08 at 12 28 50

If I list insides of a sub-folder there - everything works fine.
Screenshot 2024-10-08 at 12 29 37

To Reproduce

Unfortunatelly can't give access to this. It's an FTP form a client in production. I have no contact with them either.

Expected behavior

All other FTP servers I tried work flawlessly:
Screenshot 2024-10-08 at 12 31 20

Operating System

MacOS 14.6.1

n8n Version

1.61.0

Node.js Version

20.18.0

Database

SQLite (default)

Execution mode

main (default)

@Joffcom
Copy link
Member

Joffcom commented Oct 8, 2024

Hey @tautv,

We have created an internal ticket to look into this which we will be tracking as "GHC-295"

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label Oct 8, 2024
@Joffcom
Copy link
Member

Joffcom commented Oct 8, 2024

Hey @tautv,

Do you know what FTP server and version they are using? This is something that an FTP client like Filezilla may show when you connect in the log.

@tautv
Copy link
Author

tautv commented Oct 8, 2024

Hey @Joffcom
Don't currently have FileZilla installed - would need to ask sys admin.
I'm mostly using Python/Finder to connect to the FTP servers.

All the info I was able to get from the connection:

'211-Extensions supported:
CLNT
AUTH TLS
PBSZ
PROT
MDTM
MFMT
MLST type*;size*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;perm*;
PASV
REST STREAM
STOU
SIZE
EPRT
EPSV
UTF8
XCRC "Filename" SP EP
XMD5 "Filename" SP EP
XSH1 "Filename" SP EP
211 End.'

'215 UNIX Type: L8'

'230 User ****** logged in.'

Curl:

% curl -v ftp://******:************@**.***.***.***
*   Trying **.***.***.***:21...
* Connected to **.***.***.*** (**.***.***.***) port 21
< 220 FTP server ready.
> USER ******
< 331 Password required for ****** (****************).
> PASS **********
< 230 User ****** logged in.
> PWD
< 257 "/" is current directory.
* Entry path is '/'
* Request has same path as previous transfer
> EPSV
* Connect data stream passively
* ftp_perform ends with SECONDARY: 0
< 229 Entering Extended Passive Mode (|||50131|)
* Connecting to **.***.***.*** (**.***.***.***) port 50131
*   Trying **.***.***.***:50131...
* Connected 2nd connection to **.***.***.*** port 50131
> TYPE A
< 200 Type set to A.
> LIST
< 150 ASCII data connection for / (**.***.***.***,50131).
* Maxdownload = -1
-rw-rw-rw-  1              generic      12663348 Oct 04 01:32 Complete Catalog 04.zip
drw-rw-rw-  3              generic             0 Sep 13 16:29 Feed
drw-rw-rw-  3              generic             0 Nov 30  2022 In
drw-rw-rw-  3              generic             0 Nov 30  2022 Out
-rw-rw-rw-  1              generic        780798 Oct 08 13:19 stock data_241008.txt
* Remembering we are in dir ""
< 226 ASCII transfer complete.
* Connection #0 to host **.***.***.*** left intact

If this is of any help?

@tautv
Copy link
Author

tautv commented Oct 17, 2024

Hey @Joffcom,

A little update - tried with FileZilla, but there seems to be an issue there too.
Can't connect to it:

Status:      	Connecting to **.***.***.***:21...
Status:      	Connection established, waiting for welcome message...
Status:      	Initializing TLS...
Status:      	TLS connection established.
Command: 	USER ******
Response: 	534 Policy Requires SSL
Error:         	Could not connect to server
Status:      	Waiting to retry...
Status:      	Connecting to **.***.***.***:21...
Status:      	Connection established, waiting for welcome message...
Response: 	220 FTP server ready.
Command: 	AUTH TLS
Response: 	234 Switch over to TLS-based communication.
Status:      	Initializing TLS...
Status:      	TLS connection established.
Command: 	USER ******
Response: 	534 Policy Requires SSL
Error:         	Could not connect to server

The FTP owner hasn't responded to any queries as of yet.

Everything seems to work ok with Python's standard 'ftplib', with few std output adjustments, I managed to incorporate this back into a workflow:
Screenshot 2024-10-17 at 11 51 32

I'll try to get more answers from FTP owner, but wouldn't hold my breath on it.

P.S. n8n FTP node for 'DOWNLOAD' works perfectly fine, it's just the 'LIST' that fails, and only for the root '/' dir of the ftp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review
Projects
None yet
Development

No branches or pull requests

2 participants