Errors when I rsync from a server to my local machine - rsync

I tried the following command to rsync from a server and got the following error message:
rsync -e ssh -avz name#home.com:/home/name/. .
receiving file list ... done
Desktop/Python_Nick/Python-2.4.1/
Desktop/Python_Nick/Python-2.4.1/Python/
Write failed: Broken pipe
rsync: writefd_unbuffered failed to write 4092 bytes [generator]: Broken pipe (32)
rsync error: unexplained error (code 255) at /SourceCache/rsync/rsync-42/rsync/io.c(1121) [generator=2.6.9]
rsync error: received SIGUSR1 (code 19) at /SourceCache/rsync/rsync-42/rsync/main.c(1197) [receiver=2.6.9]
Sometimes it gives the following error:
Read from socket failed: Operation timed out
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: unexplained error (code 255) at /SourceCache/rsync/rsync-42/rsync/io.c(452) [receiver=2.6.9]
Then sometimes the following error:
Write failed: Broken pipe
rsync: connection unexpectedly closed (314764 bytes received so far) [receiver]rsync: writefd_unbuffered failed to write 4092 bytes [generator]: Broken pipe (32)
rsync error: unexplained error (code 255) at /SourceCache/rsync/rsync-42/rsync/io.c(1121) [generator=2.6.9]
rsync error: error in rsync protocol data stream (code 12) at /SourceCache/rsync/rsync-42/rsync/io.c(452) [receiver=2.6.9]
I even tried using FETCH (The MAC application).
Any suggestions? The server is running LINUX and my local machine is a MAC

I had a similar problem, and my solution was to update rsync on my Mac.
As is clear from point 3 in the rsync "current issues and debugging" page, the "connection unexpectedly closed"
error tells you that the local rsync was trying to talk to the
remote rsync, but the connection to that rsync is now gone. The thing
you must figure out is why, and that can involve some investigative
work.
One of the first things suggested on this page is to update rsync. It turns out that Apple has not given us the latest rsync in their machines. Thus, I updated the rsync version on my Mac via Macports to 3.1.1. After that, I have had no problems syncing.
This is no general solution, of course, but then again there seem to be no general solution for this vague error message: if this had not worked, I had had to try and debug it. For details on how, see the above-mentioned rsync issues page.

Related

MPICH mpiexec (MPI) process terminating upon error, unable to debug in lldb

EDIT I had a typo in my command to launch lldb (see comment below) and I'm updating the post to get to a different larger issue
I'm trying to debug my MPI application in lldb and upon an error (e.g., segv or abort). Here's how I'm invoking my mpi run:
/usr/local/bin/mpiexec -np 3 -disable-auto-cleanup xterm -e "lldb -s lldb.commands -- app_binary <args> ; sleep 100
Immediately when I start running, I get this error trace. I think the most relevant line is PMI_Get_appnum returned -1
[cli_0]: write_line error; fd=8 buf=:cmd=init pmi_version=1 pmi_subversion=1
:
system msg for write_line failure : Bad file descriptor
[cli_0]: Unable to write to PMI_fd
[cli_0]: write_line error; fd=8 buf=:cmd=get_appnum
:
system msg for write_line failure : Bad file descriptor
Fatal error in MPI_Init_thread: Other MPI error, error stack:
MPIR_Init_thread(565):
MPID_Init(175).......: channel initialization failed
MPID_Init(463).......: PMI_Get_appnum returned -1
[cli_0]: write_line error; fd=8 buf=:cmd=abort exitcode=1094415
:
system msg for write_line failure : Bad file descriptor
Process 19063 exited with status = 15 (0x0000000f)
Unfortunately, some mailing lists show that this is a general bug with MPICH on OSX (see https://github.com/pmodels/mpich/issues/2063 -- currently still unresolved). Does anyone have a workaround?
Since you're using lldb and you're probably also using clang, you could use something called the address sanitizer to compile your code with runtime checks for memory errors.
Just add the following to your compile command: -g -fsanitize=address -fno-omit-frame-pointer -fsanitize-recover=address. It would look like
mpicc object.o -o exec -g -fsanitize=address -fno-omit-frame-pointer -fsanitize-recover=address
When using the address sanitizer your code will print a small stack trace to when you made a move to index out of bounds or address memory you don't own.
If you combine the address sanitizer with lldb then it should stop the execution at the line where a memory problem occurred. Although, I haven't had much success with running lldb and MPI at the same time. Either way the address sanitizer should help you.

502 Bad Gateway Nginx & Chef Server

I've upgraded my chef server. Then I ran chef-server-ctl reconfigure successfully.
However, when I ran chef-server-ctl test, I got error:
Encountered an error attempting to create client pedant_admin_client
Response Code was: 502
502 Bad Gateway
nginx/1.4.4
Can anyone help me?
tl;dr
sudo chef-server-ctl upgrade
WARNING: my org was preserved, but your results may vary
I ran into this too. I suspect an unexpected. "apt-get upgrade". For me all checks pass in status.
chef-server-ctl status
but this failed
sudo chef-server-ctl test
I ran this for more details (beware thousands of lines of output ;- )
sudo chef-server-ctl tail
and found this gem: (note the ".." in the path indicating a path misconfig)
2015-08-24_23:00 mkdir: cannot create directory '/opt/opscode/embedded/service/rabbitmq/sbin/../var': Permission denied
I then ran this and it worked
sudo chef-server-ctl upgrade
Ran into the same thing: Here is what I did to solve the problem.
Chef has logs but a lot of services. Check which one is failing
chef-server-ctl status will indicate what is down.
Go look at that log under
/var/log/chef-server/<problem-service>/current
My particular problem was
2014-09-27_17:33:32.41439 FATAL: could not create shared memory segment: Invalid argument
2014-09-27_17:33:32.41441 DETAIL: Failed system call was shmget(key=5432001, size=4050755584, 03600).
2014-09-27_17:33:32.41442 HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter. You can either reduce the request size or reconfigure the kernel with larger SHMMAX. To reduce the request size (currently 4050755584 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections.
Thus all I needed to do was chef-server-ctl reconfigure
problem solved

rsync faliure on iscsi disk

[root#localhost ~]# rsync -aHXA /mnt/capture-tmp/source/ /mnt/capture-tmp/dest
rsync: writefd_unbuffered failed to write 4092 bytes to socket [sender]: Broken pipe (32)
rsync: write failed on "/mnt/capture-tmp/dest/opt/StorageManager/jre/lib/i386/server/libjvm.so": Read-only file system (30)
rsync error: error in file IO (code 11) at receiver.c(302) [receiver=3.0.7]
rsync: connection unexpectedly closed (135188 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(601) [sender=3.0.7]
"dest" is iscsi disk.I am not able to reason out the cause for the faliure??
Thank you.
Seems obvious enough:
rsync: write failed on "[...snip...]/libjvm.so": Read-only file system (30)
^^^^^^^^^^^^^^^^^^^^^^^^^^
Remount it as read/write and try again.

cygwin rsync protocol error

I'm trying to rsync files between 64bit windows 7 and 64bit Linux. I have rsync 3.0.7 installed on both machine (cygwin version on windows).
This is the command I'm running on windows. I see it's establishing a connection to the remote machine but it just dies after authenticating and before transferring files. What could cause this problem?
rsync -vvvv localfile REMOTE-HOST:~/
FILE_STRUCT_LEN=16, EXTRA_LEN=4
cmd=<NULL> machine=REMOTE-HOST user=guest path=~/
cmd[0]=ssh cmd[1]=-l cmd[2]=guest cmd[3]=REMOTE-HOST cmd[4]=rsync cmd[5]=--server cmd[6]=-vvvvv.Lsf cmd[7]=. cmd[8]=~/
opening connection using: ssh -l guest REMOTE-HOST rsync --server -vvvve.Lsf. "~/"
note: iconv_open("UTF-8", "UTF-8") succeeded.
Password:
FILE_STRUCT_LEN=24, EXTRA_LEN=4
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
[Receiver] _exit_cleanup(code=12, file=io.c, line=601): entered
rsync error: error in rsync protocol data stream (code 12) at io.c(601) [Receive
r=3.0.7]
[Receiver] _exit_cleanup(code=12, file=io.c, line=601): about to call exit(12)
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
[sender] _exit_cleanup(code=12, file=/home/lapo/packaging/rsync-3.0.7-1/src/rsyn
c-3.0.7/io.c, line=601): entered
rsync error: error in rsync protocol data stream (code 12) at /home/lapo/packagi
ng/rsync-3.0.7-1/src/rsync-3.0.7/io.c(601) [sender=3.0.7]
[sender] _exit_cleanup(code=12, file=/home/lapo/packaging/rsync-3.0.7-1/src/rsyn
c-3.0.7/io.c, line=601): about to call exit(12)
The problem was a conflicting git installation. Git included it's own ssh and it's path was before cygwin path, so rsync was using git's ssh. The fix was to swap the order of git/cygwin bin path so rsync was using the right version of ssh.
I found a way around this error by adding the absolute path to ssh in my call:
rsync -avzphi --chmod=ugo=rwX --checksum --delete-after -e
"C:\cwRsync\ssh.exe -p 9999 -i c:\cwRsync\ssh\test_id_rsa"
"/cygdrive/c/repository/blah.com/"
test#xx.xx.xxx.xxx:/home/test/public_html

Unable to rsync between my server and my Mac

I have a server where I store data from Mac A and Mac B.
I use rsync to keep the files updated between my Macs.
I run the following code unsuccessfully
#!/bin/zsh
# to copy files from my server to my folder
rsync -Pav $Masi:~/private/ ~/Dropbox/Courses/math/
# to copy files from my folder to my server
rsync -Pav ~/Dropbox/Courses/math $Masi:~/private/
I get the following error message
ssh: connect to host port 22: Connection refused
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: unexplained error (code 255) at io.c(600) [receiver=3.0.5]
ssh: connect to host port 22: Connection refused
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(600) [sender=3.0.5]
I have ssh keys in place so the connection should work, since I can use scp without problems.
How can you use rsync between my server and one of my Macs?
I used to do a lot of this. Just ran a test, a few suggestions.
Spell out your entire user#host pattern
Run the ssh connection sans the rsync first, you may need to first approve your fingerprint
You do not seem to pass a flag to protect extended attributes, this can yield broken files on OS X. If you do not need resource forks, you are OK, but most of the time you do need them.
My test case:
$ rsync -Pav ~/Desktop/ me#remote.example.com:~/rsyc-test
In that case, all the files within ~/Desktop were copied to the remote host, in my home dir. Since the directory 'rsyc-test' did not exist, it was made for me. I had a .app on my Desktop, it made it over, surprisingly, it works. Even some .webloc files made it and appear to work, though I do not trust it.
I would strongly suggest adding in the -E flag
-E, --extended-attributes
Apple specific option to copy extended attributes, resource
forks, and ACLs. Requires at least Mac OS X 10.4 or suitably
patched rsync.
I ran a new test, moved a Interarchy bookmark to my desktop, I know for a fact these break if they are copied sans resource forks. Running without the -E versus with the -E, there is a difference of 152 bytes in xfered data. The first file on the remote machine did not work, the second transfered file did work.
I can not help but notice in your example one of your paths is ~/Dropbox so this may all not matter, since DropBox, the app, does not at all support resource forks currently, though I hear there are plans to in the future.
You also are not sending in the --delete flag, if your end goal is a mirror of your data, you are not getting that, if your end goal is backups that continually grows, keeping everything that was ever on the source, the lack of --delete is good.
Other notes:
You can exclude those silly .DS_Store files
--exclude '.DS_Store'
You can also set rsync up in a way to be a true mirror, so you would not need to run your other command, see the man page for details.
My final working command to shove the Desktop of my laptop to a remote machine:
$ rsync -PEav --delete --exclude '.DS_Store' ~/Desktop/ me#remote.example.com:~/rsycn-test
Check "$Masi". Is that the hostname you are trying to reach?
Try the following command to debug it:
rsync -e 'ssh -v' -Pav $Masi:~/private/ ~/Dropbox/Courses/math/
The Connection refused usually happens when there is a connection issue to the remote (e.g. firewall).
In your case the problem is that $Masi variable is empty. If it's not variable, use Masi.
As per this error:
ssh: connect to host port 22: Connection refused
Notice the double space above after the host word.
the connect to host message doesn't say to which host, so you're trying to connect to empty host. So it sound like a typo in the host name.

Resources