Uploaded image for project: 'Jenkins Artifactory Plug-in'
  1. Jenkins Artifactory Plug-in
  2. HAP-1405

Artifactory Jenkins plugin unable to run "pip install"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: 4 - Normal
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.10.5
    • Component/s: None
    • Labels:
      None
    • Environment:

      Artifactory Plugin 3.9.0

      Artifactory version 7.10.2

      Ubuntu 16.04.6 LTS

       

      Description

      We are seeing the following error in the Jenkins pipeline logs. There seems to be an issue with Jenkins running source to activate the python virtual environment.

      SEVERE: pip install failed: Cannot run program "source /var/lib/jenkins/workspace/pip/env/bin/activate && pip" (in directory "."): error=2, No such file or directory java.io.IOException: pip install failed: Cannot run program "source /var/lib/jenkins/workspace/pip/env/bin/activate && pip" (in directory "."): error=2, No such file or directory

      This was reproduced using the github example pipeline script.

      https://github.com/jfrog/project-examples/blob/master/jenkins-examples/pipeline-examples/declarative-examples/pip-examples/pip-example/Jenkinsfile

      The following script bash can run the pip install, but the plugin will not work. This bash script will not add the dependencies to the buildinfo.

      stage ('Pip install') {
                  steps {
                      sh '''#!/bin/bash
                      source /var/lib/jenkins/workspace/pip/env/bin/activate && pip install -r /var/lib/jenkins/workspace/pip/python-example/requirements.txt -i http://localhost/artifactory/api/pypi/pypi/simple
                      '''
                      
         //             rtPipInstall (
         //               resolverId: "PIP_RESOLVER",
         //                args: "-r python-example/requirements.txt",
         //                envActivation: virtual_env_activation                )            }
              }
      
       

       Workaround: use JFROG CLI.

       

       

        Attachments

          Activity

            People

            Assignee:
            yahavi Yahav Itzhak
            Reporter:
            lawrencef Lawrence Fung
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: