AVideo icon indicating copy to clipboard operation
AVideo copied to clipboard

Plugin Clone Error - Connection unexpectedly closed / unexplained error (code 255)

Open gbrn opened this issue 10 months ago • 5 comments

@DanielnetoDotCom Danny, I created a new installation of AVIDEO to run tests and isolate problems. I'm trying to clone but it's showing the following error:

Clone: Clone Start
Clone (1 of 7): Asking the Server the database and the files
Clone: Good start! the server has answered
Clone (2 of 7): Geting MySQL Dump file [wget -O /var/www/html/AVideo/videos/clones/Clone_mysqlDump_***************.sql https://**********************/Clone_mysqlDump_**************.sql]
Clone: Nice! we got the MySQL Dump file [https://**************/videos/clones/Clone_mysqlDump_****************.sql] 206.52MB
Clone (3 of 7): Overwriting our database with the server database /var/www/html/AVideo/videos/clones/Clone_mysqlDump_*****************.sql
Clone: Great! we overwrite it with success.
Clone (4 of 7): execute rsync (sshpass -p '{password}' rsync -av -e 'ssh  -p 22 -o StrictHostKeyChecking=no' --exclude '*.php' --exclude 'cache' --exclude '*.sql' --exclude '*.log' @:/var/www/html/AVideo/videos/ /var/www/html/AVideo/videos/ --log-file='/var/www/html/AVideo/videos/cache/clones/client.log' )
2024/04/24 14:30:33 [27769] rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
2024/04/24 14:30:33 [27769] rsync error: unexplained error (code 255) at io.c(231) [Receiver=3.2.7]
Clone (5 of 7): rsync finished
Clone (6 of 7): Notify Server to Delete Dump
Clone: Dump DELETED
Clone (7 of 7): Resotre the Clone Configuration
Clone: Complete, Database, 0 Videos and 0 Photos
Total Execution Time: 2.2567868153254 Minutes

I saw this same issue in #3030, but I couldn't understand the solution.

gbrn avatar Apr 24 '24 17:04 gbrn

  1. based on your command you are missing the cloneSiteSSHUser and cloneSiteSSHIP
  2. check /var/www/html/AVideo/videos/cache/clones/client.log
  3. Execute the code below manually, make sure you replace {cloneSiteSSHUser} and {cloneSiteSSHIP}

sshpass -p '{password}' rsync -av -e 'ssh -p 22 -o StrictHostKeyChecking=no' --exclude '*.php' --exclude 'cache' --exclude '*.sql' --exclude '*.log' {cloneSiteSSHUser}@{cloneSiteSSHIP}:/var/www/html/AVideo/videos/ /var/www/html/AVideo/videos/ --log-file='/var/www/html/AVideo/videos/cache/clones/client.log'

DanielnetoDotCom avatar Apr 24 '24 18:04 DanielnetoDotCom

check /var/www/html/AVideo/videos/cache/clones/client.log

There is no CLONES directory within the CACHE directory and the LOG client was not generated. When is this directory created? I have to create?

image

In the directory /var/www/html/AVideo/videos/clones there are several MYSQL Dumps that have not been deleted. But it doesn't have any LOG file. image

gbrn avatar Apr 26 '24 20:04 gbrn

My server is only accessed using the public key via SSH. Does this command accept this?

I also verify that the aforementioned client.log file is not present on any of the servers.

rsync: [client] failed to open log-file /var/www/html/AVideo/videos/cache/clones/client.log: No such file or directory (2)
Ignoring "log file" setting.
Warning: Permanently added '168.138.238.116' (ED25519) to the list of known hosts.
[email protected]: Permission denied (publickey).
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: unexplained error (code 255) at io.c(231) [Receiver=3.2.7]

gbrn avatar Apr 26 '24 20:04 gbrn

this plugin is designed to work with user and password

maybe there is another way to do it. but I am not sure

DanielnetoDotCom avatar Apr 26 '24 21:04 DanielnetoDotCom

@DanielnetoDotCom There is a safer way to connect with rsync. I read in several places that connecting via publickey is the best and safest practice for connecting between servers. I think it's important to evolve this Plugin Clone tool.

This link has some instructions on this connection: https://gist.github.com/jyap808/8700714

gbrn avatar Apr 30 '24 01:04 gbrn