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

Error push new tag to git repository

    Details

    • Similar Issues:

      Description

      When generating a new tag repository, I'm getting an HTTP Error 401. I think the credentials are not being sent on the command.

      If I do the same from shell, works properly

      These are the logs:

      > git tag -l TAG-39 # timeout=10
      > git tag -a -f -m http://oclrh65c109.isbcloud.isban.corp:9080/jenkins/job/ReleaseLokiAll/39/ TAG-39 # timeout=10
      Pushing tag TAG-39 to repo Toms
      > git --version # timeout=10
      using .gitcredentials to set credentials
      > git config --local credential.username jenkins # timeout=10
      > git config --local credential.helper store --file=/tmp/git5654596688481070714.credentials # timeout=10
      Setting http proxy: 172.31.219.30:8080
      > git -c core.askpass=true push http://grddesavlngd01.nngg.corp:8080/almis/toms.git TAG-39
      > git config --local --remove-section credential # timeout=10
      ERROR: Failed to push tag TAG-39 to Toms
      hudson.plugins.git.GitException: Command "git -c core.askpass=true push http://grddesavlngd01.nngg.corp:8080/almis/toms.git TAG-39" returned status code 1:
      stdout:
      stderr: * About to connect() to proxy 180.16.242.103 port 8080 (#0)

      < HTTP/1.1 401 Unauthorized
      < Content-Type: text/html; charset=UTF-8
      < Set-Cookie: lang=en-US; Path=/; Max-Age=2147483647
      < Set-Cookie: i_like_gogits=21e2bb502c6bf8f1; Path=/; HttpOnly
      < Set-Cookie: _csrf=_776vIsNeDpq8HOElCg21pjXyzU6MTQ1MzQ1NzkxNDgzNTM3MjM0Ng%3D%3D; Path=/
      < WWW-Authenticate: Basic realm="."
      < Date: Fri, 22 Jan 2016 10:18:34 GMT
      < X-Cache: MISS from bvmnglappmd01
      < Transfer-Encoding: chunked
      < Via: 1.1 bvmnglappmd01 (squid/3.5.9)
      < Connection: keep-alive
      <

      • Ignoring the response-body
      • Expire cleared
      • Connection #0 to host 180.16.242.103 left intact
      • Issue another request to this URL: 'http://grddesavlngd01.nngg.corp:8080/almis/toms.git/info/refs?service=git-receive-pack'
      • Re-using existing connection! (#0) with host 180.16.242.103
      • Connected to 180.16.242.103 (180.16.242.103) port 8080 (#0)
      • Server auth using Basic with user 'jenkins'
        > GET http://grddesavlngd01.nngg.corp:8080/almis/toms.git/info/refs?service=git-receive-pack HTTP/1.1
        Authorization: Basic amVua2luczpqZW5raW5zLjIwMTU=
        User-Agent: git/1.7.1
        Host: grddesavlngd01.nngg.corp:8080
        Accept: /
        Proxy-Connection: Keep-Alive
        Pragma: no-cache

      < HTTP/1.1 401 Unauthorized
      < Content-Type: text/plain
      < Set-Cookie: lang=en-US; Path=/; Max-Age=2147483647
      < Set-Cookie: i_like_gogits=0571ac89753ff346; Path=/; HttpOnly
      < Set-Cookie: _csrf=qJdvkeyRG57WN-F1aFwpuRF6tqw6MTQ1MzQ1NzkxNDg4NjkxMjIzNg%3D%3D; Path=/
      < Date: Fri, 22 Jan 2016 10:18:35 GMT
      < Content-Length: 13
      < X-Cache: MISS from bvmnglappmd01
      < Via: 1.1 bvmnglappmd01 (squid/3.5.9)
      < Connection: keep-alive

      • The requested URL returned error: 401
      • Closing connection #0
      • About to connect() to proxy 180.16.242.103 port 8080 (#0)
      • Trying 180.16.242.103... * Connected to 180.16.242.103 (180.16.242.103) port 8080 (#0)
        > GET http://grddesavlngd01.nngg.corp:8080/almis/toms.git/info/refs HTTP/1.1
        User-Agent: git/1.7.1
        Host: grddesavlngd01.nngg.corp:8080
        Accept: /
        Proxy-Connection: Keep-Alive
        Pragma: no-cache

      < HTTP/1.1 200 OK
      < Accept-Ranges: bytes
      < Cache-Control: no-cache, max-age=0, must-revalidate
      < Content-Length: 295
      < Content-Type: text/plain; charset=utf-8
      < Expires: Fri, 01 Jan 1980 00:00:00 GMT
      < Last-Modified: Fri, 22 Jan 2016 10:18:35 GMT
      < Pragma: no-cache
      < Set-Cookie: lang=en-US; Path=/; Max-Age=2147483647
      < Set-Cookie: i_like_gogits=5ebf987a8afeb55c; Path=/; HttpOnly
      < Set-Cookie: _csrf=uCARWJUF8TYXFcXcPTpWLdX0s_E6MTQ1MzQ1NzkxNTA5MTYyNzkwMQ%3D%3D; Path=/
      < Date: Fri, 22 Jan 2016 10:18:35 GMT
      < X-Cache: MISS from bvmnglappmd01
      < Via: 1.1 bvmnglappmd01 (squid/3.5.9)
      < Connection: keep-alive
      <

      • Connection #0 to host 180.16.242.103 left intact
      • Re-using existing connection! (#0) with host 180.16.242.103
      • Connected to 180.16.242.103 (180.16.242.103) port 8080 (#0)
        > GET http://grddesavlngd01.nngg.corp:8080/almis/toms.git/HEAD HTTP/1.1
        User-Agent: git/1.7.1
        Host: grddesavlngd01.nngg.corp:8080
        Accept: /
        Proxy-Connection: Keep-Alive
        Pragma: no-cache
      • The requested URL returned error: 404 Not Found
      • Expire cleared
      • Closing connection #0
      • About to connect() to proxy 180.16.242.103 port 8080 (#0)
      • Trying 180.16.242.103... * Connected to 180.16.242.103 (180.16.242.103) port 8080 (#0)
        > PROPFIND http://grddesavlngd01.nngg.corp:8080/almis/toms.git/ HTTP/1.1
        User-Agent: git/1.7.1
        Host: grddesavlngd01.nngg.corp:8080
        Accept: /
        Proxy-Connection: Keep-Alive
        Depth: 0
        Content-Type: text/xml
        Content-Length: 182
        Expect: 100-continue
      • The requested URL returned error: 404 Not Found
      • Expire cleared
      • Closing connection #0
        error: Cannot access URL http://grddesavlngd01.nngg.corp:8080/almis/toms.git/, return code 22
        fatal: git-http-push failed
        error: failed to push some refs to 'http://grddesavlngd01.nngg.corp:8080/almis/toms.git'

      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1693)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1441)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:62)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$8.execute(CliGitAPIImpl.java:1769)
      at hudson.plugins.git.GitPublisher.perform(GitPublisher.java:306)
      at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1047)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
      at hudson.model.Run.execute(Run.java:1763)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:410)
      Build step 'Git Publisher' marked build as failure

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment -

          The red text in the picture "Git_config.PNG" seems to indicate that the credentials you assigned to that repository don't actually allow access to the repository. Until that red text is gone, I would expect attempts to push to the repository to fail.

          Show
          markewaite Mark Waite added a comment - The red text in the picture "Git_config.PNG" seems to indicate that the credentials you assigned to that repository don't actually allow access to the repository. Until that red text is gone, I would expect attempts to push to the repository to fail.
          Hide
          limkin Pablo Vidal added a comment -

          Thanks for answer, i put the same credenciales in a git sell command and it's ok. Furtheremore, the clone repository step is success.

          I think, the error is when i try to push the tag

          Show
          limkin Pablo Vidal added a comment - Thanks for answer, i put the same credenciales in a git sell command and it's ok. Furtheremore, the clone repository step is success. I think, the error is when i try to push the tag
          Hide
          limkin Pablo Vidal added a comment -

          Reopen that issue

          Show
          limkin Pablo Vidal added a comment - Reopen that issue
          Hide
          markewaite Mark Waite added a comment - - edited

          As far as I can tell, the plugin is using credentials as expected when it pushes a tag. I do not have a proxy between my test instance and github.com, so I cannot test the proxy case that you seem to be using, but in my case, it definitely works to push a tag to the github.com repository.

          Steps I took to confirm it is working:

          1. Create a freestyle job "JENKINS-32570-https-fails-to-push-tags"
          2. Use git as the SCM for the job, with https://github.com/MarkEWaite/JENKINS-26197.git as the repository URL and my GitHub user name and access token as password
          3. Define the "Branch to build" as "JENKINS-32570"
          4. Add an Ant build step to execute the default goal (which will increment build.number and commit the new build.number file to the local git repo)
          5. Add Git Publisher post build action to push that change and to create and push a tag named
            JENKINS-32570-ran-${BUILD_ID}

            , pushed to the Target remote name "origin"

          If you refer to https://github.com/MarkEWaite/JENKINS-26197/releases, you'll see the tags which I pushed through that job.

          Show
          markewaite Mark Waite added a comment - - edited As far as I can tell, the plugin is using credentials as expected when it pushes a tag. I do not have a proxy between my test instance and github.com, so I cannot test the proxy case that you seem to be using, but in my case, it definitely works to push a tag to the github.com repository. Steps I took to confirm it is working: Create a freestyle job " JENKINS-32570 -https-fails-to-push-tags" Use git as the SCM for the job, with https://github.com/MarkEWaite/JENKINS-26197.git as the repository URL and my GitHub user name and access token as password Define the "Branch to build" as " JENKINS-32570 " Add an Ant build step to execute the default goal (which will increment build.number and commit the new build.number file to the local git repo) Add Git Publisher post build action to push that change and to create and push a tag named JENKINS-32570-ran-${BUILD_ID} , pushed to the Target remote name "origin" If you refer to https://github.com/MarkEWaite/JENKINS-26197/releases , you'll see the tags which I pushed through that job.

            People

            • Assignee:
              ndeloof Nicolas De Loof
              Reporter:
              limkin Pablo Vidal
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: