remote-ftp icon indicating copy to clipboard operation
remote-ftp copied to clipboard

Uncaught TypeError: Cannot read property 'replace' of undefined

Open SofianeKnx opened this issue 9 years ago • 5 comments

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.2.1 System: Mac OS X 10.10.3 Thrown From: Remote-FTP package, v0.7.10

Stack Trace

Uncaught TypeError: Cannot read property 'replace' of undefined

At /Users/sofiane/.atom/packages/Remote-FTP/lib/client.js:82

TypeError: Cannot read property 'replace' of undefined
    at /Users/sofiane/.atom/packages/Remote-FTP/lib/client.js:82:44
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)

Commands

     -0:45.9.0 application:add-project-folder (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
     -0:32.9.0 remote-ftp:create-sftp-config (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
     -0:23.4.0 core:paste (atom-text-editor.editor.is-focused)
  2x -0:20.4.0 core:save (atom-text-editor.editor.is-focused)
     -0:00.7.0 remote-ftp:connect (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)

Config

{
  "core": {}
}

Installed Packages

# User
Remote-FTP, v0.7.10

# Dev
No dev packages

SofianeKnx avatar Nov 18 '15 09:11 SofianeKnx

You have to set the remote field (remote path on server, e.g. "/") in your .ftpconfig See the readme for the example config :)

jpxd avatar Nov 18 '15 09:11 jpxd

I'm getting the same issue, my remote field is set to:

"remote_path": "/",

pixelomo avatar Jan 27 '16 14:01 pixelomo

Atom: 1.23.1 x64 Electron: 1.6.15 OS: Mac OS X 10.13.2 Thrown From: remote-ftp package 2.1.1

Stack Trace

Uncaught TypeError: Cannot read property 'replace' of undefined

At /Users/icetee/DEV/_forks/remote-ftp/lib/helpers.js:18

TypeError: Cannot read property 'replace' of undefined
    at splitPaths (/Users/icetee/DEV/_forks/remote-ftp/lib/helpers.js:18:39)
    at /Users/icetee/DEV/_forks/remote-ftp/lib/connectors/ftp.js:266:22
    at Array.forEach (native)
    at /Users/icetee/DEV/_forks/remote-ftp/lib/connectors/ftp.js:260:12
    at tryApply (/Users/icetee/DEV/_forks/remote-ftp/lib/connectors/ftp.js:12:14)
    at error (/Users/icetee/DEV/_forks/remote-ftp/lib/connectors/ftp.js:116:29)
    at /Users/icetee/DEV/_forks/remote-ftp/lib/connectors/ftp.js:139:29
    at final (/Users/icetee/DEV/_forks/remote-ftp/node_modules/@icetee/ftp/lib/connection.js:507:11)
    at Object.cb (/Users/icetee/DEV/_forks/remote-ftp/node_modules/@icetee/ftp/lib/connection.js:544:11)
    at Parser.<anonymous> (/Users/icetee/DEV/_forks/remote-ftp/node_modules/@icetee/ftp/lib/connection.js:127:20)
    at emitTwo (events.js:111:20)
    at Parser.emit (events.js:191:7)
    at Parser._write (/Users/icetee/DEV/_forks/remote-ftp/node_modules/@icetee/ftp/lib/parser.js:61:10)
    at doWrite (_stream_writable.js:332:12)
    at writeOrBuffer (_stream_writable.js:318:5)
    at Parser.Writable.write (_stream_writable.js:245:11)
    at Socket.ondata (/Users/icetee/DEV/_forks/remote-ftp/node_modules/@icetee/ftp/lib/connection.js:298:20)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at TCP.onread (net.js:551:20)

Commands

     -5:12.2.0 remote-ftp:disconnect (ol.ftptree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
     -5:08.9.0 core:save (input.hidden-input)
     -2:58.2.0 datatip:toggle (input.hidden-input)
     -2:58.1.0 editor:toggle-line-comments (input.hidden-input)
     -2:57.9.0 datatip:toggle (input.hidden-input)
     -2:57.3.0 core:save (input.hidden-input)
  3x -1:32.7.0 core:backspace (input.hidden-input)
  2x -1:32 core:save (input.hidden-input)
     -1:25.7.0 core:move-down (input.hidden-input)
     -1:25.2.0 core:move-right (input.hidden-input)
     -1:24.4.0 core:move-left (input.hidden-input)
  3x -1:24 core:backspace (input.hidden-input)
     -1:22.9.0 core:save (input.hidden-input)
  3x -1:18.7.0 core:backspace (input.hidden-input)
  2x -1:18.1.0 core:save (input.hidden-input)
     -0:36.5.0 remote-ftp:download-selected (span.name.icon.icon-file-directory)

icetee avatar Dec 29 '17 13:12 icetee

Here seems to happen with corrupted files on server side.

I also noticed that no file is downloaded from folders with a space " " in its name.

Maybe should only detect them, avoid them and report it at the end of the download process.

davidtaubmann avatar Jun 08 '21 23:06 davidtaubmann

Happened to me today, Remote FTP can see 4 files within a folder (receipt.php, receipt2.php, undefined, undefined). The only actual file with the folder is receipt.php, I cannot understand where the others come from (they're not on the server, only Remote FTP sees them).

The error is triggered when I try to download these non-existent files

sitoexpress avatar Apr 22 '22 11:04 sitoexpress