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

Text ERROR and HTTP 404 when validating input parameter

XMLWordPrintable

    • Validating String Parameter Plugin 2.7

      The following pipeline shows an ERROR link instead of showing the configured error message.

      stage('Input stage') {
          def res = input(
              parameters: [[
                  $class: 'ValidatingStringParameterDefinition',
                  name: 'param1',
                  failedValidationMessage: 'Input must be a number', 
                  regex: '[0-9]+'
              ]]
          )
      
          println res
      }
      

      Works with version 2.3 of the plugin. Reproducible with Jenkins 2.89.4 and 2.138.1.

      Commit: https://github.com/jenkinsci/validating-string-parameter-plugin/commit/9caac7b713976af9363cd944f89cadd44fbb4652#diff-12cb1c400787ab164b54d0ef8d0cbda9

      The problem seems to be the relative URL. The base path for the input form is /job/<JOB_NAME>/<BUILD_NUMBER>/input/ so the href descriptorByName/hudson.plugins.validating_string_parameter.ValidatingStringParameterDefinition/validate is not available.

            raihaan Raihaan Shouhell
            jl68 Jonas Lindström
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: