Disable installation of launchd service on OS X slaves?

75 views
Skip to first unread message

Alex Rønne Petersen

unread,
Oct 27, 2012, 8:30:55 PM10/27/12
to jenkins...@googlegroups.com
Hi folks,

From the 1.487 changelog:

* JNLP Slave agent on OS X can install itself as a launchd service.

I believe this is the cause of the exceptions I'm now seeing when my
master node attempts to connect to an OS X slave:

java.io.IOException: Remote call on osx-x86 failed
        at hudson.remoting.Channel.call(Channel.java:673)
        at org.jenkinsci.modules.launchd_slave_installer.ComputerListenerImpl.onOnline(ComputerListenerImpl.java:30)
        at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:396)
        at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:317)
        at hudson.plugins.sshslaves.SSHLauncher.startSlave(SSHLauncher.java:454)
        at hudson.plugins.sshslaves.SSHLauncher.launch(SSHLauncher.java:293)
        at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:200)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:679)
Caused by: java.lang.InternalError: Can't connect to window server -
not enough permissions.
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1827)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1724)
        at java.lang.Runtime.loadLibrary0(Runtime.java:823)
        at java.lang.System.loadLibrary(System.java:1045)
        at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38)
        at sun.awt.DebugHelper.<clinit>(DebugHelper.java:29)
        at java.awt.Component.<clinit>(Component.java:566)
        at org.jenkinsci.modules.launchd_slave_installer.LaunchdSlaveInstaller.call(LaunchdSlaveInstaller.java:53)
        at org.jenkinsci.modules.launchd_slave_installer.LaunchdSlaveInstaller.call(LaunchdSlaveInstaller.java:35)
        at hudson.remoting.UserRequest.perform(UserRequest.java:118)
        at hudson.remoting.UserRequest.perform(UserRequest.java:48)
        at hudson.remoting.Request$2.run(Request.java:326)
        at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:680)
[10/27/12 20:47:14] [SSH] Connection closed.
ERROR: Connection terminated
java.io.IOException: Unexpected termination of the channel
        at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:50)
Caused by: java.io.EOFException
        at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2570)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1314)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:368)
        at hudson.remoting.Command.readFrom(Command.java:90)
        at hudson.remoting.ClassicCommandTransport.read(ClassicCommandTransport.java:59)
        at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:48)
ERROR: [10/27/12 20:47:14] slave agent was terminated
java.io.IOException: Unexpected termination of the channel
        at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:50)
Caused by: java.io.EOFException
        at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2570)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1314)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:368)
        at hudson.remoting.Command.readFrom(Command.java:90)
        at hudson.remoting.ClassicCommandTransport.read(ClassicCommandTransport.java:59)
        at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:48)

Can I somehow disable this? I don't want it to be installed as a
launchd service and, as seen in the exception stack trace, it can't
actually start the installer. The machine is not a regular OS X
machine but an Xserve, so this GUI business is a bad idea.

Thanks in advance,
Alex

cl

unread,
Oct 30, 2012, 10:13:34 AM10/30/12
to jenkins...@googlegroups.com
I have the exact same problem on a standard OS X Mac Mini.

Tried installing an X11 Server, but it didn't help.

If you find a way to fix this, please let us know. I'm sure others are having the same problem. :)

Kenny Ayers

unread,
Oct 30, 2012, 11:50:22 PM10/30/12
to jenkins...@googlegroups.com
Hi.  Java is attempting to connect to X or whatever and is puking because it doesn't have sufficient permissions.  Here's a fix:

Jenkins > Manage Jenkins > Manage Nodes > (select the node with the error) > Configure > Launch Method: "Launch slave agents on Unix machines via SSH" > click "Advanced" then under "JVM Options" include the java directive to run headless: -Djava.awt.headless=true

Alex Rønne Petersen

unread,
Nov 1, 2012, 11:34:55 AM11/1/12
to jenkins...@googlegroups.com
That worked, thanks!

I've filed an issue because

1) The new behavior breaks a previously perfectly working setup;
2) The new behavior is counter-intuitive (I wouldn't expect an SSH slave to try to set up JNLP);
3) There's no obvious option in the UI to disable this behavior.

Reply all
Reply to author
Forward
0 new messages