mscdex / node-ftp

An FTP client module for node.js
MIT License
1.13k stars 243 forks source link

Error: You aren't logged in #270

Open phileastv opened 3 years ago

phileastv commented 3 years ago

Hello !

I'm trying to transfer a file to a FTP server. I double checked all my creditentials, but I keep getting this error Error: You aren't logged in. My server have a self-signed TLS certificate, but I correctly passed the parameter rejectUnauthorized: false in my secureOptions. I also tried to pass secure: true, false and mixed, but nothing changed. My FTP server is working as expected with other clients.

node:events:304
      throw er; // Unhandled 'error' event
      ^

Error: You aren't logged in
    at makeError (/usr/local/lib/node_modules/@nexrender/worker/node_modules/ftp/lib/connection.js:1067:13)
    at Parser.<anonymous> (/usr/local/lib/node_modules/@nexrender/worker/node_modules/ftp/lib/connection.js:113:25)
    at Parser.emit (node:events:327:20)
    at Parser._write (/usr/local/lib/node_modules/@nexrender/worker/node_modules/ftp/lib/parser.js:59:10)
    at writeOrBuffer (node:internal/streams/writable:382:12)
    at Parser.Writable.write (node:internal/streams/writable:333:10)
    at Socket.ondata (/usr/local/lib/node_modules/@nexrender/worker/node_modules/ftp/lib/connection.js:273:20)
    at Socket.emit (node:events:327:20)
    at addChunk (node:internal/streams/readable:304:12)
    at readableAddChunk (node:internal/streams/readable:279:9)
Emitted 'error' event on  instance at:
    at Object.reentry [as cb] (/usr/local/lib/node_modules/@nexrender/worker/node_modules/ftp/lib/connection.js:192:14)
    at Parser.<anonymous> (/usr/local/lib/node_modules/@nexrender/worker/node_modules/ftp/lib/connection.js:113:22)
    at Parser.emit (node:events:327:20)
    [... lines matching original stack trace ...]
    at readableAddChunk (node:internal/streams/readable:279:9) {
  code: 530
}

This error is not very clear for me, it seems like it is due to line 113, but I can't figure what it does.

Thanks a lot for your patience.

phileastv commented 3 years ago

I've tried with another FTP server and have a similar error message with the same error log : Error: Please login with USER and PASS.

Seems like it is a message from the FTP server itself, because the user and pass are not passed correctly.

I'm using node-ftp through another module so I will try to continue investigate that.

klonspace commented 3 years ago

I was having this error whilst using the module @phileastv was talking about, nexrender. It turns out the problem was that the implementation used in that module was not waiting for the on("ready") event to start doing operations on the server. I am planning on trying to add this to the nexrender implementation, in the mean time. As for OP, you can try making sure you are executing your code inside the .on("ready") callback function.

inlife commented 3 years ago

hey guys, can confirm the issue was on the nexrender side. I believe this thread can be safely closed. thanks, @klonspace for finding out the reason! 👍