Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no default value causes remote jobs to fail #26

Closed
jmatzdorff-cpi opened this issue Feb 15, 2021 · 4 comments · Fixed by #31
Closed

no default value causes remote jobs to fail #26

jmatzdorff-cpi opened this issue Feb 15, 2021 · 4 comments · Fixed by #31
Assignees

Comments

@jmatzdorff-cpi
Copy link

not sure how out-of-the-box this is, but i am using this to have an "optional" file to pass in (a user can pass in a file, or all the parameters can be filled out when the job is executed). i use this mainly for an remote jenkins server to call this job (in this way, the calling jenkins server does not pass in a base64file)

in essence, in my job, the base64file is optional to pass in. and this works fine when calling it locally from the GUI (I don't have to choose a file). however, when the job is called via the remote jenkins server (remoteTrigger) it seems that the job is (in essence) requiring the file, as the jenkins server logs show:

2021-02-15 08:02:22.540+0000 [id=1546]	WARNING	h.i.i.InstallUncaughtExceptionHandler#handleException: Caught unhandled exception with ID 9a702ccb-ee2e-4156-8cc6-a60f0a393d72
org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is application/x-www-form-urlencoded

this same job works fine being called from the remoteTrigger if the base64file parameter isn't part of the config.

i am unsure if this is a jenkins issue or this plugin issue, but figured i would start here since the job will in fact launch fine w/o this file-parameter.

@jglick
Copy link
Member

jglick commented Feb 17, 2021

Not sure what remoteTrigger is.

@jmatzdorff-cpi
Copy link
Author

it's a pipeline command that allows you to trigger a remote jenkins job (a different jenkins server).

https://plugins.jenkins.io/Parameterized-Remote-Trigger/

@jglick
Copy link
Member

jglick commented Feb 17, 2021

Never used that plugin. Also the issue description does not include a stack trace, or any indication of exactly how the upstream and downstream jobs are configured (such as Pipeline script text). Please provide complete, minimal steps to reproduce from scratch.

@jglick jglick self-assigned this Mar 1, 2021
@jglick
Copy link
Member

jglick commented Mar 1, 2021

org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is application/x-www-form-urlencoded
	at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:948)
	at org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:310)
	at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:334)
	at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:115)
	at org.kohsuke.stapler.RequestImpl.parseMultipartFormData(RequestImpl.java:965)
	at org.kohsuke.stapler.RequestImpl.getFileItem(RequestImpl.java:1043)
	at io.jenkins.plugins.file_parameters.AbstractFileParameterDefinition.createValue(AbstractFileParameterDefinition.java:81)
	at io.jenkins.plugins.file_parameters.Base64FileParameterDefinition.createValue(Base64FileParameterDefinition.java:34)
	at hudson.model.ParametersDefinitionProperty.buildWithParameters(ParametersDefinitionProperty.java:182)
	at jenkins.model.ParameterizedJobMixIn.doBuildWithParameters(ParameterizedJobMixIn.java:236)
	at jenkins.model.ParameterizedJobMixIn$ParameterizedJob.doBuildWithParameters(ParameterizedJobMixIn.java:416)
	at …
Caused: javax.servlet.ServletException
	at org.kohsuke.stapler.RequestImpl.parseMultipartFormData(RequestImpl.java:972)
	at org.kohsuke.stapler.RequestImpl.getFileItem(RequestImpl.java:1043)
	at io.jenkins.plugins.file_parameters.AbstractFileParameterDefinition.createValue(AbstractFileParameterDefinition.java:81)
Caused: java.lang.RuntimeException
	at io.jenkins.plugins.file_parameters.AbstractFileParameterDefinition.createValue(AbstractFileParameterDefinition.java:94)
	at io.jenkins.plugins.file_parameters.Base64FileParameterDefinition.createValue(Base64FileParameterDefinition.java:34)
	at hudson.model.ParametersDefinitionProperty.buildWithParameters(ParametersDefinitionProperty.java:182)
	at jenkins.model.ParameterizedJobMixIn.doBuildWithParameters(ParameterizedJobMixIn.java:236)
	at jenkins.model.ParameterizedJobMixIn$ParameterizedJob.doBuildWithParameters(ParameterizedJobMixIn.java:416)
	at …

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants