jenkinsci / jetbrains-space-plugin

JetBrains Space plugin for Jenkins
https://plugins.jenkins.io/jetbrains-space/
MIT License
1 stars 2 forks source link

Can't create fetch repo #32

Closed llotall closed 3 months ago

llotall commented 3 months ago

Jenkins and plugins versions report

Environment ```text Jenkins: 2.440.3 OS: Linux - 6.5.0-42-generic Java: 21.0.3 - Ubuntu (OpenJDK 64-Bit Server VM) --- ant:497.v94e7d9fffa_b_9 antisamy-markup-formatter:162.v0e6ec0fcfcf6 apache-httpcomponents-client-4-api:4.5.14-208.v438351942757 asm-api:9.7-33.v4d23ef79fcc8 bootstrap5-api:5.3.3-1 bouncycastle-api:2.30.1.78.1-233.vfdcdeb_0a_08a_a_ branch-api:2.1169.va_f810c56e895 build-timeout:1.33 caffeine-api:3.1.8-133.v17b_1ff2e0599 checks-api:2.2.0 cloudbees-folder:6.901.vb_4c7a_da_75da_3 commons-lang3-api:3.14.0-76.vda_5591261cfe commons-text-api:1.12.0-119.v73ef73f2345d credentials:1355.v46f52a_b_98d64 credentials-binding:681.vf91669a_32e45 dark-theme:439.vdef09f81f85e display-url-api:2.204.vf6fddd8a_8b_e9 durable-task:555.v6802fe0f0b_82 echarts-api:5.5.0-1 eddsa-api:0.3.0-4.v84c6f0f4969e email-ext:1814.v404722f34263 font-awesome-api:6.5.2-1 git:5.2.2 git-client:5.0.0 github:1.39.0 github-api:1.318-461.v7a_c09c9fa_d63 github-branch-source:1789.v5b_0c0cea_18c3 gradle:2.12 gson-api:2.11.0-41.v019fcf6125dc instance-identity:185.v303dc7c645f9 ionicons-api:74.v93d5eb_813d5f jackson2-api:2.17.0-379.v02de8ec9f64c jakarta-activation-api:2.1.3-1 jakarta-mail-api:2.1.3-1 javax-activation-api:1.2.0-7 javax-mail-api:1.6.2-10 jaxb:2.3.9-1 jetbrains-space:1.53.vcd2e91eb_a_620 jjwt-api:0.11.5-112.ve82dfb_224b_a_d joda-time-api:2.12.7-29.v5a_b_e3a_82269a_ jquery3-api:3.7.1-2 json-api:20240303-41.v94e11e6de726 json-path-api:2.9.0-58.v62e3e85b_a_655 junit:1265.v65b_14fa_f12f0 ldap:725.v3cb_b_711b_1a_ef mailer:472.vf7c289a_4b_420 matrix-auth:3.2.2 matrix-project:832.va_66e270d2946 mina-sshd-api-common:2.13.1-117.v2f1a_b_66ff91d mina-sshd-api-core:2.13.1-117.v2f1a_b_66ff91d okhttp-api:4.11.0-172.vda_da_1feeb_c6e pam-auth:1.11 pipeline-build-step:540.vb_e8849e1a_b_d8 pipeline-github-lib:61.v629f2cc41d83 pipeline-graph-analysis:216.vfd8b_ece330ca_ pipeline-groovy-lib:727.ve832a_9244dfa_ pipeline-input-step:495.ve9c153f6067b_ pipeline-milestone-step:119.vdfdc43fc3b_9a_ pipeline-model-api:2.2203.v89fa_170c2b_f5 pipeline-model-definition:2.2203.v89fa_170c2b_f5 pipeline-model-extensions:2.2203.v89fa_170c2b_f5 pipeline-rest-api:2.34 pipeline-stage-step:312.v8cd10304c27a_ pipeline-stage-tags-metadata:2.2203.v89fa_170c2b_f5 pipeline-stage-view:2.34 plain-credentials:183.va_de8f1dd5a_2b_ plugin-util-api:4.1.0 resource-disposer:0.23 scm-api:690.vfc8b_54395023 script-security:1341.va_2819b_414686 snakeyaml-api:2.2-111.vc6598e30cc65 ssh-credentials:337.v395d2403ccd4 ssh-slaves:2.973.v0fa_8c0dea_f9f structs:338.v848422169819 theme-manager:262.vc57ee4a_eda_5d timestamper:1.27 token-macro:400.v35420b_922dcb_ trilead-api:2.147.vb_73cc728a_32e variant:60.v7290fc0eb_b_cd workflow-aggregator:600.vb_57cdd26fdd7 workflow-api:1316.v33eb_726c50b_a_ workflow-basic-steps:1058.vcb_fc1e3a_21a_9 workflow-cps:3903.v48a_8836749e9 workflow-durable-task-step:1353.v1891a_b_01da_18 workflow-job:1400.v7fd111b_ec82f workflow-multibranch:773.vc4fe1378f1d5 workflow-scm-step:427.v4ca_6512e7df1 workflow-step-api:657.v03b_e8115821b_ workflow-support:907.v6713a_ed8a_573 ws-cleanup:0.46 ```

What Operating System are you using (both controller, and any agents involved in the problem)?

Ubuntu 23.10

Reproduction steps

  1. Step 1: Connect to Space via Plugin
  2. Step 2: Add Pipline or Multi Pipline
  3. Step 3. Save and Run pipline

Expected Results

Pipline works

Actual Results

Exception:

Started by user [llotall](https://jenkins.optad.ru/user/llotall)
[Thu Jul 04 10:44:58 UTC 2024] Starting branch indexing...
ERROR: [Thu Jul 04 10:44:58 UTC 2024] Could not fetch branches from source 76e9eb3b-ba77-4bd5-81d1-6b0c2c298c5e
[Thu Jul 04 10:44:58 UTC 2024] Finished branch indexing. Indexing took 16 ms
FATAL: Failed to recompute children of optad
java.lang.NullPointerException: Cannot invoke "org.jetbrains.space.jenkins.scm.SpaceSCMSourceType.ordinal()" because the return value of "org.jetbrains.space.jenkins.scm.SpaceSCMSource.getType()" is null
    at org.jetbrains.space.jenkins.scm.SpaceSCMSourceKt$retrieve$1$1$1.invokeSuspend(SpaceSCMSource.kt:72)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:280)
    at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
    at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
    at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
    at org.jetbrains.space.jenkins.scm.SpaceSCMSourceKt.retrieve(SpaceSCMSource.kt:71)
    at org.jetbrains.space.jenkins.scm.SpaceSCMSource.retrieve(SpaceSCMSource.java:172)
    at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:372)
    at jenkins.scm.api.SCMSource.fetch(SCMSource.java:282)
    at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:654)
    at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:265)
    at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:167)
    at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1057)
    at hudson.model.ResourceController.execute(ResourceController.java:101)
    at hudson.model.Executor.run(Executor.java:442)
Finished: FAILURE

Anything else?

No response

Are you interested in contributing a fix?

No response

Kiryushin-Andrey commented 3 months ago

Hi @llotall , Have you chosen either branches or merge requests discovery in the branch source settings?

image

Looks like this control misses some validation, but it is required to choose either one or the other here.

llotall commented 3 months ago

Hello, @Kiryushin-Andrey. Yes that fixed this issue, but now i got same result like in regular Pipline.

I have added git.jetbrains.space to the known_hosts file, but I am still encountering the following error:

Exception ```text Branch event ERROR: Could not determine exact tip revision of tasks/1-deploy-configuration; falling back to nondeterministic checkout Checking out org.jetbrains.space.jenkins.scm.SpaceSCM into /var/lib/jenkins/.jenkins/workspace/tad_tasks_1-deploy-configuration@script/3db9c9eaf9178b80b2b8df333fc4d93a84f3f60ec43d50022aa1951fa4d95f6e to read Jenkinsfile The recommended git tool is: NONE using credential 38d1eab5-53a9-4214-acb6-de99a1a2321d > git rev-parse --resolve-git-dir /var/lib/jenkins/.jenkins/workspace/tad_tasks_1-deploy-configuration@script/3db9c9eaf9178b80b2b8df333fc4d93a84f3f60ec43d50022aa1951fa4d95f6e/.git # timeout=10 Fetching changes from the remote Git repository > git config remote.kamino.url ssh://git@git.jetbrains.space/kamino-dev/main/kamino.git # timeout=10 Fetching upstream changes from ssh://git@git.jetbrains.space/kamino-dev/main/kamino.git > git --version # timeout=10 > git --version # 'git version 2.40.1' using GIT_SSH to set credentials Verifying host key using known hosts file > git fetch --tags --force --progress -- ssh://git@git.jetbrains.space/kamino-dev/main/kamino.git refs/heads/tasks/1-deploy-configuration:refs/remotes/kamino/tasks/1-deploy-configuration # timeout=10 ERROR: Error fetching remote repo 'kamino' hudson.plugins.git.GitException: Failed to fetch from ssh://git@git.jetbrains.space/kamino-dev/main/kamino.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:999) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1241) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1305) at org.jetbrains.space.jenkins.scm.SpaceSCM.checkout(SpaceSCM.java:118) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:136) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:167) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:143) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:311) at hudson.model.ResourceController.execute(ResourceController.java:101) at hudson.model.Executor.run(Executor.java:442) Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --force --progress -- ssh://git@git.jetbrains.space/kamino-dev/main/kamino.git refs/heads/tasks/1-deploy-configuration:refs/remotes/kamino/tasks/1-deploy-configuration" returned status code 128: stdout: stderr: No RSA host key is known for git.jetbrains.space and you have requested strict checking. Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2846) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2185) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:635) at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:997) ... 9 more ERROR: Error fetching remote repo 'kamino' ERROR: Maximum checkout retry attempts reached, aborting ERROR: Error fetching remote repo 'kamino' ERROR: Maximum checkout retry attempts reached, aborting Finished: FAILURE ```
llotall commented 3 months ago

But anyway, you are helped me, if it possible can you add somewhere information for Code plugin or create issue to fix it somehow. Have a good day. Problem solved

Kiryushin-Andrey commented 3 months ago

Glad that it helped! Regarding your other error message - it looks like read repository permission hasn't been approved for the integration on the SpaceCode side. There should be a warning about it on the multibranch project configuration page, next to the branch source parameters. It should also be visible on the Manage Jenkins integration page in SpaceCode (/manage/integrations/jenkins)