lucasmotta / dploy

⛔️ currently unmaintained ⛔️
http://lucasmotta.github.io/dploy/
MIT License
990 stars 90 forks source link

Error when connecting to SFTP #113

Open mdelorimier opened 6 years ago

mdelorimier commented 6 years ago

Hello,

I am having an issue when trying to connect to a SFTP server. This might be linked to the server's fingerprint not beeing known (it is present in ~/.ssh/known_hosts).

Using the ssh2 package, I am able to connect and get folder listing using the same configuration.

Here is the configuration file :

stage:
    scheme: sftp
    host: "***.com"
    port: 22
    user: "***"
    pass: "***"
    check: true
    path:
        local: "dist/browser/"
        remote: "public_html/"

Here is the error :

TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.
    at Function.Buffer.from (buffer.js:161:9)
    at new Buffer (buffer.js:131:17)
    at onNEWKEYS (C:\Users\Mathieu de Lorimier\AppData\Roaming\npm\node_modules\dploy\node_modules\ssh2\lib\Connection.js:2282:29)
    at Parser.<anonymous> (C:\Users\Mathieu de Lorimier\AppData\Roaming\npm\node_modules\dploy\node_modules\ssh2\lib\Connection.js:123:5)
    at emitNone (events.js:105:13)
    at Parser.emit (events.js:207:7)
    at Parser.parsePacket (C:\Users\Mathieu de Lorimier\AppData\Roaming\npm\node_modules\dploy\node_modules\ssh2\lib\Parser.js:468:12)
    at Parser.execute (C:\Users\Mathieu de Lorimier\AppData\Roaming\npm\node_modules\dploy\node_modules\ssh2\lib\Parser.js:249:14)
    at Socket.<anonymous> (C:\Users\Mathieu de Lorimier\AppData\Roaming\npm\node_modules\dploy\node_modules\ssh2\lib\Connection.js:523:18)
    at emitOne (events.js:115:13)

Regards

daywalker2811 commented 6 years ago

Hi @mdelorimier

I'm not an expert in Yaml but I think you should remove the double quotes around values.

Kind regards

mdelorimier commented 6 years ago

@daywalker2811 I don't beleive that is the issue : https://stackoverflow.com/a/11301675/643039

I have semicolon in password so I need to escape it using quotes.

pegaltier commented 6 years ago

I also encounter problem using sftp

Error log:

[ + ] Fail uploading file site/README.md: { Error: No such file at SFTP._parse (C:\Users\pegal\AppData\Roaming\npm\node_modules\dploy\node_modules\ssh2\lib\SFTP\SFTPv3.js:986:23) at ChannelStream. (C:\Users\pegal\AppData\Roaming\npm\node_modules\dploy\node_modules\ssh2\lib\SFTP\SFTPv3.js:49:12) at emitOne (events.js:116:13) at ChannelStream.emit (events.js:211:7) at ChannelStream.emit (C:\Users\pegal\AppData\Roaming\npm\node_modules\dploy\node_modules\ssh2\lib\Channel.js:640:12) at Parser. (C:\Users\pegal\AppData\Roaming\npm\node_modules\dploy\node_modules\ssh2\lib\Channel.js:95:20) at emitOne (events.js:116:13) at Parser.emit (events.js:211:7) at Parser.parsePacket (C:\Users\pegal\AppData\Roaming\npm\node_modules\dploy\node_modules\ssh2\lib\Parser.js:607:12) at Parser.execute (C:\Users\pegal\AppData\Roaming\npm\node_modules\dploy\node_modules\ssh2\lib\Parser.js:249:14) type: 'NO_SUCH_FILE', lang: '' } [ + ] Fail uploading file site/README.md: { Error: No such file at SFTP._parse (C:\Users\pegal\AppData\Roaming\npm\node_modules\dploy\node_modules\ssh2\lib\SFTP\SFTPv3.js:986:23) at ChannelStream. (C:\Users\pegal\AppData\Roaming\npm\node_modules\dploy\node_modules\ssh2\lib\SFTP\SFTPv3.js:49:12) at emitOne (events.js:116:13) at ChannelStream.emit (events.js:211:7) at ChannelStream.emit (C:\Users\pegal\AppData\Roaming\npm\node_modules\dploy\node_modules\ssh2\lib\Channel.js:640:12) at Parser. (C:\Users\pegal\AppData\Roaming\npm\node_modules\dploy\node_modules\ssh2\lib\Channel.js:95:20) at emitOne (events.js:116:13) at Parser.emit (events.js:211:7) at Parser.parsePacket (C:\Users\pegal\AppData\Roaming\npm\node_modules\dploy\node_modules\ssh2\lib\Parser.js:607:12) at Parser.execute (C:\Users\pegal\AppData\Roaming\npm\node_modules\dploy\node_modules\ssh2\lib\Parser.js:249:14) type: 'NO_SUCH_FILE', lang: '' }

mararn1618 commented 3 years ago

Same problem here. SFTP doesn't work.

version

$ dploy --version
v1.2.0

config

prod:
    scheme: sftp
    port: 21098
    host: 198.54.***.***
    user: *****
    check: true
    include:
        "public/**/*.*": "/"
    path:
        local: public
        remote: /public_html/

error

– Are you sure you want to upload those files? (Y/n) readline.js:1086
            throw err;
            ^
TypeError: Cannot read property 'answer' of undefined
    at C:\Users\publi\AppData\Roaming\npm\node_modules\dploy\lib\deploy.js:578:20
    at C:\Users\publi\AppData\Roaming\npm\node_modules\dploy\node_modules\prompt\lib\prompt.js:316:20
    at C:\Users\publi\AppData\Roaming\npm\node_modules\dploy\node_modules\async\lib\async.js:136:21
    at assembler (C:\Users\publi\AppData\Roaming\npm\node_modules\dploy\node_modules\prompt\lib\prompt.js:282:18) 
    at C:\Users\publi\AppData\Roaming\npm\node_modules\dploy\node_modules\prompt\lib\prompt.js:322:20
    at C:\Users\publi\AppData\Roaming\npm\node_modules\dploy\node_modules\prompt\lib\prompt.js:510:14
    at onError (C:\Users\publi\AppData\Roaming\npm\node_modules\dploy\node_modules\read\lib\read.js:94:12)        
    at Interface.<anonymous> (C:\Users\publi\AppData\Roaming\npm\node_modules\dploy\node_modules\read\lib\read.js:66:5)
    at Interface.emit (events.js:198:13)
    at Interface._ttyWrite (readline.js:801:16)