Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 378632

Summary: Ant build step fails with JSONException on Windows slave
Product: Community Reporter: Tobias Oberlies <t-oberlies>
Component: CI-JenkinsAssignee: Eclipse Webmaster <webmaster>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Tobias Oberlies CLA 2012-05-07 05:14:48 EDT
It looks to me, as if there is something wrong with the setup of the Windows slave of hudson.eclipse.org. From the stack trace, I suppose that the slave is not able to find the configured Ant installation.

Stack trace:
FATAL: A JSONObject text must begin with '{' at character 0 of 
net.sf.json.JSONException: A JSONObject text must begin with '{' at character 0 of 
	at net.sf.json.util.JSONTokener.syntaxError(JSONTokener.java:499)
	at net.sf.json.JSONObject._fromJSONTokener(JSONObject.java:972)
	at net.sf.json.JSONObject._fromString(JSONObject.java:1201)
	at net.sf.json.JSONObject.fromObject(JSONObject.java:165)
	at net.sf.json.JSONObject.fromObject(JSONObject.java:134)
	at hudson.model.DownloadService$Downloadable.getData(DownloadService.java:197)
	at hudson.tools.DownloadFromUrlInstaller$DescriptorImpl.getInstallables(DownloadFromUrlInstaller.java:154)
	at hudson.tools.DownloadFromUrlInstaller.getInstallable(DownloadFromUrlInstaller.java:59)
	at hudson.tools.DownloadFromUrlInstaller.performInstallation(DownloadFromUrlInstaller.java:68)
	at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:61)
	at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:99)
	at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:149)
	at hudson.tasks.Ant$AntInstallation.forNode(Ant.java:380)
	at hudson.tasks.Ant.perform(Ant.java:149)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
	at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:630)
	at hudson.model.Build$RunnerImpl.build(Build.java:175)
	at hudson.model.Build$RunnerImpl.doRun(Build.java:137)
	at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:429)
	at hudson.model.Run.run(Run.java:1367)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
	at hudson.model.ResourceController.execute(ResourceController.java:88)
	at hudson.model.Executor.run(Executor.java:145)

Full log: https://hudson.eclipse.org/hudson/job/tycho-its-win-nightly/217/console
Comment 1 Denis Roy CLA 2012-05-07 15:26:52 EDT
I've placed the path to the ant installation in the PATH, logged off, logged back on and re-launched the slave, but your build still produces the same error.

It appears this started failing recently, yet Ant wasn't changed on the slave. How do you presume that this is an ant problem?
Comment 2 Tobias Oberlies CLA 2012-05-12 09:14:19 EDT
From the stack trace, it looks as if Hudson didn't even get to the point where it would execute our configured script, but rather already failed while trying to get the Ant runtime:
	at hudson.tasks.Ant$AntInstallation.forNode(Ant.java:380)
	at hudson.tasks.Ant.perform(Ant.java:149)

By now the problem seems to have disappeared. Do we know now that this can't happen again?

@Denis: Just out of curiosity: Are you on this problem alone, or do you get support by the Huson team?
Comment 3 Denis Roy CLA 2012-05-14 11:04:51 EDT
The Hudson teams provides assistance if we request it.  At this point, we'd need something reproducible.
Comment 4 Tobias Oberlies CLA 2012-05-21 10:11:06 EDT
(In reply to comment #3)
> The Hudson teams provides assistance if we request it.  At this point, we'd need
> something reproducible.
So since the problem fixed itself (however that happened...), I close this bug.
Comment 5 Tobias Oberlies CLA 2012-06-25 10:00:05 EDT
The problem is back: We are getting exactly the same stack trace again [1] - and this reliably for 1 day/5 builds [2].

[1] https://hudson.eclipse.org/hudson/job/tycho-its-win-nightly/265/console
[2] https://hudson.eclipse.org/hudson/job/tycho-its-win-nightly/261/console
Comment 6 Denis Roy CLA 2012-06-25 16:10:45 EDT
Can you provide more info about what the JSON payload is, and where it comes from?
Comment 7 Tobias Oberlies CLA 2012-06-26 11:00:04 EDT
Am I supposed to know how the Ant command is marshalled to the Windows slave? 

The job configuration [1] simply has an "Invoke ANT" build step with the build file $WORKSPACE/prepareBuild.xml

But as before, the problem disappeared in the meanwhile (since build 266 [2]).


[1] https://hudson.eclipse.org/hudson/job/tycho-its-win-nightly/configure
[2] https://hudson.eclipse.org/hudson/job/tycho-its-win-nightly/266/console
Comment 8 Denis Roy CLA 2012-06-27 15:05:49 EDT
> Am I supposed to know how the Ant command is marshalled to the Windows slave? 

I don't know -- I don't know how your build works, so I'm just wondering what JSON is causing it to explode.

You've chosen "auto install Ant 1.7.1" -- have you tried simply using the ant 1.7.1 that is already in the available choices?
Comment 9 Tobias Oberlies CLA 2012-07-13 07:58:12 EDT
(In reply to comment #8)
> You've chosen "auto install Ant 1.7.1" -- have you tried simply using the ant
> 1.7.1 that is already in the available choices?
We just need any Ant version - so if we are supposed to use "ant 1.7.1", that is fine with us.

Unfortunately this makes things worse [1]. The build now fails with the message 
FATAL: Cannot find executable from the choosen Ant installation "apache-ant-1.7.1"

"(Default)" as Ant Version works. Can you recommended this setting?

[1] https://hudson.eclipse.org/hudson/job/tycho-its-win-nightly/277/console
Comment 10 Eclipse Webmaster CLA 2012-07-13 14:11:55 EDT
Use the Ant 1.8.3, as that's the only version installed on the Windows slave.

-M.
Comment 11 Tobias Oberlies CLA 2012-07-18 11:45:22 EDT
1.8.3 is not offered in the dropdown list, the highest version number is 1.8.2.
Comment 12 Eclipse Webmaster CLA 2012-07-18 15:12:02 EDT
Sorry I need to read the labels on the slave config page.  On the windows slave Ant 1.8.2 is mapped to a local install of Ant 1.8.3.

-M.
Comment 13 Eclipse Genie CLA 2014-11-09 19:40:10 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 14 Tobias Oberlies CLA 2014-11-21 11:07:25 EST
(In reply to comment #13)
> or that the bug is (for whatever reason) no longer relevant.
Closing.