среда, 12 октября 2016 г.

Фиксим Algorithm negotiation fail в плагине Jenkins scp


Пару раз сталкивался с обновлением дженкинса, после которого переставал работать scp плагин, который закачивает файлы по ssh. Проблема в джобе такого плана:
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:779)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
    at hudson.model.Build$BuildExecution.post2(Build.java:185)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
    at hudson.model.Run.execute(Run.java:1745)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:404)
Build step 'Publish artifacts to SCP Repository' changed build result to UNSTABLE

Дело в том что библиотека jsch старая, и не умеет работать с новым openssh. Для фикса необходимо:
  1. Скачать последнею версию jsch.jar я использовал jsch-0.1.54.jar
  2. Данную библиотеку подкладываем в дженкинс - jenkins/plugins/scp/WEB-INF/lib/
  3. Правим pom.xml который находится в jenkins/plugins/scp/META-INF/maven/org.jvnet.hudson.plugins/scp/                                                                               <dependencies>
            <dependency>
                <groupId>com.jcraft</groupId>
                <artifactId>jsch</artifactId>
                <version>0.1.54</version>
            </dependency>
        </dependencies>

    В version вписываем нашу версию скаченой библиотеки
  4. Проставить нужные права(если Jenkins запускается под другим пользователем)
  5. Перезапустить Jenkins

Комментариев нет:

Отправить комментарий