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

Fail to fetch PR from private org

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • gitea-plugin
    • None
    • Gitea 1.16.1
      Jenkins 2.319.3
      Plugin-Version 1.4.1

      I created an organisational folder for a private Gitea instance. Both the organization and the project are private.

      The user and the personal-access-token are created as described on the plugin help page.

      While build branches work fine, building pull-requests fails with an error if I start the build manually. Builds triggered by Webhooks run fine.

      Started by user Gregor Tudan
      Running as Gregor Tudan
      Looking up repository VV/antora-theme
      Querying the current revision of pull request #17...
      Current revision of pull request #17 is b8cf059e793da04596f6b9e63a88410866eb23ad
      org.jenkinsci.plugin.gitea.client.api.GiteaHttpStatusException: HTTP 403/Forbidden
      	at org.jenkinsci.plugin.gitea.client.impl.DefaultGiteaConnection.getObject(DefaultGiteaConnection.java:865)
      	at org.jenkinsci.plugin.gitea.client.impl.DefaultGiteaConnection.fetchRepository(DefaultGiteaConnection.java:200)
      	at org.jenkinsci.plugin.gitea.GiteaSCMFileSystem$BuilderImpl.build(GiteaSCMFileSystem.java:170)
      	at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:293)
      	at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:106)
      	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:310)
      	at hudson.model.ResourceController.execute(ResourceController.java:99)
      	at hudson.model.Executor.run(Executor.java:432)
      [Gitea] Notifying pull request build status: FAILURE There was a failure building this commit
      [Gitea] Notified
      Finished: FAILURE

      Here is what's in the jenkins logs:

      022-02-15 10:25:53.110+0000 [id=6686]  INFO    o.j.p.g.GiteaNotifier$JobScheduledListener$1#run: Looking up repository VV/antora-theme
      2022-02-15 10:25:53.157+0000 [id=6686]  INFO    o.j.p.g.GiteaNotifier$JobScheduledListener$1#run: Querying the current revision of pull request #17...
      2022-02-15 10:25:53.231+0000 [id=6686]  INFO    o.j.p.g.GiteaNotifier$JobScheduledListener$1#run: Current revision of pull request #17 is b8cf059e793da04596f6b9e63a88410866eb23ad
      2022-02-15 10:25:53.231+0000 [id=6686]  INFO    o.j.p.g.GiteaNotifier$JobScheduledListener$1#run: Notifying pull request pending build VV/antora-theme/PR-17
      2022-02-15 10:25:53.295+0000 [id=6686]  INFO    o.j.p.g.GiteaNotifier$JobScheduledListener$1#run: VV/antora-theme/PR-17 Notified
      2022-02-15 10:25:53.320+0000 [id=7658]  INFO    o.j.p.workflow.job.WorkflowRun#finish: VV/antora-theme/PR-17 #1 completed: FAILURE

      This is the failed call in the access log:

      /api/v1/repos/VV/antora-theme

            gtudan Gregor Tudan
            gtudan Gregor Tudan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: