日本語 : Windows slaves fail to start via DCOM

If you chose "Let Hudson control this Windows slave as a Windows service" for connecting to slave, you may get an error message like this:
"WindowsサービスとしてこのWindowsスレーブを制御" を選んでスレーブと接続しようとして、下記のようなエラーが出てしまった場合:

Access is denied. [0x00000005]
	at org.jinterop.dcom.core.JIComServer.init(JIComServer.java:542)
	at org.jinterop.dcom.core.JIComServer.initialise(JIComServer.java:458)
	at org.jinterop.dcom.core.JIComServer.<init>(JIComServer.java:427)
	at org.jvnet.hudson.wmi.WMI.connect(WMI.java:41)
	at hudson.os.windows.ManagedWindowsServiceLauncher.launch(ManagedWindowsServiceLauncher.java:107)
	at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:170)
	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:619)
Caused by: rpc.FaultException: Received fault. (unknown)
	at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:142)
	at rpc.Stub.call(Stub.java:112)
	at org.jinterop.dcom.core.JIComServer.init(JIComServer.java:538)
	... 10 more

If so, check the following settings on Windows:
このような場合は、以下のWindowsの設定をチェックして下さい:

Local "Administrator" group membership / ローカルの"Administrator"グループメンバーシップの確認

Make sure that the user name you have entered is a member of the local "Administrators" group. In the default Windows installation, this group membership is required for Hudson to remotely copy files and install a service.
"WindowsサービスとしてこのWindowsスレーブを制御"で設定したユーザ名が、スレーブのローカルの"Administrator"グループのメンバであることを確認して下さい。デフォルトのWindowsの場合、このグループメンバーでないと、Hudsonのリモートへのファイル転送と、スレーブサービスのインストールが出来ません。

Firewall / ファイアウォール

By default, Windows Firewall prevents the TCP connections necessary to make this mechanism work. The firewall on the slave must allow the following exceptions (see List of TCP&UDP port numbers):
デフォルトでは、Windowsのファイアウォールは、DCOMによる起動メカニズムが動作するために必要なTCPコネクションをブロックしてしまいます。スレーブ上のファイアウォールは下記の例外を許可する必要があります
(List of TCP&UDP port numbers を参照のこと):

  • TCP Port 135 (DCE/RPC Locator service)
  • TCP Port 139 (NetBIOS Session Service)
  • TCP Port 445 (Windows shares / Windows共有)
  • C:\WINDOWS\system32\dllhost.exe (dllhost.exe seems to use a random port number / dllhost.exe がランダムなポート番号を利用するため)
  • C:\WINDOWS\system32\javaw.exe (Hudson also uses a random port number / Hudsonがランダムなポート番号を利用するため)
  • File and Printer sharing (TCP 139, TCP 445, UDP 137, UDP 138 (possibly only a subset of these is required))
  • ファイルとプリンタ共有 (TCP 139, TCP 445, UDP 137, UDP 138 (おそらく、これらのサブセットで十分です))

The easiest way to track down firewall issues is to use tcpdump. Just run the following command on the Hudson server, which is trying to connect to the slave:
ファイアウォールの問題を調査するもっとも簡単な方法は、tcpdumpを利用することです。スレーブに接続しようとするHudson上から、下記のようなコマンドを実行します:

Linux/UNIX:

tcpdump -n -i <IF> -s 1500 port not 22 and host <HOST-IP>

<IF>       the network interface name, e.g. eth1 / ネットワークインターフェース(NIC)名 (e.g. eth1)
<HOST-IP>  the IP address of the slave / スレーブのIPアドレス

Ports 139 and 445 / ポート 139, 445

When the Ports 139 (NetBIOS Session Service) and 445 (Windows Shares) are not available, the following error message appears:
139ポート (NetBIOS セッションサービス) と 445ポート (Windows共有) が利用できない場合は、次のようなメッセージが表示されます:

ERROR: Message not found for errorCode: 0xC0000001
org.jinterop.dcom.common.JIException: Message not found for errorCode: 0xC0000001
 at org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenHKCR(JIWinRegStub.java:121)
 at org.jinterop.dcom.core.JIComServer.initialise(JIComServer.java:479)
 at org.jinterop.dcom.core.JIComServer.<init>(JIComServer.java:427)
 at org.jvnet.hudson.wmi.WMI.connect(WMI.java:41)
 at hudson.os.windows.ManagedWindowsServiceLauncher.launch(ManagedWindowsServiceLauncher.java:137)
 at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:184)
 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:619)
Caused by: jcifs.smb.SmbException:
Connection timeout jcifs.util.transport.TransportException: Connection timeout
 at jcifs.util.transport.Transport.connect(Transport.java:178)
 at jcifs.smb.SmbTransport.connect(SmbTransport.java:294)
 at jcifs.smb.SmbTree.treeConnect(SmbTree.java:141)
 at jcifs.smb.SmbFile.doConnect(SmbFile.java:858)
 at jcifs.smb.SmbFile.connect(SmbFile.java:901)
 at jcifs.smb.SmbFile.connect0(SmbFile.java:827)
 at jcifs.smb.SmbFileInputStream.<init>(SmbFileInputStream.java:76)
 at jcifs.smb.SmbFileInputStream.<init>(SmbFileInputStream.java:65)
 at jcifs.smb.SmbFile.getInputStream(SmbFile.java:2784)
 at rpc.ncacn_np.RpcTransport.attach(RpcTransport.java:90)
 at rpc.Stub.attach(Stub.java:105)
 at rpc.Stub.call(Stub.java:109)
 at org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenHKCR(JIWinRegStub.java:119)
 at org.jinterop.dcom.core.JIComServer.initialise(JIComServer.java:479)
 at org.jinterop.dcom.core.JIComServer.<init>(JIComServer.java:427)
 at org.jvnet.hudson.wmi.WMI.connect(WMI.java:41)
 at hudson.os.windows.ManagedWindowsServiceLauncher.launch(ManagedWindowsServiceLauncher.java:137)
 at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:184)
 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:619)
 at jcifs.smb.SmbTransport.connect(SmbTransport.java:296)
 at jcifs.smb.SmbTree.treeConnect(SmbTree.java:141)
 at jcifs.smb.SmbFile.doConnect(SmbFile.java:858)
 at jcifs.smb.SmbFile.connect(SmbFile.java:901)
 at jcifs.smb.SmbFile.connect0(SmbFile.java:827)
 at jcifs.smb.SmbFileInputStream.<init>(SmbFileInputStream.java:76)
 at jcifs.smb.SmbFileInputStream.<init>(SmbFileInputStream.java:65)
 at jcifs.smb.SmbFile.getInputStream(SmbFile.java:2784)
 at rpc.ncacn_np.RpcTransport.attach(RpcTransport.java:90)
 at rpc.Stub.attach(Stub.java:105)
 at rpc.Stub.call(Stub.java:109)
 at org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenHKCR(JIWinRegStub.java:119)
 ... 10 more

Local Security Settings / ローカルセキュリティ設定

  1. Start the control panel, go to "Administrative Tools", then "Local Security Policy". This will open up the "local security settings" window
  2. コントロールパネルから、"管理ツール"、そして"ローカルセキュリティポリシー"に移動します。"ローカルセキュリティ設定"のウィンドウを開きます。
  1. Go to "Local Policies" > "Security Options" > "Network access: Sharing and security model for local accounts." Change that to "Classic."
  2. "ローカルポリシー" > "セキュリティオプション" > "ネットワークアクセス: ローカルアカウントの共有とセキュリティモデル" にアクセスします。この値を"クラシック"に変更します。

This only applies to Windows computers that are not a part of a domain (reference)

この設定は、ドメインのメンバーでないコンピュータにのみ適用されます。(参考)

Remote Registry Service / リモートレジストリサービス

The Remote Registry service must be running in order to install the Jenkins service, but it may be stopped on your computer.  This is especially true for Windows Vista, where it is disabled by default.  If it is not running, you may get an error like this:
Jenkinsのサービスをインストールするためには、リモートレジストリサービスが起動している必要がありますが、あなたのコンピュータでは、このサービスは停止状態となっているかもしれません。とくにWindows Vista (もしくはそれ以降)では、デフォルトで無効になっているからです。もし、このサービスが起動していなければ、次のようなエラーが表示されます:

Message not found for errorCode: 0xC0000034
 org.jinterop.dcom.common.JIException: Message not found for errorCode: 0xC0000034
     at org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenHKCR(JIWinRegStub.java:121)
     at org.jinterop.dcom.core.JIComServer.initialise(JIComServer.java:479)
     at org.jinterop.dcom.core.JIComServer.<init>(JIComServer.java:427)
     at org.jvnet.hudson.wmi.WMI.connect(WMI.java:41)
     at hudson.os.windows.ManagedWindowsServiceLauncher.launch(ManagedWindowsServiceLauncher.java:107)
     at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:178)
     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:636)
 Caused by: jcifs.smb.SmbException: The system cannot find the file specified.
     at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:542)
     at jcifs.smb.SmbTransport.send(SmbTransport.java:644)
     at jcifs.smb.SmbSession.send(SmbSession.java:242)
     at jcifs.smb.SmbTree.send(SmbTree.java:111)
     at jcifs.smb.SmbFile.send(SmbFile.java:729)
     at jcifs.smb.SmbFile.open0(SmbFile.java:934)
     at jcifs.smb.SmbFile.open(SmbFile.java:951)
     at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:142)
     at jcifs.smb.TransactNamedPipeOutputStream.<init>(TransactNamedPipeOutputStream.java:32)
     at jcifs.smb.SmbNamedPipe.getNamedPipeOutputStream(SmbNamedPipe.java:187)
     at rpc.ncacn_np.RpcTransport.attach(RpcTransport.java:91)
     at rpc.Stub.attach(Stub.java:105)
     at rpc.Stub.call(Stub.java:109)
     at org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenHKCR(JIWinRegStub.java:119)
     ... 10 more

If so, start the control panel, open "Administrative Tools," then "Services." Locate the Remote Registry service on the list, and click "Start this service."

Remote Registry Permissions / リモートレジストリ パーミッション

If the Remote Registry user don't have access to the registry key that configures remote registry path access you should see this error:
リモートレジストリユーザが、リモートレジストリパスへのアクセスを設定をする レジストリキー そのものにアクセスする権限が無い場合、下記のようなエラーが表示されます:

Access is denied. See
http://wiki.jenkins-ci.org/display/HUDSON/Windows+slaves+fail+to+start+via+DCOM
for more information about how to resolve this.

org.jinterop.dcom.common.JIException: Access is denied, please check whether the
[domain-username-password] are correct. Also, if not already done please check
the GETTING STARTED and FAQ sections in readme.htm. They provide information on
how to correctly configure the Windows machine for DCOM access, so as to avoid
such exceptions.  [0x00000005]

	at org.jinterop.winreg.smb.JIWinRegStub.winreg_CreateKey(JIWinRegStub.java:297)
	at org.jinterop.dcom.core.JIComServer.initialise(JIComServer.java:480)
	at org.jinterop.dcom.core.JIComServer.<init>(JIComServer.java:427)
	at org.jvnet.hudson.wmi.WMI.connect(WMI.java:41)
	at hudson.os.windows.ManagedWindowsServiceLauncher.launch(ManagedWindowsServiceLauncher.java:107)
	at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:178)
	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: org.jinterop.dcom.common.JIRuntimeException: Access is denied, please
check whether the [domain-username-password] are correct. Also, if not already
done please check the GETTING STARTED and FAQ sections in readme.htm. They
provide information on how to correctly configure the Windows machine for DCOM
access, so as to avoid such exceptions.  [0x00000005]
	at org.jinterop.winreg.IJIWinReg$createKey.read(IJIWinReg.java:459)
	at ndr.NdrObject.decode(NdrObject.java:19)
	at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:138)
	at rpc.Stub.call(Stub.java:112)
	at org.jinterop.winreg.smb.JIWinRegStub.winreg_CreateKey(JIWinRegStub.java:291)
	... 10 more

In the slave use regedit to ensure that the user that is running the 'Remote Registry' service, usually 'LOCAL SERVICE', has READ access to these entries:
'リモートレジストリ' サービスを実行するJenkinsの実行ユーザに対して、下記のレジストリキーに読み取り権限を設定して下さい。権限はレジストリエディタを使って、スレーブマシン上で実施します。下記の値を右クリックし、『アクセス許可』のメニューから設定ができます。通常は、 'LOCAL SERVICE' に対して読み取り権限が設定されています。Jenkinsを 'LOCAL SERVICE' 以外のアカウントで実行する場合は、そのアカウントに対しての許可が要ります。

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurePipeServers\winreg

.NET Framework

On Windows XP / 2003, if you see a message like this:
Windows XP / 2003で、下記のようなメッセージが出た場合は、.NET framework のバージョンを 3.5SP1(もしくはそれ以上)に上げて下さい。

Installing the Hudson slave service
No more data is available. [0x00000103]
org.jinterop.dcom.common.JIException: No more data is available. [0x00000103]
	at org.jinterop.winreg.smb.JIWinRegStub.winreg_EnumKey(JIWinRegStub.java:390)
	at hudson.util.jna.DotNet.isInstalled(DotNet.java:81)
	at hudson.os.windows.ManagedWindowsServiceLauncher.launch(ManagedWindowsServiceLauncher.java:117)
	at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:180)
	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:636)
Caused by: org.jinterop.dcom.common.JIRuntimeException: No more data is available. [0x00000103]
	at org.jinterop.winreg.IJIWinReg$enumKey.read(IJIWinReg.java:762)
	at ndr.NdrObject.decode(NdrObject.java:19)
	at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:138)
	at rpc.Stub.call(Stub.java:112)
	at org.jinterop.winreg.smb.JIWinRegStub.winreg_EnumKey(JIWinRegStub.java:386)
	... 8 more

Then try upgrading .NET framework to ver 3.5SP1.

Taken from http://n4.nabble.com/exception-when-winxp-slaves-launch-No-more-data-is-available-0x00000103-td386006.html
この情報はこちらから:http://n4.nabble.com/exception-when-winxp-slaves-launch-No-more-data-is-available-0x00000103-td386006.html(ただし現在リンクが無いようです)

If all else fails... / もしそのほかのエラーがあれば....

Please file an issue about the problem with the stack trace, with information like Windows versions, so that we can take a look.
スタックとレースと一緒に、問題についてのチケットを届け出て下さい。そうすれば、こちらでもチケットをチェックすることができます。その際は、Windowsのバージョン情報も添えて下さい。

Attachments:

jenkins-regedit.png (image/png)