Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In kubesphere-devops, pipeline ignores github credentials for cloning github organization repos #6081

Open
akinmail opened this issue Apr 22, 2024 · 1 comment
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@akinmail
Copy link

Describe the Bug
Hello there, i have been battling this issue for about a week, when you configure the devops credentials from the UI, using the username and password authentication for github(using a personal access token from github as password). Kubesphere cannot clone the repo.

As you can see in the image below, i can correctly setup a repository thats connected to the repo in my github organization
Screenshot 2024-04-22 at 2 44 51 PM
Screenshot 2024-04-22 at 2 44 59 PM
Screenshot 2024-04-22 at 2 45 30 PM

But when i run any pipeline that needs to clone this repository, i always get this error!

Checking out a fresh workspace because /home/jenkins/agent/workspace/asset-config-service-devops4pzt7/pipeline2 doesn't exist
Cleaning local Directory .
Checking out https://github.com/betdemand-code/asset-config-service at revision '2024-04-22T13:30:39.892 +0000' --quiet
ERROR: Failed to check out https://github.com/betdemand-code/asset-config-service
org.tmatesoft.svn.core.SVNException: svn: E160013: '/betdemand-code/asset-config-service' path not found: 404 Not Found (https://github.com)
	at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:70)
	at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:57)
	at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:760)
	at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:352)
	at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:340)
	at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.performHttpRequest(DAVConnection.java:910)
	at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:702)
	at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.open(DAVConnection.java:113)
	at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.openConnection(DAVRepository.java:1047)
	at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.getLatestRevision(DAVRepository.java:169)
	at org.tmatesoft.svn.core.internal.wc16.SVNBasicDelegate.getRevisionNumber(SVNBasicDelegate.java:480)
	at org.tmatesoft.svn.core.internal.wc16.SVNBasicDelegate.getLocations(SVNBasicDelegate.java:833)
	at org.tmatesoft.svn.core.internal.wc16.SVNBasicDelegate.createRepository(SVNBasicDelegate.java:527)
	at org.tmatesoft.svn.core.internal.wc16.SVNUpdateClient16.doCheckout(SVNUpdateClient16.java:875)
	at org.tmatesoft.svn.core.internal.wc2.old.SvnOldCheckout.run(SvnOldCheckout.java:66)
	at org.tmatesoft.svn.core.internal.wc2.old.SvnOldCheckout.run(SvnOldCheckout.java:18)
	at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:21)
	at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1239)
	at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
	at hudson.scm.subversion.CheckoutUpdater$SubversionUpdateTask.perform(CheckoutUpdater.java:139)
	at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:168)
	at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:176)
	at hudson.scm.subversion.UpdateUpdater$TaskImpl.perform(UpdateUpdater.java:138)
	at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:168)
	at hudson.scm.SubversionSCM$CheckOutUpdateTask.perform(SubversionSCM.java:1085)
	at hudson.scm.SubversionSCM$CheckOutUpdateTask.run(SubversionSCM.java:1066)
	at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:1036)
	at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:1019)
	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3329)
	at hudson.remoting.UserRequest.perform(UserRequest.java:211)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:376)
	at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:122)
	at java.base/java.lang.Thread.run(Unknown Source)
java.io.IOException: Failed to check out https://github.com/betdemand-code/asset-config-service
Screenshot 2024-04-22 at 2 48 50 PM Screenshot 2024-04-22 at 2 49 14 PM

The main error to me is org.tmatesoft.svn.core.SVNException: svn: E160013: '/betdemand-code/asset-config-service' path not found: 404 Not Found (https://github.com) and this suggests to me that there is a bug with kubesphere where it is ignoring the configured credentials as you only get the 404 response from github if you do not pass the credentials for org repositories.

To confirm this assumption, i logged in to the devops-jenkins dashboard deployed in the. namespace kubesphere-devops-system and then i manually configured a build and configured the SCM to clone the repo using a configuration i made on the jenkins dashboard, no surprises there because it worked as expected.

Versions Used
KubeSphere: v3.4.1
Kubernetes: Kubernetes 1.29.1-do.0

Environment
3 nodes of 4 GB Memory / 80 GB Disk + 38 GB / SFO2 - Debian do-kube-1.29.1-do.0

How To Reproduce
Steps to reproduce the behavior:

  1. Login to Kubespher dashboard, go to 'workbench', click on workspace, create devops project, create pipeline, create repo, create github credential(ensure the github repo is private in a github organization)
  2. Run pipeline

Expected behavior
You should get error above

@akinmail akinmail added the kind/bug Categorizes issue or PR as related to a bug. label Apr 22, 2024
@akinmail akinmail changed the title In kubespher-devops, pipeline ignores github credentials for cloning github organization repos In kubesphere-devops, pipeline ignores github credentials for cloning github organization repos Apr 22, 2024
@akinmail
Copy link
Author

This seems to be the same error complained about here

#2028

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

1 participant