Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-52146

SCP not working with windows to windows file transfer

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Blocker
    • Resolution: Unresolved
    • scp-plugin
    • None
    • windows to windows connectivity

    Description

      Hi

      we want to achieve the Jenkins pipeline in cross IP environment(same server domain but different IP)  I am trying to copy the shell script file from one windows server to another windows server (through shell script), after successful copy of file we want to execute that copied shell script file on target server(where we copied the file). when we trying to implement this we are facing the following challenges:-

      1. How we can authenticate the target server because RSA_private_key and Public_key exchange method is not working?
      2. When we try to implement this through scp and ssh configuration through plugin and openssh we are getting the following error:

      Started by user jenkins
      [EnvInject] - Loading node environment variables.
      Building in workspace C:\Users\admin\.jenkins\workspace\testing scp
      CIFS: Connecting from host [IIServer1]
      CIFS: Connecting with configuration [IIServer2] ...
      ERROR: Exception when publishing, exception message [Exception when testing config. URL [smb://IIServer2/H:/scripts/], Message: [Logon failure: unknown user name or bad password.]]
      Build step 'Send files to a windows share' changed build result to UNSTABLE
      [SCP] Connecting to IIServer2
      ERROR: Failed to upload files
      com.jcraft.jsch.JSchException: Algorithm negotiation fail
       at com.jcraft.jsch.Session.receive_kexinit(Session.java:520)
       at com.jcraft.jsch.Session.connect(Session.java:286)
       at com.jcraft.jsch.Session.connect(Session.java:150)
       at be.certipost.hudson.plugin.SCPSite.createSession(SCPSite.java:153)
       at be.certipost.hudson.plugin.SCPRepositoryPublisher.perform(SCPRepositoryPublisher.java:160)
       at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
       at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
       at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
       at hudson.model.Build$BuildExecution.post2(Build.java:186)
       at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
       at hudson.model.Run.execute(Run.java:1819)
       at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
       at hudson.model.ResourceController.execute(ResourceController.java:97)
       at hudson.model.Executor.run(Executor.java:429)
      Finished: UNSTABLE

      If you need any further clarification kindly let me know.

      It will be great if you can help me on the above error.

       

       

      Thanks!

      Abhishek Choudhary

       

      Attachments

        Activity

          slide_o_mix Alex Earl added a comment -

          Your share path looks incorrect "smb://IIServer2/H:/scripts/". You can't just put a drive letter and directory on there, you have to expose the share on the Windows server and then use that share path. This doesn't look like an issue in publish-over-cifs

          slide_o_mix Alex Earl added a comment - Your share path looks incorrect "smb://IIServer2/H:/scripts/". You can't just put a drive letter and directory on there, you have to expose the share on the Windows server and then use that share path. This doesn't look like an issue in publish-over-cifs

          Hi Alex 

          Thanks for your response. we tried putting the shared folder path of target server inside the configuration but error is remain same.

          Thanks!

          Abhishek

           

          abhishekchoudhary Abhishek Choudhary added a comment - Hi Alex  Thanks for your response. we tried putting the shared folder path of target server inside the configuration but error is remain same. Thanks! Abhishek  
          slide_o_mix Alex Earl added a comment -

          Did you specify the user as domain\username? Does the test connection in the global config work correctly?

          slide_o_mix Alex Earl added a comment - Did you specify the user as domain\username? Does the test connection in the global config work correctly?

          I tried in other way like username@domain-name so it's works. Now can you please help me with the, how can we execute the shell script on the target server because target server is windows so it's throwing error like unrecognized command. is there any way?

           

          Thanks!

          Abhishek 

          abhishekchoudhary Abhishek Choudhary added a comment - I tried in other way like username@domain-name so it's works. Now can you please help me with the, how can we execute the shell script on the target server because target server is windows so it's throwing error like unrecognized command. is there any way?   Thanks! Abhishek 
          slide_o_mix Alex Earl added a comment -

          I'm not the maintainer of the SCP plugin, so I am not sure what could be the issue. Which SSH server are you running on Windows?

          slide_o_mix Alex Earl added a comment - I'm not the maintainer of the SCP plugin, so I am not sure what could be the issue. Which SSH server are you running on Windows?

          Thanks for your response, I tried with openssh 6.6 and 7.6.

          abhishekchoudhary Abhishek Choudhary added a comment - Thanks for your response, I tried with openssh 6.6 and 7.6.
          slide_o_mix Alex Earl added a comment -

          It looks like from the error in the log that JSch and the OpenSSH server don't have a matching of key algorithms. You can search on the web for various things to try.

          slide_o_mix Alex Earl added a comment - It looks like from the error in the log that JSch and the OpenSSH server don't have a matching of key algorithms. You can search on the web for various things to try.

          People

            andresrc Andres Rodriguez
            abhishekchoudhary Abhishek Choudhary
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: