@ERROR: chdir on Server 2003 using cwRsync 2.0.3

15 posts / 0 new
Last post
jbuccola
Offline
Last seen: 14 years 10 months ago
Joined: 01.05.2008 - 21:33
@ERROR: chdir on Server 2003 using cwRsync 2.0.3

I am at my wit's end. I have rsync going over SSH using cwRsync 2.0.3 and each time I run the batch file to pull the data down, I get the @ERROR: chdir failed error message. I have made sure that the nontsec variable is set in the Environment Variables under Advanced in the System control panel, have rebooted the service multiple times, ran the directory prep tool, and I'm using the Secure Channel Wrapper.

Server Config:

use chroot = false
strict modes = false
hosts allow = *
log file = rsyncd.log
pid file = rsyncd.pid

# Module definitions
# Remember cygwin naming conventions : c:\work becomes /cygwin/c/work
#

path = "/cygdrive/d/Some/Dir/"
read only = false
transfer logging = yes

path = "/cygdrive/c/Test/"
read only = false
transfer logging = yes

Client Script

SET SECHAW_IDENTITY="C:\server"
SET SECHAW_TYPE=ssh
SET SECHAW_LOCALPORT=9119
SET SECHAW_SERVER=server
SET SECHAW_SERVERPORT=873
SET SECHAW_USER=SvcwRsync
SET SECHAW_CMD="C:\Program Files\cwRsync\bin\rsync.exe" -avrn server.domain.com::Test "/cygdrive/d/Test/"
SET SECHAW_TUNNEL=ssh -i "C:\server" -L 9119:127.0.0.1:873 SvcwRsync@server -T -N
"C:\Program Files\cwRsync\bin\sechaw.exe" --verbose

Any ideas? Please forgive any brevity.

jbuccola
Offline
Last seen: 14 years 10 months ago
Joined: 01.05.2008 - 21:33
Re: @ERROR: chdir on Server 2003 using cwRsync 2.0.3

Thanks for the response. I tried your updated batch file and still a no-go with the same error. FYI- I used my original batch file with a different server and it worked perfectly. Is there something on the server I should focus on?
Jeff

itefix
Offline
Last seen: 4 hours 49 min ago
Joined: 01.05.2008 - 21:33
Re: @ERROR: chdir on Server 2003 using cwRsync 2.0.3

It seems that rsync command at your client side is not set up properly. Try batch file below:

@ECHO OFF
SET SECHAW_IDENTITY="C:\server"
SET SECHAW_TYPE=ssh
SET SECHAW_LOCALPORT=9119
SET SECHAW_SERVER=server.domain.com
SET SECHAW_SERVERPORT=873
SET SECHAW_USER=SvcwRsync
SET SECHAW_CMD="C:\Program Files\cwRsync\bin\rsync.exe" -avn rsync://SvcwRsync@localhost:9119/Test "/cygdrive/d/test/"
SET SECHAW_TUNNEL=ssh -i "C:\server" -L 9119:127.0.0.1:873
SvcwRsync@server.domain.com -T -N
"C:\Program Files\cwRsync\bin\sechaw.exe" --verbose

Batch file above is generated by Secure Channel Wizard with following parameters:

secure channel type - ssh, private key - c:\server, local port - 9119, cwrsyncserver name - server.domain.com, server port - 873, your rsync command - -avn server.domain.com::Test "/cygdrive/d/test/"

itefix
Offline
Last seen: 4 hours 49 min ago
Joined: 01.05.2008 - 21:33
Re: @ERROR: chdir on Server 2003 using cwRsync 2.0.3

Thanks for the response. I tried your updated batch file and still a no-go with the same error. FYI- I used my original batch file with a different server and it worked perfectly. Is there something on the server I should focus on?

Jeff

Can you give some information about your servers ? OS ? rsync version ? openssh version ?

itefix
Offline
Last seen: 4 hours 49 min ago
Joined: 01.05.2008 - 21:33
Re: @ERROR: chdir on Server 2003 using cwRsync 2.0.3

Can you give some information about your servers ? OS ? rsync version ? openssh version ?

Windows Server Standard 2003 with SP1. Using cwRsync 2.0.3 and the bundled OpenSSH that came with it.

jbuccola
Offline
Last seen: 14 years 10 months ago
Joined: 01.05.2008 - 21:33
Re: @ERROR: chdir on Server 2003 using cwRsync 2.0.3

Can you give some information about your servers ? OS ? rsync version ? openssh version ?

Sorry I posted the last without logging in. Yes, we're using Server Standard 2003 with SP1, cwRsync 2.0.3 and the bundled OpenSSH server that came with. We are enforcing IPSec rules, but even with it turned off it still does not work. McAfee VirusScan Enterprise 8 is running also.

itefix
Offline
Last seen: 4 hours 49 min ago
Joined: 01.05.2008 - 21:33
Re: @ERROR: chdir on Server 2003 using cwRsync 2.0.3

This problem is related to permissions. Does service account svcwRsync have read permissions on c:\test and underlying directories ?

jbuccola
Offline
Last seen: 14 years 10 months ago
Joined: 01.05.2008 - 21:33
Re: @ERROR: chdir on Server 2003 using cwRsync 2.0.3

This problem is related to permissions. Does service account svcwRsync have read permissions on c:\test and underlying directories ?

I just added that permission and still a no-go. I'm pondering here two possible reasons:

  1. Active Directory is not loaded on this server. The SvcwRsync user is loaded on the local user database in absence of AD. My hunch, however crazy it sounds, is that by some weird coinsidence the server is not allowing the service to interact with the directories because it is not in an AD infrastructure.
  2. Since this server is a dedicated hosted server, our hoster may be blocking some other ports on their firewall. They already blocked 25 without telling us, causing us to re-route our backup mail traffic on another port. Is the outbound traffic on Rsync going through a different port, much like FTP?

I digress... any other ideas?

Sincerely,
Hopeless in Los Angeles.

itefix
Offline
Last seen: 4 hours 49 min ago
Joined: 01.05.2008 - 21:33
Re: @ERROR: chdir on Server 2003 using cwRsync 2.0.3

Every implementation has its own limitations :-) You may get some more explanations if you increase output verbosity from rsync and drop -T -N from ssh:

 SET SECHAW_CMD="C:\Program Files\cwRsync\bin\rsync.exe" -an -vv rsync://SvcwRsync@localhost:9119/Test "/cygdrive/d/test/"
SET SECHAW_TUNNEL=ssh -i "C:\server" -L 9119:127.0.0.1:873 SvcwRsync@server.domain.com -T -N

jbuccola
Offline
Last seen: 14 years 10 months ago
Joined: 01.05.2008 - 21:33
Re: @ERROR: chdir on Server 2003 using cwRsync 2.0.3

Every implementation has its own limitations :-) You may get some more explanations if you increase output verbosity from rsync and drop -T -N from ssh:

 SET SECHAW_CMD="C:\Program Files\cwRsync\bin\rsync.exe" -an -vv rsync://SvcwRsync@localhost:9119/Test "/cygdrive/d/test/"
SET SECHAW_TUNNEL=ssh -i "C:\server" -L 9119:127.0.0.1:873 SvcwRsync@server.domain.com -T -N

I'll give it a shot and let you know.

jbuccola
Offline
Last seen: 14 years 10 months ago
Joined: 01.05.2008 - 21:33
Re: @ERROR: chdir on Server 2003 using cwRsync 2.0.3

Every implementation has its own limitations :-) You may get some more explanations if you increase output verbosity from rsync and drop -T -N from ssh:

 SET SECHAW_CMD="C:\Program Files\cwRsync\bin\rsync.exe" -an -vv rsync://SvcwRsync@localhost:9119/Test "/cygdrive/d/test/"
SET SECHAW_TUNNEL=ssh -i "C:\server" -L 9119:127.0.0.1:873 SvcwRsync@server.domain.com -T -N

I ran the batch as you said, and it didn't give anything more on the error itself. Rsync did provide me with some other cool info, but nothing on the error. Has anyone done Rsync on a non-AD server? I may just go ahead and load AD on it since it is only being used as a web server.

jbuccola
Offline
Last seen: 14 years 10 months ago
Joined: 01.05.2008 - 21:33
Re: @ERROR: chdir on Server 2003 using cwRsync 2.0.3

Every implementation has its own limitations :-) You may get some more explanations if you increase output verbosity from rsync and drop -T -N from ssh:

 SET SECHAW_CMD="C:\Program Files\cwRsync\bin\rsync.exe" -an -vv rsync://SvcwRsync@localhost:9119/Test "/cygdrive/d/test/"
SET SECHAW_TUNNEL=ssh -i "C:\server" -L 9119:127.0.0.1:873 SvcwRsync@server.domain.com -T -N

Tunnel: ssh
Command to run: "C:\Program Files\cwRsync\bin\rsync.exe" -avrnvv rsync://SvcwRsy
nc@localhost:9119/test "/cygdrive/d/test/"

Tunnel command: ssh -i "C:\claudius" -L 9119:127.0.0.1:873 SvcwRsync@server.domain.com

Establishing secure channel ...
opening tcp connection to localhost port 9119
Last login: Fri Sep  9 16:23:47 2005 from adsl-000-000-000-000.dsl.irvnca.pacbell
.net
opening connection using --server --sender -vvvnlogDtpr . test
@ERROR: chdir failed
rsync error: error starting client-server protocol (code 5) at main.c(1171)
_exit_cleanup(code=5, file=main.c, line=1171): about to call exit(5)
Terminating secure channel ...

Still nothing. I loaded AD on the box and reinstalled Rsync. I even made the owner of the folder SvcwRsync and each subcontainer.

Even more hopeless..

jbuccola
Offline
Last seen: 14 years 10 months ago
Joined: 01.05.2008 - 21:33
Re: @ERROR: chdir on Server 2003 using cwRsync 2.0.3

Tunnel: ssh
Command to run: "C:\Program Files\cwRsync\bin\rsync.exe" -avrnvv rsync://SvcwRsy
nc@localhost:9119/test "/cygdrive/d/test/"

Tunnel command: ssh -i "C:\claudius" -L 9119:127.0.0.1:873 SvcwRsync@server.domain.com

Establishing secure channel ...
opening tcp connection to localhost port 9119
Last login: Fri Sep  9 16:23:47 2005 from adsl-000-000-000-000.dsl.irvnca.pacbell
.net
opening connection using --server --sender -vvvnlogDtpr . test
@ERROR: chdir failed
rsync error: error starting client-server protocol (code 5) at main.c(1171)
_exit_cleanup(code=5, file=main.c, line=1171): about to call exit(5)
Terminating secure channel ...

Still nothing. I loaded AD on the box and reinstalled Rsync. I even made the owner of the folder SvcwRsync and each subcontainer.

Even more hopeless..

Okay. I tried reversing the situation by making the server the client, and the client as the server. We got the same error. Then I did something absolutely extraordinary and looked at the log for the first time.... the first place I should have looked.

2005/09/12 15:34:29 rsync: chdir "/cygdrive/C/Backed Up/Directory/" failed

: No such file or directory (2)

So I changed the location of the share in rsyncd.conf to just Directory to store it in the cwRsync folder in Program Files. Everything worked. Is there a DLL not being registered that's keeping the path "/cygdrive/c/Backed Up/Directory/" from registering?

itefix
Offline
Last seen: 4 hours 49 min ago
Joined: 01.05.2008 - 21:33
Re: @ERROR: chdir on Server 2003 using cwRsync 2.0.3

Tunnel: ssh
Command to run: "C:\Program Files\cwRsync\bin\rsync.exe" -avrnvv rsync://SvcwRsy
nc@localhost:9119/test "/cygdrive/d/test/"

Tunnel command: ssh -i "C:\claudius" -L 9119:127.0.0.1:873 SvcwRsync@server.domain.com

Establishing secure channel ...
opening tcp connection to localhost port 9119
Last login: Fri Sep 9 16:23:47 2005 from adsl-000-000-000-000.dsl.irvnca.pacbell
.net
opening connection using --server --sender -vvvnlogDtpr . test
@ERROR: chdir failed
rsync error: error starting client-server protocol (code 5) at main.c(1171)
_exit_cleanup(code=5, file=main.c, line=1171): about to call exit(5)
Terminating secure channel ...

Still nothing. I loaded AD on the box and reinstalled Rsync. I even made the owner of the folder SvcwRsync and each subcontainer.

Even more hopeless..

 

Okay. I tried reversing the situation by making the server the client, and the client as the server. We got the same error. Then I did something absolutely extraordinary and looked at the log for the first time.... the first place I should have looked.

2005/09/12 15:34:29 rsync: chdir "/cygdrive/C/Backed Up/Directory/" failed

: No such file or directory (2)

So I changed the location of the share in rsyncd.conf to just Directory to store it in the cwRsync folder in Program Files. Everything worked. Is there a DLL not being registered that's keeping the path "/cygdrive/c/Backed Up/Directory/" from registering?

After all this time, I figured it out. I was using quotes to define the directories of the share names in my rsyncd.conf. I knew it was something stupid I was doing because Rsync is a very solid, robust app. All is working beautifully. Thanks for your help, Tev.

Jeff Buccola

deltaend
Re: @ERROR: chdir on Server 2003 using cwRsync 2.0.3

Just to add this already wonderful thread, I had the dreaded chdir error as well.  I fixed it by changing the variable /cygwin to /cygdrive in the rsyncd.conf file on the server end.

Server: Microsoft Windows Server 2003

Client: Windows XP Professional SP2

Software: cwRsyncServer 2.0.10 with OpenSSL and cwRsync 2.0.10

Topic locked

Release news