Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gbrn opened this issue Apr 24, 2024 · 5 comments
Labels

Comments

@gbrn
Copy link
Contributor

gbrn commented Apr 24, 2024

@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 gbrn added the bug label Apr 24, 2024
@DanielnetoDotCom
Copy link
Member

  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'

@gbrn
Copy link
Contributor Author

gbrn commented Apr 26, 2024

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
Copy link
Contributor Author

gbrn commented Apr 26, 2024

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]

@DanielnetoDotCom
Copy link
Member

this plugin is designed to work with user and password

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

@gbrn
Copy link
Contributor Author

gbrn commented Apr 30, 2024

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants