Skip to content

[JENKINS-6025] Adding two copyartifact build steps to a project at the same time causes a JSONException #19450

Closed

Description

@jenkins-infra-bot

Steps to reproduce:

1. Configure an existing project and add a build step to copy artifacts from another project
2. Enter the project name to copy artifacts from
*3. Leaving all other fields blank enter a path as the value in the "Target directory" field e.g. "cb20_cfDesignServlet\WEB-INF\lib" without the quotes
4. Now add an additional copy artifacts build step and enter another project to copy artifacts from.
*5. Enter the same value as previously for Target directory i.e. "cb20_cfDesignServlet\WEB-INF\lib"
6. Click Save

*It seems immaterial whether a Target directory is specified or not.

The following exception is encountered:

net.sf.json.JSONException: A JSONObject text must begin with '{' at character 1 of init
net.sf.json.util.JSONTokener.syntaxError(JSONTokener.java:512)
net.sf.json.JSONObject._fromJSONTokener(JSONObject.java:839)
net.sf.json.JSONObject._fromString(JSONObject.java:1060)
net.sf.json.JSONObject.fromObject(JSONObject.java:176)
net.sf.json.JSONObject.fromObject(JSONObject.java:147)
org.kohsuke.stapler.RequestImpl.getSubmittedForm(RequestImpl.java:711)
hudson.model.Job.doConfigSubmit(Job.java:1026)
hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:551)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:169)
org.kohsuke.stapler.Function.bindAndInvoke(Function.java:101)
org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:54)
org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:74)
org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
org.kohsuke.stapler.Stapler.invoke(Stapler.java:519)
org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:180)
org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
org.kohsuke.stapler.Stapler.invoke(Stapler.java:519)
org.kohsuke.stapler.Stapler.invoke(Stapler.java:435)
org.kohsuke.stapler.Stapler.service(Stapler.java:123)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94)
hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:86)
hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:78)
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66)
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

Workaround:

Add copy-artifact build steps one at a time.


Originally reported by hand_of_henry, imported from: Adding two copyartifact build steps to a project at the same time causes a JSONException
  • assignee: mindless
  • status: Closed
  • priority: Major
  • component(s): copyartifact-plugin, core
  • resolution: Fixed
  • resolved: 2010-04-06T09:43:45+00:00
  • votes: 0
  • watchers: 0
  • imported: 2025-11-24
Raw content of original issue

Steps to reproduce:

1. Configure an existing project and add a build step to copy artifacts from another project 2. Enter the project name to copy artifacts from *3. Leaving all other fields blank enter a path as the value in the "Target directory" field e.g. "cb20_cfDesignServlet\WEB-INF\lib" without the quotes 4. Now add an additional copy artifacts build step and enter another project to copy artifacts from. *5. Enter the same value as previously for Target directory i.e. "cb20_cfDesignServlet\WEB-INF\lib" 6. Click Save

*It seems immaterial whether a Target directory is specified or not.

The following exception is encountered:

net.sf.json.JSONException: A JSONObject text must begin with '{' at character 1 of init net.sf.json.util.JSONTokener.syntaxError(JSONTokener.java:512) net.sf.json.JSONObject._fromJSONTokener(JSONObject.java:839) net.sf.json.JSONObject._fromString(JSONObject.java:1060) net.sf.json.JSONObject.fromObject(JSONObject.java:176) net.sf.json.JSONObject.fromObject(JSONObject.java:147) org.kohsuke.stapler.RequestImpl.getSubmittedForm(RequestImpl.java:711) hudson.model.Job.doConfigSubmit(Job.java:1026) hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:551) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:169) org.kohsuke.stapler.Function.bindAndInvoke(Function.java:101) org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:54) org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:74) org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30) org.kohsuke.stapler.Stapler.invoke(Stapler.java:519) org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:180) org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30) org.kohsuke.stapler.Stapler.invoke(Stapler.java:519) org.kohsuke.stapler.Stapler.invoke(Stapler.java:435) org.kohsuke.stapler.Stapler.service(Stapler.java:123) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94) hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:86) hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:78) hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84) hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51) hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166) hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173) hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66) hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76) hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

Workaround:

Add copy-artifact build steps one at a time.

environment
Hudson version: 1.352<br/>
CopyArtifact Plugin Version: 1.1<br/>
Hudson on JBOSS 4.2/Windows XP

Activity

  1. jenkins-infra-bot commented on Mar 22, 2010

    @jenkins-infra-bot
    Author
    mindless:
    • Original comment link
    • Raw content of original comment:

      It also seems to work fine if you first add 2 build steps, then fill in the details for both.. fails if you fill in the first one, then add the 2nd one.

    It also seems to work fine if you first add 2 build steps, then fill in the details for both.. fails if you fill in the first one, then add the 2nd one.

  2. jenkins-infra-bot commented on Mar 22, 2010

    @jenkins-infra-bot
    Author
    mindless:
    • Original comment link
    • Raw content of original comment:

      Actually, not sure if that's what triggered success vs failure.. what I did notice on the failure was the pre-processing that Hudson does before form submission was skipped.

    Actually, not sure if that's what triggered success vs failure.. what I did notice on the failure was the pre-processing that Hudson does before form submission was skipped.

  3. jenkins-infra-bot commented on Mar 23, 2010

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Original comment link
    • Raw content of original comment:

      Code changed in hudson User: : mindless Path: trunk/hudson/main/war/resources/scripts/combobox.js trunk/www/changelog.html http://jenkins-ci.org/commit/29149 Log: [FIXED JENKINS-6025] simplify form.onsubmit handling with combobox. 1) in onblur handler, simply restore old form.onsubmit rather than adding another wrapper to call the old handler (which can result in a deep call stack if several comboboxes are used prior to form submission). 2) in onsubmit handler when focused, only call the original onsubmit when the dropdown is not showing (ie don't call it when we intercept the submit to just select an item from the list and return false) I didn't figure out exactly why, but the current code could result in the original form.onsubmit handler not being called on form submission when multiple comboboxes are used. This simplification seems to resolve the issue.

    Code changed in hudson
    User: : mindless
    Path:
    trunk/hudson/main/war/resources/scripts/combobox.js
    trunk/www/changelog.html
    http://jenkins-ci.org/commit/29149
    Log:
    [FIXED JENKINS-6025] simplify form.onsubmit handling with combobox.
    1) in onblur handler, simply restore old form.onsubmit rather than adding
    another wrapper to call the old handler (which can result in a deep call
    stack if several comboboxes are used prior to form submission).
    2) in onsubmit handler when focused, only call the original onsubmit when
    the dropdown is not showing (ie don't call it when we intercept the submit
    to just select an item from the list and return false)
    I didn't figure out exactly why, but the current code could result in the
    original form.onsubmit handler not being called on form submission when
    multiple comboboxes are used. This simplification seems to resolve the issue.

  4. jenkins-infra-bot commented on Mar 23, 2010

    @jenkins-infra-bot
    Author
    mindless:
    • Original comment link
    • Raw content of original comment:

      This should work better now when the plugin is used with Hudson 1.353 or newer.

    This should work better now when the plugin is used with Hudson 1.353 or newer.

  5. jenkins-infra-bot commented on Apr 6, 2010

    @jenkins-infra-bot
    Author
    hand_of_henry:
    • Original comment link
    • Raw content of original comment:

      Tested this in version 1.353 using the initial test case outlined above and this is still seems to be an issue.

      I verified that version 1.353 was being run.

      (also, with regards to process, should I be the person to verify the issue once fixed?)

    Tested this in version 1.353 using the initial test case outlined above and this is still seems to be an issue.

    I verified that version 1.353 was being run.

    (also, with regards to process, should I be the person to verify the issue once fixed?)

  6. jenkins-infra-bot commented on Apr 6, 2010

    @jenkins-infra-bot
    Author
    mindless:
    • Original comment link
    • Raw content of original comment:

      please clear all browser caches to ensure the 1.353 javascript files are used. what browser type/version are you using, and please post any javascript errors you see.

      process: often times issue submitters don't come back to enter "verified", but yes you are welcome to do so once the issue is fixed.

    please clear all browser caches to ensure the 1.353 javascript files are used. what browser type/version are you using, and please post any javascript errors you see.

    process: often times issue submitters don't come back to enter "verified", but yes you are welcome to do so once the issue is fixed.

  7. jenkins-infra-bot commented on Apr 6, 2010

    @jenkins-infra-bot
    Author
    hand_of_henry:
    • Original comment link
    • Raw content of original comment:

      Yep, it was my cache. A tad embarrassing. Thanks.

    Yep, it was my cache. A tad embarrassing. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions