after upgrading to 2.462.2 we are experiencing issues with Jenkins Plain Credentials Plugin. I read in the upgrade guide that the Apache Commons FileUpload library was upgraded from 1.5 to 2.0 which means that some of the classes used by FileCredentialsImpl in the credentials plugin like org.apache.commons.fileupload.FileItem or org.apache.commons.fileupload.disk.DiskFileItemFactory cannot be found anymore because they are moved to an other package. FileCredentialsImpl uses org.apache.commons.fileupload.FileItem in it’s constructor.
Are you planning to upgrade the credentials plugin?
As far as all the reports and experience with ci.jenkins.io, the most recent releases of the credentials plugin work very well with Jenkins 2.462.2. You’ll need to provide more details of the failure you’re seeing and the configuration that is showing the failure.
Have you upgraded your plugins? If not, do that and check if the issue is resolved.
Plain credentials plugin 182.v468b_97b_9dcb_8 was released in May 2024 with specific improvements for compatibility with FileUpload 2.
I have the latest version of the plain credentials plugin.
My issue is that the constructor of FileCredentialsImpl expects org.apache.commons.fileupload.disk.DiskFileItem but jenkins is unable to resolve any of the classes from the old package e.g org.apache.commons.fileupload.disk.DiskFileItem.
I can’t duplicate the problem that you’re describing. Steps that I took while trying to duplicate the problem included:
Create a plugins.txt file that defines the plugins being used (contents are below)
Create a run-jenkins.sh file that downloads Jenkins and the requested plugins and runs
Run the run-jenkins.sh file and complete the setup wizard by creating a user and choosing to install no addfitional plugins (since the plugins.txt file provides them all)
Define a new credential that uses a secret file and save it, confirm no errors are reported
Update the secret file credential, save it, and confirm no errors are reported
Sorry, I forgot to mention that I’m executing a system groovy script where I’m importing the classes from the libraries and adding the credentials programmatically. So I’m not using the UI to add the credentials.
I’m using FileCredentialsImpl class where the 4th parameter in the constructor has the type org.apache.commons.fileupload.FileItem but this class cannot be resolved by Jenkins anymore. So I was wondering if you will also update FileCredentialsImpl to use org.apache.commons.fileupload2.core.FileItem instead.
def credential = new FileCredentialsImpl(CredentialsScope.GLOBAL, id, description, fileItem, filename, data)
I have no issues when I use the UI to add credentials.
It looks like you’re using the constructor from the plain credentials plugin that is intended for use by Stapler. I think that you’ll need to use the constructor that is intended for use by all the other cases.