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

BaseStandardCredentials ID validation error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • credentials-plugin
    • None
    • 2.6

      There is an issue in the way `BaseStandardCredentials` ID validation is implemented. It uses a legacy validation method which does not work when the credentials form is rendered with `dropdownDescriptorSelector`.

      Effect shows up differently in older Jenkins versions and newer ones, but the underlying issue is the same.

      In older cores (2.277.1 or older) an ERROR link is rendered:

      And a `NullPoinerException` is thrown at backend side because the validation HTTP call is missing the expected parameter value (JS is not able to find it).

      2021-09-01 10:13:11.640+0000 [id=20]	WARNING	h.i.i.InstallUncaughtExceptionHandler#handleException: Caught unhandled exception with ID 6e6ecd1c-191a-41dd-9b58-ba14753a350a
      java.lang.NullPointerException
      	at com.cloudbees.plugins.credentials.impl.BaseStandardCredentials$BaseStandardCredentialsDescriptor.doCheckId(BaseStandardCredentials.java:198)
      	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
      	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396)
      	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:408)
      	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:212)
      	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:145)
      	at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:536)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:766)
      

      After 2.277 (ie. 2.289.1, only tried with LTS) there is a recursive page rendering (for some reason the ERROR link is rendered as an entire page. Didn't look at what changed in core because it's basically irrelevant for the issue at hand):

            amuniz Antonio Muñiz
            amuniz Antonio Muñiz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: