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

Bug 313722

Summary: signing fails on build2
Product: Community Reporter: Nicolas Bros <nicolas.bros>
Component: ServersAssignee: Eclipse Webmaster <webmaster>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: stepper, thomas
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Nicolas Bros CLA 2010-05-20 09:21:26 EDT
My build (which uses Dash Athena CBI), fails signing on build2, with the error:

/opt/users/hudsonbuild/workspace/cbi-modisco-integration/build/org.eclipse.dash.common.releng/tools/scripts/buildAllHelper.xml:551: Execute failed: java.io.IOException: java.io.IOException: /usr/bin/sign: cannot execute

I think this might be because users "hudson" or "dashBuild" don't have the right to run /usr/bin/sign.
Comment 1 Denis Roy CLA 2010-05-20 15:25:37 EDT
I've put the signing tools on build2... Can you please verify?

Thanks for testing out our new build server!
Comment 2 Nicolas Bros CLA 2010-05-21 03:46:29 EDT
I tried again, and I still have this error when trying to build on build2:
java.io.IOException: /usr/bin/sign: cannot execute
Comment 3 Eclipse Webmaster CLA 2010-05-21 09:46:08 EDT
Looks like the hudsonbuild user didn't have execute permission. Fixed.

-M.
Comment 4 Nicolas Bros CLA 2010-05-21 10:17:16 EDT
It didn't seem to change anything: I still have the exact same error in my build.

I see in /org.eclipse.dash.common.releng/tools/scripts/buildAllHelper.xml:
<!-- user with write perms in staging dir & permission to run /usr/bin/sign -->
<property name="buildServerUser" value="dashBuild@build.eclipse.org" />

So I think the user that needs to have the execute permission is "dashBuild".

Could you add it?
Comment 5 Eclipse Webmaster CLA 2010-05-21 10:27:59 EDT
Done.

-M.
Comment 6 Nicolas Bros CLA 2010-05-21 11:41:10 EDT
I still have the same error :(
Though I have no idea what could still be wrong now.
Comment 7 Eclipse Webmaster CLA 2010-05-21 14:05:39 EDT
Hmmmm, I think the issue may have been that the dasBuild user couldn't actually write to the signing queue.  I've fixed that.

-M.
Comment 8 Nicolas Bros CLA 2010-05-25 07:47:33 EDT
I am currently blocked by bug 314011, so I can't do further testing.
Comment 9 Eike Stepper CLA 2010-05-25 10:13:29 EDT
I just tried again andf it still fails:

https://build.eclipse.org/hudson/job/emf-cdo-integration/480/console
Comment 10 Eclipse Webmaster CLA 2010-05-25 10:33:52 EDT
Eike, what can you tell me about the environment(user,paths, etc) your ant script is running in?  

Can both/either of you dump the signing command line the builds are creating, so I can try and manually run them?

-M.
Comment 11 Eike Stepper CLA 2010-05-25 10:46:06 EDT
(In reply to comment #10)
> Eike, what can you tell me about the environment(user,paths, etc) your ant
> script is running in?  
> 
> Can both/either of you dump the signing command line the builds are creating,
> so I can try and manually run them?

I fear I can not. From the stack trace it looks as if Buckminster does do that. CC'ing Thomas, maybe he has more infos...
Comment 12 Nicolas Bros CLA 2010-05-25 11:51:33 EDT
> Can both/either of you dump the signing command line the builds are creating,
> so I can try and manually run them?

If you want to see how Dash Athena CBI does signing, you can look in:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.dash.common.releng/tools/scripts/buildAllHelper.xml?root=Technology_Project&view=markup

(look for "signMasterZip")

By the way, I was wrong earlier: this is not user dashBuild that is used for signing (my log says "signing on localhost"), so this must be user "hudsonbuild" that must have the signing (and write) rights.
Comment 13 Eclipse Webmaster CLA 2010-05-25 15:08:53 EDT
Well, in looking at the signing log I generated a command line for emf-cdo-integration:

hudsonbuild@build2:> /usr/bin/sign /opt/users/hudsonbuild/.hudson/jobs/emf-cdo-integration/signing/site_659409442.zip nomail testhudson/tmp

And I can see the job enter the sign queue and get processed(although it fails):

2010-05-25 14:44:01: build2 QUEUE(25522): calling jarprocessor.jar for /opt/users/hudsonbuild/.hudson/jobs/emf-cdo-integration/signing/site_659409442.zip
Processing /opt/users/hudsonbuild/.hudson/jobs/emf-cdo-integration/signing/site_659409442.zip
java.io.FileNotFoundException: /opt/users/hudsonbuild/.hudson/jobs/emf-cdo-integration/signing/testhudson/tmp/site_659409442.zip.temp (Permission denied)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
        at org.eclipse.update.internal.jarprocessor.ZipProcessor.processZip(ZipProcessor.java:95)
        at org.eclipse.update.internal.jarprocessor.Main.runJarProcessor(Main.java:124)
        at org.eclipse.update.internal.jarprocessor.Main.main(Main.java:184)
2010-05-25 14:44:01: build2 QUEUE(25522): Finished processing queue.

So the hudsonbuild user has the rights to run the sign script. 

-M.
Comment 14 Eike Stepper CLA 2010-05-27 02:11:42 EDT
Denis, thanks for the investigation. But I'm not sure I understand. Does that mean you're out of the loop now and nobody else is currently trying to fix this?

Am I the only one with this problem on build2?
Comment 15 Nicolas Bros CLA 2010-05-27 03:20:19 EDT
(In reply to comment #14)
> Am I the only one with this problem on build2?
I still have this error as well, so I have switched my integration build to master for now.
Comment 16 Denis Roy CLA 2010-05-27 08:49:21 EDT
The signing process was hacked and kludged to allow integrated signing from Hudson.  Unfortunately, this means every hack and kludge needs to be repeated on every Hudson slave machine we'll ever set up.

In this case, genie (the signer) couldn't write to the hudson user directory.  I've set the ownership and permissions to match those of the master build server (hudsonbuild.callisto-dev).

I have no further reason to believe your signing process will fail, but I'll let you close this as fixed once you've confirmed it does work.
Comment 17 Eike Stepper CLA 2010-05-27 11:35:22 EDT
It does not work: https://build.eclipse.org/hudson/job/emf-cdo-integration/495/console ;-(
Comment 18 Denis Roy CLA 2010-05-27 11:56:29 EDT
hudsonbuild@build2:~> /usr/bin/sign

Usage: /usr/bin/sign <file> <mail|nomail> [outputDir]
Signs JAR or ZIP file <file>, placing the resulting file in optional [outputDir] and mails notification that signing is complete, if requeste


As you can see, the file is perfectly executable from the hudson build user account.

After a bit of Googling, seems this is a 13 year old bug with the Sun JDK.  Wow.

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4052517

Sooooo...   I've set the /usr/bin/sign script's ownership to hudsonbuild.users to see if that will make it happy.
Comment 19 Eike Stepper CLA 2010-05-27 13:29:54 EDT
Looks a little bit different now, but failed: https://build.eclipse.org/hudson/job/emf-cdo-integration/497/console
Comment 20 Denis Roy CLA 2010-05-27 13:53:34 EDT
lol

*kludge*  *kludge*

Of course hudsonbuild cannot open file created by the signing process...  Although it can on build.

*kludge*  *kludge*  ACL  :)

I'm feeling lucky now!
Comment 21 Eike Stepper CLA 2010-05-28 02:19:18 EDT
Hurray!!! It's working now ;-)

https://build.eclipse.org/hudson/job/emf-cdo-integration/499/console

Thank you Denis!
Comment 22 Nicolas Bros CLA 2010-06-03 05:11:59 EDT
Now that build2 works again, I tried an integration build on build2.

It still does not work for me:

/opt/users/hudsonbuild/workspace/cbi-modisco-integration/build/org.eclipse.dash.common.releng/tools/scripts/buildAllHelper.xml:653: Failed to copy /opt/users/hudsonbuild/workspace/cbi-modisco-integration/build/signing/I201006030431-out/MODISCO-Master-I201006030431.zip to /opt/users/hudsonbuild/workspace/cbi-modisco-integration/build/I201006030431/eclipse/I201006030431/MODISCO-Master-I201006030431.zip due to java.io.FileNotFoundException /opt/users/hudsonbuild/workspace/cbi-modisco-integration/build/signing/I201006030431-out/MODISCO-Master-I201006030431.zip (Permission denied)
Comment 23 Denis Roy CLA 2010-06-03 10:17:20 EDT
The permissions denied error is because the files in your workspace are not group-writable.  I will fix the permissions in the workspace, but you should find a way to ensure the files and directories are always group writable.