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

Gitea organization with SSH checkout has ssh:/// in address

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • gitea-plugin
    • None
    • Jenkins 2.232
      Credentials 2.3.7
      Gitea Plugin 1.2.0
      Gitea 1.11.4
    • 1.2.1

      Job fails to checkout over SSH. When created with Gitea organization and scanned for jenkinsfile. 

      The problem seems to be in ssh url:

      git.exe config remote.origin.url ssh:///git@gitea.f.cz:-1/F/llll3.git # timeout=10
      

      notice the ssh:///git@

       

      Because of this the "/git" user is used. The correct user should be "git"

       

      When using the git plugin and Multibranch pipeline, checkout proceeds correctly.

       

          [JENKINS-61996] Gitea organization with SSH checkout has ssh:/// in address

          We are also experiencing this issue. We are running Gitea 1.11.4 and the Gitea Jenkins plugin is version 1.2.0.

          We have tried rolling Gitea back to 1.10 as well and the same issue.

          Regner Blok-Andersen added a comment - We are also experiencing this issue. We are running Gitea 1.11.4 and the Gitea Jenkins plugin is version 1.2.0. We have tried rolling Gitea back to 1.10 as well and the same issue.

          Martin Zemek added a comment - - edited

          I have fixed this and will create a pull request during the weekend or later today.
          GiteaSCMBuilder.java:167
           

                                  "ssh://git@" + sshUri.getHost() + (sshUri.getPort() != 22 ? ":" + sshUri.getPort() : ""  

          URI.getPort returns -1 if there is no port specified. Adding a condition for this fixes this issue.
           

                                  "ssh://git@" + sshUri.getHost() + (sshUri.getPort() != 22 && sshUri.getPort() != -1 ? ":" + sshUri.getPort() : ""  

          Other option is to specify the 22 port.
          I have added a snapshot build (attached gitea.jar) if you want to try this.

          Martin Zemek added a comment - - edited I have fixed this and will create a pull request during the weekend or later today. GiteaSCMBuilder.java:167                            "ssh: //git@"  + sshUri.getHost() + (sshUri.getPort() != 22 ?  ":"  + sshUri.getPort() : ""   URI.getPort returns -1 if there is no port specified. Adding a condition for this fixes this issue.                            "ssh: //git@"  + sshUri.getHost() + (sshUri.getPort() != 22 && sshUri.getPort() != -1 ?  ":"  + sshUri.getPort() : ""   Other option is to specify the 22 port. I have added a snapshot build (attached gitea.jar) if you want to try this.

          Martin Zemek added a comment -

          I have created the pull request: https://github.com/jenkinsci/gitea-plugin/pull/23

          Martin Zemek added a comment - I have created the pull request:  https://github.com/jenkinsci/gitea-plugin/pull/23

            Unassigned Unassigned
            mzemek Martin Zemek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: