vahidhedayati / RemoteSSH

Grails RemoteSSH Plugin based on Ganymed SSH-2 library, provides ssh utilities to a grails application
http://grails.org/plugin/remote-ssh
Apache License 2.0
4 stars 5 forks source link

SSH_FX_NO_SUCH_FILE #7

Open higi opened 5 years ago

higi commented 5 years ago

hello upgrade from version 0.7 to latest i am getting:

after scpget i am getting: (path is same as version 0.7 and its working)

(ch.ethz.ssh2.SFTPException: No such file (SSH_FX_NO_SUCH_FILE: A reference was made to a file which does not exist.))

i am trying to test this encoding issue https://github.com/vahidhedayati/RemoteSSH/issues/6

vahidhedayati commented 5 years ago

Hi Higi,

I can't see any issues, there wasn't much details given as to which version of the file of RemoteSCPGet i.e. ssh.RemoteSCPGet Java version vs grails.plugin.remotessh.RemoteSCPGet

Anyhow I have tested both and they both work fine for me locally: Can you try a local test on same host see how you get on like this ?

Also unsure why you are still using those ancient methods:

https://github.com/vahidhedayati/RemoteSSH/blob/master/docs/revisions/release-0.14.md

boolean singleInstance=false
SSHUtil sshUtil = sshUtilService.initialise('username','password','localhost',22,singleInstance)

//gets a bunch of files
        println """Getting REMOTE FILES: 
            ['/tmp/backup-test-new/remote-file-example2.txt',
            '/tmp/backup-test-new/remote-file-example.txt']  and copying to: /tmp/remote-got
        """

sshUtilService.getFiles(sshUtil,['/tmp/backup-test-new/remote-file-example2.txt',
            '/tmp/backup-test-new/remote-file-example.txt'],'/tmp/remote-got')

        println"""Getting REMOTE FILES: 
            ['/tmp/backup-test-new/remote-file-example2.txt',
            '/tmp/backup-test-new/remote-file-example.txt'] and copying to: /tmp/remote-got2
        """

sshUtil.getFiles(['/tmp/backup-test-new/remote-file-example2.txt',
            '/tmp/backup-test-new/remote-file-example.txt'],'/tmp/remote-got2')

sshUtil.disconnect

Here are test methods used which worked for me

import ssh.RemoteSCPGet

class TestController {

    def index() {

        RemoteSCPGet rscpdir=new RemoteSCPGet('localhost', '/tmp/vv.txt', '/tmp/cc')
        def result=rscpdir.Result(sshConfig)
        render "hello"
    }

}
import grails.plugin.remotessh.RemoteSCPGet

class TestController {

    def index() {

        RemoteSCPGet rscpdir=new RemoteSCPGet()
        rscpdir.host='localhost'
        rscpdir.port=22
        rscpdir.user='username'
        rscpdir.userpass='password'
        rscpdir.file='/tmp/vv.txt'
        rscpdir.localdir='/tmp/cc'
        def result=rscpdir.Result(sshConfig)
        render "hello"
    }