2

I am using the Jenkins publish over SSH plugin to transfer files to a remote server.

When I configure the Publish over SSH plugin and specify a Remote Directory, testing the configuration always fails with this error:

jenkins.plugins.publish_over.BapPublisherException: Failed to change to remote directory [C:\zzTest]

Publish over ssh plugin - failed to change remote directory

However if I leave the Remote Directory filed blank I get a success message when I test the configuration.

enter image description here

Any ideas as to what I am doing wrong here? The directory definitely exists on the remote server.

shane87
  • 3,090
  • 12
  • 51
  • 65
  • The ssh server could be limiting your access to the filesystem. Most server software does that. – LinuxDisciple Oct 07 '16 at 21:32
  • That is not the case as I am able to change to that directory when I ssh to that machine using putty. I only get this error when testing the publish over ssh jenkins plugin. – shane87 Oct 07 '16 at 21:37
  • And you're using the same login as Jenkins, and you can make directories and files in there over ssh? – LinuxDisciple Oct 07 '16 at 21:40
  • Yes that's correct. – shane87 Oct 07 '16 at 21:48
  • 1
    I noticed that remote dir path is WIndows style. Are your sure the "Publish Over SSH" plugin supports Windows paths? Also what SSH serve do you use on WIndows? You can try forward slashes "c:/zzTest" in common case or "/cydgrive/c/zzTest" for cygwin-based installation specifically. – izzekil Oct 09 '16 at 03:34
  • @izzekil I have tried forward slashes and still get the same problem. I am using freeSSHd as my SSH serve. I can connect, change directory location and create files and folders from the command line with no problems. So not sure what is going on under the hood with the Publish Over SSH plugin. – shane87 Oct 11 '16 at 16:59

2 Answers2

4

So it seems the problem was with specifying the absolute path in the Remote Directory field.

The solution is to specify the relative path. So in the scenario above /zzTest is the value which should be entered into the Remote Directory field.

shane87
  • 3,090
  • 12
  • 51
  • 65
-3
  1. Select "sftp",change "SFTP home path" to "C:\"

enter image description here

  1. Change "ssh server Remote Directory" to "/zzTest"

  2. Test Configuration

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135