SOLVED rsync SSH - Remote Path Error Message

Status
Not open for further replies.

mountbatt

Cadet
Joined
Jul 16, 2014
Messages
5
Since 9.3 Beta my rsync jobs tasks me an error message when i try to save them:

  • The Remote Path you specified does not exist or is not a directory.
    Either create one yourself on the remote machine or check the
    'rsync_create' field.
    **Note**: This could also happen if the remote path entered
    exceeded 255 characters and was truncated, please restrict it to
    255. Or it could also be that your SSH credentials (remote host,etc) are wrong.

Screenshot 2014-11-20 13.33.25.png

My credentials are all ok (didnt changed) and the path is correct.

If i check the "Rsync Create:" Checkbox i can save the task.

Seems to be a bug while it checks path or the connection during save process.
 
S

Suraj Ravichandran

Guest
Can you ssh from your freenas box to the remote machine (just via the shell)?

When you ssh into the remote machine does it ask you for your password or verification to add said host to know_hosts?
 

mountbatt

Cadet
Joined
Jul 16, 2014
Messages
5
yes, as i said: i can rsync successfully when i checked the checkbox "rsync create" - i have to check it every time again when i edit the task otherwise i can't save.
so this is more a hint for other people – maybe somebody can file a bug report.
 
S

Suraj Ravichandran

Guest
I have verified that if the check fails and you save the task it still would not run.

I know this may sound repetitive, but when you say "rsync ran successfully" did the task get saved successfully or did rsync actually run and you found your files in the remote machine.

if you want to do a quick and dirty test, try thr run now button and see if you get your files on the remote machine and/or if you have any syslog rsync related errors.
 

mountbatt

Cadet
Joined
Jul 16, 2014
Messages
5
The "Run now" Button says that it works but then in the console it logs
rsync: TERM: Undefined variable.
My backups work - files get synced after the message appeared.

So this is a small workaround: always check the checkbox "rsync Create" before saving the task.
 
S

Suraj Ravichandran

Guest
I do not quite agree with : """ always check the checkbox "rsync Create" before saving the task. """

Having said that, I am glad that it works for you, but baffled by how the check can fail when rsyncing over ssh succeeds. To give you a peek under the hood, this is what not ticking the "rsync create " checkbox (which is where your issues exists) does:
Code:
def check_rpath_exists(self):
    """A function to check if the rsync_remotepath,
        exists or not. Returns TRUE rpath is a directory
        and exists, else FALSE"""
        
    ruser = self.cleaned_data.get("rsync_user").encode('utf8')
    rhost = str(self.cleaned_data.get("rsync_remotehost"))
    rport = str(self.cleaned_data.get("rsync_remoteport"))
    rpath = self.cleaned_data.get("rsync_remotepath").encode('utf8')
    proc = subprocess.Popen(
                    """su -m %s -c "ssh -p %s -o 'BatchMode yes' -o 'ConnectTimeout=5' %s@%s test -d %s" """
                    % (ruser,rport,ruser,rhost,rpath), shell=True)
    proc.wait()
    return proc.returncode == 0


Specifically, it executes the following (using the credentials of the rsync user account you specified)
Code:
ssh -o 'BatchMode yes' -o 'ConnectTimeout=5' rsynusername@remotehostname test -d remotepath


which is the equivalent of running the following on your remote machine directly,
Code:
test -d path


which basically tries to check if the path specified is a directory or not.

I added this in the code so that, if users specified a path greater than 255 characters in length then the form auto-truncates that and as a result of which your task would get saved BUT NOT EXECUTE.

If my above explanation provided some insight and you can now share more then it would facilitate as feedback for me to figure out what is the root cause here.

Thank you for bringing this to light.
 
S

Suraj Ravichandran

Guest
Its fixed in the beta update (please give it a try)
 
Status
Not open for further replies.
Top