teambition / gulp-ssh

SSH and SFTP tasks for gulp
184 stars 38 forks source link

Error : copy files ! #51

Open bian17888 opened 8 years ago

bian17888 commented 8 years ago

when I copied the files to remote server , I received the error messages ....

how can I solve this problem~ thx

===== gulp code ===== gulp.task('deploy:copy', ['deploy:clean'], function () { return gulp .src([conf.paths.dist + '/**']) .pipe(gulpSSH.dest('/dist'));

===== error info ===== [17:43:31] Error in plugin 'gulp-ssh' Message: Failure Details: code: 4 lang:

zensh commented 8 years ago

应该是这里错了 gulpSSH.dest('/dist'), 你没有该根目录的权限 /dist

ta3pks commented 8 years ago

i have this same error seems plugin isn't working

ta3pks commented 8 years ago
gulp.task("sendFile",["build"], _ => {
    return gulp.src("../stats_x86_64")
        .pipe(ssh.dest("/home/nikos/"));
})
gulp.task("deploy", ["sendFile"], _ => {
    return ssh.exec(["chmod a+x /home/nikos/stats_x86*","exit"]).pipe(gulp.dest("logs"))
})

here is my code

zensh commented 8 years ago

gulp.src("../stats_x86_64/**/*")

ta3pks commented 8 years ago

@zensh stats_x86_64 is an executable not a folder

zensh commented 8 years ago

@NikosEfthias You should remove _ from => function

ta3pks commented 8 years ago

it tells function will not have any parameters in es6 syntax what it has to do with ssh ?

goldenratio commented 8 years ago

I get the same error too

[14:50:36] 'deploy' errored after 4.35 s
[14:50:36] Error in plugin 'gulp-ssh'
Message:
    Failure
Details:
    code: 4
    lang:

My code,

gulp.task("deploy", function() {
    if(webDeployConfig.enabled)
    {
        var gulpSSH = new GulpSSH({
            ignoreErrors: true,
            sshConfig: {
                host: webDeployConfig.webserver,
                port: webDeployConfig.port,
                username: webDeployConfig.username,
                password: webDeployConfig.password
            }
        });

        return gulp.src(['target/**/*.*', '!target/**/*.ts', '!target/**/*.map'])
            .pipe(gulpSSH.dest(webDeployConfig.uploadDirectoryPath));
    }
    else
    {
        console.log("deploy is disabled!");
    }
});
goldenratio commented 8 years ago
events.js:141
      throw er; // Unhandled 'error' event
      ^
 Error: Failure
    at SFTPStream._transform (F:\gulp-ssh\node_modules\ssh2\node_modules\ssh2-streams\lib\sftp.js:384:27)
    at SFTPStream.Transform._read (_stream_transform.js:167:10)
    at SFTPStream._read (F:\node_modules\gulp-ssh\node_modules\ssh2\node_modules\ssh2-streams\lib\sftp.js:170:15)
    at SFTPStream.Transform._write (_stream_transform.js:155:12)
    at doWrite (_stream_writable.js:300:12)
    at writeOrBuffer (_stream_writable.js:286:5)
    at SFTPStream.Writable.write (_stream_writable.js:214:11)
    at Channel.ondata (_stream_readable.js:542:20)
    at emitOne (events.js:77:13)
    at Channel.emit (events.js:169:7)
ta3pks commented 8 years ago

@goldenratio theres no support for this plugin i guess i just used rsync with child_process.exec in my gulpfile if you are on a mac or linux machine you can also do the same thing i am not sure about mac but on linux rsync comes pre-installed

goldenratio commented 8 years ago

It seems the issue happens if I upload over 100 files or so.

ta3pks commented 8 years ago

@goldenratio i tried to upload just a single binary about 30 mbytes

goldenratio commented 8 years ago

could be related to this, https://github.com/mscdex/ssh2-streams/issues/32 @zensh has to update plugin's dependencies

zensh commented 8 years ago

@goldenratio ssh2 should update it's dependencies~ https://github.com/mscdex/ssh2/blob/master/package.json#L8

goldenratio commented 8 years ago

@zensh created issue ticket https://github.com/mscdex/ssh2/issues/448

goldenratio commented 8 years ago

@zensh https://github.com/mscdex/ssh2-streams/issues/41#issuecomment-231402000

marco-koenen commented 3 years ago

Are there any updates regarding this? Seems like it's still not working with a large number of files.

WhereJuly commented 3 years ago

Are there any updates regarding this? Seems like it's still not working with a large number of files.

Same issue here. Any solutions or workarounds anyone?

WhereJuly commented 3 years ago

I had to keep using gulp-ssh as the most effective solution for my deploy as I would not like to switch from Windows to linux or to pollute my machine with WSL for just one project, neither could I use the normal CI/CD instruments (e.g. Github Actions) due to the project in part comprises a heavy legacy codebase not suited for deploying from SVN.

So I had to find a workaround. That took some fresh thinking.

Here is it all from my Gulp deploy task:

Hope that helps someone.