Error in rsync protocol data stream (code 12) when synchronizing with gulp-rsync

Asked 2 years ago, Updated 2 years ago, 110 views

When I tried to synchronize files with gulp-rsync, I received the following error:

 gulp-rsync:rsync error: error in rsync protocol data stream (code12)

If it's a simple reason, such as an unstable Internet connection or an incorrect connection destination, I'll report my efforts as I didn't ask this question.
Also, the destination (VPS) is for practice, so the information such as the IP address is included as it is.

import Gulp from "gulp";
importGulpRSync from "gulp-rsync";

Gulp.task(
  "Deploy",
  ( ) : NodeJS.ReadWriteStream=>Gulp.src("03-ProductionBuild/BackEndEntryPoint.js").
      pipe(GulpRSync({
        root: "03-ProductionBuild/",
        hostname: "160.251.43.156",
        port: "22",
        username: "non_root_admin",
        destination: "/var/www/yamatodaiwa.com"
      }))
);

I was told that this could be the cause on the following page.

What do I do if I get errors in the backup log?|Buffalo

If asked for the password, try entering the correct password.

Enter a description of the image here

The above error occurs.

Message:
    Error: rsync expired with code 12
    at ChildProcess.<anonymous> (D:\IntelliJ IDEA\InHouseDevelopment\yamatodaiwa.com\node_modules\gulp-rsync\rsync.js:121:17)      
    at ChildProcess.emit (node:events:390:28)
    at ChildProcess.emit (node:domain:537:15)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit(node:internal/child_process:301:5)
    at Process.callbackTrampoline (node:internal/async_hooks:130:17)

This time, I will try to enter the wrong password on purpose.
A different error occurs.

non_root_admin @160.251.43.156's password: [18:36:47] gulp-rsync: Permission denied, please try again. 

Therefore, the backend side is working properly until authentication.Just in case, I will try connecting to a regular terminal.

Enter a description of the image here

It was a success.

rsync-v connected to Terminal VPS and excluded.

Enter a description of the image here

The BackEndEntryPoint.js file you are trying to synchronize with code is only 92.0 KB.VPS side disk usage information is as follows:

Enter a description of the image here

Add

We verified the health of the SSH connection prior to the experiment below.

>rsync-a"03-ProductionBuild/BackEndEntryPoint.js"[email protected]:/var/www/yamatodaiwa.com     
non_root_admin @160.251.43.156's password: 
rsync:connection unexpected closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code12) atio.c(235) [Receiver=3.1.3]
rsync:connection unexpected closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code12) atio.c(228) [sender=3.2.3]
PSD:\IntelliJ IDEA\InHouseDevelopment\yamatodaiwa.com> rsync-a"03-ProductionBuild/BackEndEntryPoint.js"[email protected]:/var/www/yamatodaiwa.com-vvvv
opening connection using: ssh-lnon_root_admin 160.251.43.156 rsync --server-vvvlogDtpre.iLsfxCIvu./var/www/yamatodaiwa.com (9args)
non_root_admin @160.251.43.156's password: 
rsync:connection unexpected closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code12) atio.c(235) [Receiver=3.1.3]
Receiver_exit_cleanup (code=12, file=io.c, line=235): about to call exit(12)
rsync:connection unexpected closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code12) atio.c(228) [sender=3.2.3]
[sender]_exit_cleanup(code=12, file=io.c, line=228)—about to call exit(12)

linux ubuntu gulp rsync

2022-09-30 19:48

1 Answers

You must also have the appropriate permissions to create files and folders for synchronization.

[email protected]:/var/www/yamatodaiwa.com that you have specified as your copy destination. In the first place, /var/www is generally not allowed to be written by anyone other than root.

example:

$ls-ld/var/wwww
drwxr-xr-x4 root root 4096 January 25 23:09 / var / www /

If the non_root_admin of the running user is a non-root user, one of the following actions may be taken:

  • Enable non_root_admin to /var/www
  • Pre-create /var/www/yamatodaiwa.com so you can write non_root_admin

Or, if the sudo command is allowed on non_root_admin, use the rsync command on the local side to
Using the --rsync-path option may be quick.

If the remote side has non-root permission on rsync, the owner information of the file will not be copied

#rsync--rsync-path="sudorsync"-auvz/path/to/SOURCE ec2-user@REMOTE:/path/to/TARGET


2022-09-30 19:48

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.