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

GiteaHttpStatusException: HTTP 404/Not Found by querying branches with slashes

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • gitea-plugin
    • None
    • Gitea Plugin 1.3.0
      Jenkins ver. 2.303.2
      Gitea 1.15.6

      After update of the Gitea Plugin form 1.2.1 to 1.3.0 following error occurs:

      21:33:41  Started by upstream project "bla/ble/blu" build number 87
      21:33:41  originally caused by:
      21:33:41   Started by timer with parameters: {...}
      21:33:41  Querying the current revision of branch 6.6.5/release...
      21:33:41  org.jenkinsci.plugin.gitea.client.api.GiteaHttpStatusException: HTTP 404/Not Found
      21:33:41  	at org.jenkinsci.plugin.gitea.client.impl.DefaultGiteaConnection.getObject(DefaultGiteaConnection.java:866)
      21:33:41  	at org.jenkinsci.plugin.gitea.client.impl.DefaultGiteaConnection.fetchBranch(DefaultGiteaConnection.java:267)
      21:33:41  	at org.jenkinsci.plugin.gitea.GiteaSCMSource.retrieve(GiteaSCMSource.java:187)
      21:33:41  	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582)
      21:33:41  	at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:100)
      21:33:41  	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:310)
      21:33:41  	at hudson.model.ResourceController.execute(ResourceController.java:99)
      21:33:41  	at hudson.model.Executor.run(Executor.java:431)
      21:33:41  Finished: FAILURE

      Querying the current revision of branch without slashes in the name (e.g. master) causes no errors.

      Workaround: downgrade to Gitea Plugin version 1.2.1

       

          [JENKINS-67068] GiteaHttpStatusException: HTTP 404/Not Found by querying branches with slashes

          m l created issue -
          m l made changes -
          Priority Original: Minor [ 4 ] New: Major [ 3 ]
          m l made changes -
          Environment Original: Gitea Plugin 1.2.1
          Jenkins ver. 2.249.1
          Gitea 1.13.0
          New: Gitea Plugin 1.3.0
          Jenkins ver. 2.303.2
          Gitea 1.15.6
          m l made changes -
          Description Original: There are PRs which state in Gitea: "This pull request has changes conflicting with the target branch."

          As for all PRs also for these PRs the Gitea webhooks Jenkins and the build fails as expected. See attached log for the thrown exception.

          Additionally there is no possibility to catch the exception, since it is thrown within the default checkout stage and so there is no possibility to handle it better, e.g. by means of  build failure analyzer or a meaningful notification.

           

          *Expected Results*: Gitea does not trigger/webhook pull requests which have changes conflicting with the target branch. Or the Jenkins Gitea Plugin do recognize such webhooks and does not start a build. Both alternatives could be configurable.

           

          Maybe the API flag "mergeable" should be considered?
          New: After update of the Gitea Plugin form 1.2.1 to 1.3.0 following error occurs:
          {noformat}
          21:33:41 Started by upstream project "bla/ble/blu" build number 87
          21:33:41 originally caused by:
          21:33:41 Started by timer with parameters: {...}
          21:33:41 Querying the current revision of branch 6.6.5/release...
          21:33:41 org.jenkinsci.plugin.gitea.client.api.GiteaHttpStatusException: HTTP 404/Not Found
          21:33:41 at org.jenkinsci.plugin.gitea.client.impl.DefaultGiteaConnection.getObject(DefaultGiteaConnection.java:866)
          21:33:41 at org.jenkinsci.plugin.gitea.client.impl.DefaultGiteaConnection.fetchBranch(DefaultGiteaConnection.java:267)
          21:33:41 at org.jenkinsci.plugin.gitea.GiteaSCMSource.retrieve(GiteaSCMSource.java:187)
          21:33:41 at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582)
          21:33:41 at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:100)
          21:33:41 at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:310)
          21:33:41 at hudson.model.ResourceController.execute(ResourceController.java:99)
          21:33:41 at hudson.model.Executor.run(Executor.java:431)
          21:33:41 Finished: FAILURE{noformat}
          Querying the current revision of branch without slashes in the name (e.g. master) causes no errors.

          Workaround: downgrade to Gitea Plugin version 1.2.1

           
          Steven made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Fixed but Unreleased [ 10203 ]
          Steven made changes -
          Steven made changes -
          Released As New: https://github.com/jenkinsci/gitea-plugin/releases/tag/1.4.1
          Status Original: Fixed but Unreleased [ 10203 ] New: Resolved [ 5 ]

            Unassigned Unassigned
            mrlov m l
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: