You're experiencing at least two issues here.  First there's the OSX bug 
with your window manager permissions.  You need to run headless on OSX, as 
you already determined, so make sure you continue to do that. (The bug is 
reported here: https://issues.jenkins-ci.org/browse/JENKINS-15697).

Add this to the slave command line options: -Djava.awt.headless=true

Secondarily it seems like perhaps the slave node may not be properly 
configured within Jenkins?  Have you tried a combination of SSH + running 
headless (perhaps that was your error message you included)?

I hope this helps,

Kenny

On Tuesday, April 30, 2013 5:28:11 PM UTC-7, Dan Tenenbaum wrote:
>
> Hi all,
>
> I have tried a number of methods to connect to a Mac slave and have had no 
> success.
>
> My master is also a mac and it's called dhcp151178. The slave I'm trying 
> to connect to is called pelham. These of course are machines on my internal 
> network. 
>
> The first method I tried was "Launch slave agents on Unix machines via 
> SSH".
>
> It looks like the master can connect to the slave via ssh but then I get 
> the following (excerpted; full stack traces at end of message):
>
> java.io.IOException: Remote call on pelham failed
>
> ...
>
> Caused by: java.lang.InternalError: Can't connect to window server - not 
> enough permissions.
>
>
> Then I tried "Launch slave agents via Java Web Start"
>
> And on the slave I navigated to 
> http://dhcp151178:8080/computer/pelham/slave-agent.jnlp
>
> This gave me:
>
>
> java.lang.Exception: The server rejected the connection: Unauthorized access
>
> at hudson.remoting.Engine.onConnectionRejected(Engine.java:257)
>
> at hudson.remoting.Engine.run(Engine.java:232)
>
>
> Also, based on the following post:
>
> http://stackoverflow.com/questions/11824486/setting-up-a-hudson-slave-on-windows-xp
>
>
> I tried downloading the jnlp file from the URL above, replacing all instances 
> of 'localhost' with 'dhcp151178' and launching the jnlp with javaws, this 
> either gives me no console output at all (but the slave agent gui says 
> Terminated) or it says:
>
>
> ...
>
> Exception in thread "main" java.lang.InternalError: Can't connect to window 
> server - not enough permissions.
>
>
> I tried starting in headless mode, both as jenkins and as my regular admin 
> user. I did this on the slave:
>
>
> java -jar slave.jar -jnlpUrl 
> http://dhcp151178:8080/computer/pelham/slave-agent.jnlp
> Apr 30, 2013 5:19:02 PM hudson.remoting.jnlp.Main$CuiListener <init>
> INFO: Jenkins agent is running in headless mode.
> Apr 30, 2013 5:19:02 PM hudson.remoting.jnlp.Main$CuiListener status
> INFO: Locating server among [http://localhost:8080/, http://dhcp151178:8080/]
> Apr 30, 2013 5:19:02 PM hudson.remoting.jnlp.Main$CuiListener status
> INFO: Connecting to localhost:49161
> Apr 30, 2013 5:19:02 PM hudson.remoting.jnlp.Main$CuiListener status
> INFO: Handshaking
> Apr 30, 2013 5:19:02 PM hudson.remoting.jnlp.Main$CuiListener error
> SEVERE: The server rejected the connection: Unauthorized access
> java.lang.Exception: The server rejected the connection: Unauthorized access
>       at hudson.remoting.Engine.onConnectionRejected(Engine.java:257)
>       at hudson.remoting.Engine.run(Engine.java:232)
>
>
> There is no security set up on the master, so I'm not sure what the 
> unauthorized access is about, and there is no -auth username:password that I 
> can add to that command line.
>
>
> I'm not sure how to set up "Launch slave via execution of command on the 
> Master" because I can't find much documentation for that. 
>
>
> So I'm stuck. I was able to set up a windows slave so I know that it is 
> possible. But the Mac slave does not want to start. Can you help?
>
>
> Thanks,
>
> Dan
>
>
> Addenda: full stack trace from trying to launch slave agents on the master 
> using ssh:
>
>
> 04/30/13 17:23:29] [SSH] Opening SSH connection to pelham:22.
> [04/30/13 17:23:29] [SSH] Authentication successful.
> [04/30/13 17:23:29] [SSH] The remote users environment is:
> BASH=/bin/bash
> BASH_ARGC=()
> BASH_ARGV=()
> BASH_EXECUTION_STRING=set
> BASH_LINENO=()
> BASH_SOURCE=()
> BASH_VERSINFO=([0]="3" [1]="2" [2]="48" [3]="1" [4]="release" 
> [5]="x86_64-apple-darwin10.0")
> BASH_VERSION='3.2.48(1)-release'
> DIRSTACK=()
> EUID=216
> GROUPS=()
> HOME=/Users/Shared/Jenkins
> HOSTNAME=pelham.fhcrc.org
> HOSTTYPE=x86_64
> IFS=$' \t\n'
> LOGNAME=jenkins
> MACHTYPE=x86_64-apple-darwin10.0
> MAIL=/var/mail/jenkins
> OPTERR=1
> OPTIND=1
> OSTYPE=darwin10.0
> PATH=/usr/bin:/bin:/usr/sbin:/sbin
> PPID=545
> PS4='+ '
> PWD=/Users/Shared/Jenkins
> SHELL=/bin/bash
> SHELLOPTS=braceexpand:hashall:interactive-comments
> SHLVL=1
> SSH_CLIENT='140.107.151.178 56267 22'
> SSH_CONNECTION='140.107.151.178 56267 140.107.150.101 22'
> TERM=dumb
> UID=216
> USER=jenkins
> _=bash
> [04/30/13 17:23:29] [SSH] Checking java version of java
> [04/30/13 17:23:29] [SSH] java -version returned 1.6.0_45.
> [04/30/13 17:23:29] [SSH] Starting sftp client.
> [04/30/13 17:23:29] [SSH] Copying latest slave.jar...
> [04/30/13 17:23:29] [SSH] Copied 284,251 bytes.
> Expanded the channel window size to 4MB
> [04/30/13 17:23:29] [SSH] Starting slave process: cd 
> '/Users/Shared/Jenkins/master' && java  -jar slave.jar
> <===[JENKINS REMOTING CAPACITY]===>channel started
> Slave.jar version: 2.23
> This is a Unix slave
> Copied maven-agent.jar
> Copied maven3-agent.jar
> Copied maven3-interceptor.jar
> Copied maven-interceptor.jar
> Copied maven2.1-interceptor.jar
> Copied plexus-classworld.jar
> Copied classworlds.jar
> Evacuated stdout
> Tue Apr 30 17:23:31 pelham.fhcrc.org java[551] <Error>: kCGErrorFailure: Set 
> a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
> java.io.IOException: Remote call on pelham failed
>     at hudson.remoting.Channel.call(Channel.java:681)
>     at 
> org.jenkinsci.modules.slave_installer.impl.ComputerListenerImpl.onOnline(ComputerListenerImpl.java:32)
>     at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:472)
>     at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:340)
>     at hudson.plugins.sshslaves.SSHLauncher.startSlave(SSHLauncher.java:678)
>     at hudson.plugins.sshslaves.SSHLauncher.launch(SSHLauncher.java:472)
>     at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:223)
>     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:895)
>     at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
>     at java.lang.Thread.run(Thread.java:680)
> 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.slave_installer.impl.InstallerGui.call(InstallerGui.java:47)
>     at 
> org.jenkinsci.modules.slave_installer.impl.InstallerGui.call(InstallerGui.java:29)
>     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)
>     ... 5 more
> [04/30/13 17:23:31] [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:2557)
>     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1294)
>     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
>     at hudson.remoting.Command.readFrom(Command.java:92)
>     at 
> hudson.remoting.ClassicCommandTransport.read(ClassicCommandTransport.java:59)
>     at 
> hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:48)
> ERROR: [04/30/13 17:23:31] 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:2557)
>     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1294)
>     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
>     at hudson.remoting.Command.readFrom(Command.java:92)
>     at 
> hudson.remoting.ClassicCommandTransport.read(ClassicCommandTransport.java:59)
>     at 
> hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:48)
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to