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

21 views
Skip to first unread message

mzemek@fides.cz (JIRA)

unread,
Apr 21, 2020, 12:44:03 PM4/21/20
to jenkinsc...@googlegroups.com
Martin Zemek created an issue
 
Jenkins / Bug JENKINS-61996
Gitea organization with SSH checkout has ssh:/// in address
Issue Type: Bug Bug
Assignee: Unassigned
Attachments: 2020-04-21-log.txt, image-2020-04-21-18-40-08-741.png
Components: gitea-plugin
Created: 2020-04-21 16:43
Environment: Jenkins 2.232
Credentials 2.3.7
Gitea Plugin 1.2.0
Gitea 1.11.4
Priority: Minor Minor
Reporter: Martin Zemek

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:///g...@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.

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

regner@blok-andersen.com (JIRA)

unread,
May 6, 2020, 3:09:02 PM5/6/20
to jenkinsc...@googlegroups.com
Regner Blok-Andersen commented on Bug JENKINS-61996
 
Re: 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.

mzemek@fides.cz (JIRA)

unread,
May 7, 2020, 2:18:04 AM5/7/20
to jenkinsc...@googlegroups.com

mzemek@fides.cz (JIRA)

unread,
May 7, 2020, 2:20:03 AM5/7/20
to jenkinsc...@googlegroups.com
Martin Zemek commented on Bug JENKINS-61996
 
Re: Gitea organization with SSH checkout has ssh:/// in address

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

                        "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.

mzemek@fides.cz (JIRA)

unread,
May 7, 2020, 2:25:02 AM5/7/20
to jenkinsc...@googlegroups.com
Martin Zemek edited a comment on Bug JENKINS-61996
I have fixed this and will create a pull request during the weekend or later today.
GiteaSCMBuilder.java: 177 167
 
{code:java}
                        "ssh://git@" + sshUri.getHost() + (sshUri.getPort() != 22 ? ":" + sshUri.getPort() : ""  {code}

URI.getPort returns -1 if there is no port specified. Adding a condition for this fixes this issue.
 
{code:java}
                        "ssh://git@" + sshUri.getHost() + (sshUri.getPort() != 22 && sshUri.getPort() != -1 ? ":" + sshUri.getPort() : ""  {code}

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

mzemek@fides.cz (JIRA)

unread,
May 7, 2020, 2:57:03 AM5/7/20
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages