Pages

Wednesday, August 7, 2013

Jenkins Failed to locate Cygwin installation. Is Cygwin installed?

Scenario:
 I configured a new Windows 64 bit node in Jenkins and when i try to execute a shell command from it, i got the below mentioned error.


FATAL: command execution failedhudson.util.IOException2: Failed to locate Cygwin installation. Is Cygwin installed? at hudson.plugins.cygpath.CygpathLauncherDecorator$GetCygpathTask.getCygwinRoot(CygpathLauncherDecorator.java:122) at hudson.plugins.cygpath.CygpathLauncherDecorator$GetCygpathTask.call(CygpathLauncherDecorator.java:127) at hudson.plugins.cygpath.CygpathLauncherDecorator$GetCygpathTask.call(CygpathLauncherDecorator.java:112) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:287) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)Caused by: hudson.util.jna.JnaException: Win32 error: 2 - null at hudson.util.jna.RegistryKey.check(RegistryKey.java:124) at hudson.util.jna.RegistryKey.open(RegistryKey.java:223) at hudson.util.jna.RegistryKey.openReadonly(RegistryKey.java:218) at hudson.plugins.cygpath.CygpathLauncherDecorator$GetCygpathTask.getCygwinRoot(CygpathLauncherDecorator.java:115) ... 11 more

Solution 1:
 Just add the "Shell" on the first line or your Execute Shell part. it may resolve the issue.
#!/bin/bash
Best Solution is don't mention any shell, so that it'll run the script whether on CMD / SHELL.

Solution 2:
 Check if sshd service is running if not please follow the instructions.

Solution 3:
 If sshd service is not configured as a service in windows, then follow the instructions to create the service.

Solution 4:
 If sshd service is configured but starting saying "service started and stopped as no process is using the service". then check the below,
  1. Find the Cygwin log path, in my case C:\cygwin\var\log\sshd.log. if you observed,

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0711 for '/etc/ssh_host_rsa_key' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /etc/ssh_host_rsa_key
Could not load host key: /etc/ssh_host_rsa_key

2. Then change the permission of the files like this, no write / now execute. Then i started the service, it came up.
$ chmod 600 ssh_host_*
-rw-------   1 cyg_server     None    988 Aug  6 14:40 ssh_host_key
-rw-r--r--+  1 cyg_server     None    652 Aug  6 14:40 ssh_host_key.pub
-rw-------   1 cyg_server     None   1675 Aug  6 14:40 ssh_host_rsa_key
-rw-r--r--+  1 cyg_server     None    407 Aug  6 14:40 ssh_host_rsa_key.pub
-rw-------   1 cyg_server     None    672 Aug  6 14:40 ssh_host_dsa_key
-rw-r--r--+  1 cyg_server     None    615 Aug  6 14:40 ssh_host_dsa_key.pub


1 comment: