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

Splunk Plugin double encoding special characters

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I make use of the Bitbucket team project plugin for Jenkins and that plugin creates jobs in the format of

      job/<BB-PROJECT>/job/<bb-repo>/job/<branch-name>

      So for example:

      job/FOO/job/bar/job/master

      However, when a / exists in the branch name (for example, feature/test), we get something along the lines of

      job/FOO/job/bar/job/feature%2Fbb-test

      Now, this is totally fine, as it's just encoding the /, however when it gets sent over to Splunk the source appears as

      job/FOO/job/bar/job/feature%252Ftest

      So the % sign seems to be doubly encoded and instead of feature%2Fbb-test we get feature%252Ftest.

      This causes a downstream impact where the Splunk App for Jenkins can't find the console logs (despite them existing) for any job where there is a / in the job name.

      Other Info:
      Jenkins Version: 2.222.4
      Splunk Plugin Version: 1.9.4
      Jenkins is running in a container on OpenShift

        Attachments

          Activity

          Hide
          jhoenzsch Josef Hoenzsch added a comment -

          Thank you Ted Xiao I will try upgrading from version 1.0.7 to version 1.0.9. To be clear, I have not tried the 2.x version, do you know if that one is definitely broken too?

          Show
          jhoenzsch Josef Hoenzsch added a comment - Thank you Ted Xiao I will try upgrading from version 1.0.7 to version 1.0.9. To be clear, I have not tried the 2.x version, do you know if that one is definitely broken too?
          Hide
          fengxx Ted Xiao added a comment - - edited

          splunk_app_jenkins-1.0.9-0.tar.gz use at your own risk and please backup your settings/apps before install
          hopefully 2.x version will get fixed soon

          Show
          fengxx Ted Xiao added a comment - - edited splunk_app_jenkins-1.0.9-0.tar.gz use at your own risk and please backup your settings/apps before install hopefully 2.x version will get fixed soon
          Hide
          jhoenzsch Josef Hoenzsch added a comment -

          Ted Xiao Thank you for your response. We are on version 1.0.7 of the Splunk App for Jenkins and it definitely is not pulling up build logs for any branch that has a / in it. May I ask what version of the Splunk App for Jenkins you have found doesn't have this issue?

          Show
          jhoenzsch Josef Hoenzsch added a comment - Ted Xiao Thank you for your response. We are on version 1.0.7 of the Splunk App for Jenkins and it definitely is not pulling up build logs for any branch that has a / in it. May I ask what version of the Splunk App for Jenkins you have found doesn't have this issue?
          Hide
          fengxx Ted Xiao added a comment -

          mark as won't fix since the bugfix need be in splunk app

          Show
          fengxx Ted Xiao added a comment - mark as won't fix since the bugfix need be in splunk app
          Hide
          fengxx Ted Xiao added a comment -

          It is actually Jenkins internal encoding logic (Run.getURL()) for browser access, you can paste the encoded URL to browser to get the full log, such as

          index=jenkins_console 
          | eval url="https://".host."/".source 
          | stats values(url)
          

          not only /, other chars like white space are also encoded, e.g. My CLI => My%20CLI

          I think Splunk App for Jenkins 1.x works fine for such cases, the display bug probably introduced in recent versions.

          Show
          fengxx Ted Xiao added a comment - It is actually Jenkins internal encoding logic (Run.getURL()) for browser access, you can paste the encoded URL to browser to get the full log, such as index=jenkins_console | eval url= "https: //" .host. "/" .source | stats values(url) not only /, other chars like white space are also encoded, e.g. My CLI => My%20CLI I think Splunk App for Jenkins 1.x works fine for such cases, the display bug probably introduced in recent versions.

            People

            Assignee:
            fengxx Ted Xiao
            Reporter:
            jhoenzsch Josef Hoenzsch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: