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

Handling of session id for work with CSRF in Parameterzied Remote Trigger resets after restart of Jenkins

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • None
    • Jenkins v2.346.1
      Parameterized-remote-trigger-plugin v3.1.5.1

      Hello colleagues!

      We are using Parameterized-remote-trigger-plugin (v3.1.5.1) to trigger the job on a remote Jenkins server. Recently we have updated this remote server to Jenkins v2.346.1, so now CSRF protection is always enabled there.

      We are facing this issue:

      After restart of Jenkins instance, where Parameterized-remote-trigger is installed build fails with the following exception:

       

      CSRF protection is enabled on the remote server.
      ERROR: Remote build failed with 'ExceedRetryLimitException' for the following reason: 'Max number of connection retries have been exeeded.'.
      ERROR: ExceedRetryLimitException: Max number of connection retries have been exeeded.
      Finished: FAILURE 

      But after saving the job with configured Parameterized-remote-trigger everything works fine.

      We've done some research and figured out that this happens, because after restart of Jenkins (where Parameterized-remote-trigger is installed) the plugin stops working with cookies (session id) required to be provided with crumb.

      But after saving the job - DataBoundConstructor is called and CookieHandler is set properly again - https://github.com/jenkinsci/parameterized-remote-trigger-plugin/blob/Parameterized-Remote-Trigger-3.1.5.1/src/main/java/org/jenkinsci/plugins/ParameterizedRemoteTrigger/RemoteBuildConfiguration.java#L148

       

      Looks like it's a wrong behaviour and may be section with initialization of CookieHandler should be placed somewhere else, for example in perform section of the plugin. But may be the problem could be in our environment.

      Could you please help us with this problem?

            cashlalala KaiHsiang Chang
            visclaus Kirill Kovalev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: