このトラブルシューティング ツールで使用されるツール:
- NA
この資料は情報提供のみを目的として提供されています。 Microsoft は、明示的、黙示的を問わず一切の保証をしません。
概要
次の手順では、Web 配置を使用して正しく構成されていないサーバーに Visual Studio から発行しようとしたときに発生する可能性がある一連のエラーについて説明します。 以下のスクリーンショットとエラーを収集するために、Visual Studio 2010 SP1 の新しい ASP.Net MVC 3 プロジェクトを使用しました。 移行先サーバーは、IIS を使用した Windows Server 2008 R2 SP1 のクリーン インストールでした。 追加の構成は行われませんでした。
"接続できません" エラー
最初に発生する可能性があるエラーは、Visual Studio の出力ウィンドウの下のスクリーンショットのようになります。 読みやすくするために、スクリーンショットの下にメッセージのフルテキストが再現されます。
Web deployment task failed.(Could not connect to the destination computer ("deployserver").On the destination computer, make sure that Web Deploy is installed and that the required process("The Web Management Service") is started.)
This error indicates that you cannot connect to the server. Make sure the service URL is correct,firewall and network settings on this computer and on the server computer are configured properly,and the appropriate services have been started on the server.
Error details:
Could not connect to the destination computer ("deployserver"). On the destination computer,
make sure that Web Deploy is installed and that the required process
("The Web Management Service") is started.
Unable to connect to the remote server
A connection attempt failed because the connected party did not properly respond after a period
of time, or established connection failed because connected host has failed to respond 1.1.1.1:8172
このエラー (および以下の他のエラー) で強調表示されているテキストは、問題の性質を理解するための鍵です。 Web 配置はサーバーから応答を受け取らなかったため、Visual Studio では考えられるいくつかの原因を区別できません。 その結果、試してみることの一覧が表示されます。
Web 管理サービスはインストールされていますか? IIS サーバーで、インターネット インフォメーション サービス マネージャーを開き、コンピューター名ノードを選択します。 [機能] ビューで、[管理] セクションまで下にスクロールし、次のアイコンを探します。
存在しない場合は、[役割サービスの追加] ダイアログを使用して管理サービスをインストールする必要があります。 [製品] タブから Web プラットフォーム インストーラーを使用してインストールすることもできます。左側の列にある [サーバー] を選択し、[IIS: 管理サービス] を選択します。 管理サービスをインストールした後は、自動的に開始されないため、開始する必要があることに注意してください。 これを行うには、[管理サービス] アイコンをダブルクリックします。 [管理サービス] ウィンドウが表示されたら、右側の [操作] ウィンドウで [開始] をクリックします。
Web 管理サービスは Windows ファイアウォール経由で許可されていますか? サーバーに Web 管理サービスをインストールすると、Web Management Service (HTTP Traffic-In) という名前の受信ファイアウォール規則が使用されます。 [Start-AdministrativeTools>-> セキュリティが強化された Windows ファイアウォール] に移動して、この規則が有効になっていることを確認します。 [受信ルール] をクリックし、一覧から Web 管理ルールを見つけます。 すべてのプロファイルで有効にする必要があります。 サード パーティ製のファイアウォールを使用している場合は、ポート 8172 での受信接続が許可されていることを確認する必要があります。
サービス URL は正しいですか?
既定では、Web 管理サービスはポート 8172 でリッスンしますが、これは変更できます。 使用されているポートを確認する最も簡単な方法は、前述のように [管理サービス] ウィンドウを開き、[接続] セクションで IP とポートの情報を確認することです。 ポートが 8172 以外に変更された場合は、新しいポートがファイアウォール経由で許可されていることを確認し、Visual Studio の発行設定で新しいポートを使用するようにサービス URL を更新する必要があります。
Web deployment task failed.(Could not connect to the destination computer ("deployserver") using
the specified process ("The Web Management Service") because the server did not respond.
Make sure that the process ("The Web Management Service") is started on the destination computer.)
Could not connect to the destination computer ("deployserver") using the specified process
("The Web Management Service") because the server did not respond. Make sure that the process
("The Web Management Service") is started on the destination computer.
The remote server returned an error: (403) Forbidden.
このメッセージはやや誤解を招きます。 サーバーが応答しなかったことを示しますが、403 エラーは、Web 配置がサーバーに接続できたが、要求がアクティブに拒否されたことを示します。 Web 管理サービスの HTTP ログは、要求がサーバーに到達したことを確認し、失敗した実際の要求に関する詳細を提供するのに役立ちます。 このログは、既定で %SystemDrive%\Inetpub\logs\WMSvc
確認できます。 他の IIS ログと同様に、データはすぐにログに書き込まれるわけではないため、要求が表示されるまで数分待つか、Web 管理サービスを再起動してログをフラッシュする必要がある場合があります。
WMSVC ログでは、上記のエラーは次のようになります。
2011-06-02 17:59:05 192.168.0.211 POST /msdeploy.axd site=default%20web%20site 8172 - 192.168.0.203 - 403 6 5 1669
ログの 403 の後の "6" は副状態コードであり、"IP アドレス拒否" を意味します。 (IIS の状態コードと副状態コードの完全な一覧は、 https://support.microsoft.com/kb/943891
管理サービスはリモート接続を許可するように構成されていますか?
これは、403.6 応答の最も可能性の高い理由です。 [管理サービス] アイコンをダブルクリックし、[リモート接続を有効にする] がオンになっていることを確認します。 変更を行うにはサービスを停止する必要があるため、完了したら必ず再起動してください。
管理サービスに対して IP 制限が構成されていますか?
403 エラーが発生する可能性があるもう 1 つの一般的な理由は、管理サービスがクライアントの IP を拒否するように構成されている場合です。 既定では、リモート接続が許可されている限り、すべての IP を許可するように構成されています。 IP 制限を確認するには、[管理サービス] アイコンをダブルクリックします。 構成済みの IP 制限規則は、ページの下部の IPv4 アドレス制限にあります。
Web deployment task failed.(Could not connect to the destination computer ("deployserver").
On the destination computer, make sure that Web Deploy is installed and that the required process
("The Web Management Service") is started.
The requested resource does not exist, or the requested URL is incorrect.
Error details: Could not connect to the destination computer ("deployserver").
On the destination computer, make sure that Web Deploy is installed and that the required process
("The Web Management Service") is started.
The remote server returned an error: (404) Not Found.
404 エラーは、Web Deploy がサーバー上の Web 管理サービスに接続できたが、必要なものが見つからなかったことを示します。 最初に、Web デプロイが接続しようとしたリソースを確認します。 WMSVC ログに次のようなエントリが表示されます。
2011-05-12 15:21:50 192.168.0.211 POST /msdeploy.axd site=default%20web%20site 8172 - 192.168.0.203 - 404 7 0 1606
Msdeploy.axd は、Web Deploy 要求のハンドラーです。
Web 配置はインストールされていますか?
Web 展開がインストールされていることを確認するには、[プログラムと機能] コントロール パネルに移動し、インストールされているプログラムの一覧で Microsoft Web Deploy 2.0 を探します。 存在しない場合は、[製品] タブに移動して、Web プラットフォーム インストーラーを使用してインストールできます。Web 配置ツール 2.1 として一覧表示されます。 また、Web Deployment Agent サービス (MsDepSvc) が実行されていることを確認する必要があります。
Web デプロイ ハンドラーはインストールされていますか?
Web 配置がインストールされていてもこのエラーが発生する場合は、Web 配置のIIS 7.0 Deployment Handler機能がインストールされていることを確認します。 [プログラムと機能] コントロール パネルで、Microsoft Web Deploy 2.0 を探し、右クリックして [変更] を選択します。 表示されるウィザードで、最初のページの [次へ] をクリックし、2 番目のページで [変更] を選択します。 IIS 7.0 Deployment Handlerとその下にあるすべてのものを追加します。
[次へ] をクリックしてウィザードを完了します。 この変更を行った後、Web 管理サービスを再起動する必要があります。
委任ルールのエラー
Web 配置と Web 管理サービスが正しく構成されたら、ユーザーがコンテンツを更新できるように委任規則を設定する必要があります。 アクセス許可の問題については、Visual Studio に表示されるエラーがいくつかあります。 次に例を示します。
Web deployment task failed.(Connected to the destination computer ("deployserver")
using the Web Management Service, but could not authorize.
Make sure that you are using the correct user name and password, that the site you are connecting
to exists, and that the credentials represent a user who has permissions to access the site.
Make sure the site name, user name, and password are correct. If the issue is not resolved,
please contact your local or server administrator.
Error details:
Connected to the destination computer ("deployserver") using the Web Management Service,
but could not authorize. Make sure that you are using the correct user name and password,
that the site you are connecting to exists, and that the credentials represent a user who
has permissions to access the site.
The remote server returned an error: (401) Unauthorized.
WMSvc ログに、次の情報が表示されます。
2011-05-12 15:50:12 192.168.0.211 POST /msdeploy.axd site=default%20web%20site 8172 - 192.168.0.203 - 401 2 5 1653
2011-05-12 15:50:12 192.168.0.211 POST /msdeploy.axd site=default%20web%20site 8172 user1 192.168.0.203 - 401 1 1326 124
Visual Studio の出力で強調表示されている http 状態は、アクセス拒否エラーです。 エラー ログで強調表示された win32 の状態は、"ログオンエラー: 不明なユーザー名または無効なパスワード" にマップされるため、これは単純なログオンエラーです。 ユーザーが認証されているが、発行に必要な権限がない場合、ログ エントリは次のようになります。
2011-05-12 15:55:38 192.168.0.211 POST /msdeploy.axd site=default%20web%20site 8172 - 192.168.0.203 - 401 2 5 0
このユーザーが発行できるようにするには、次の手順に従って委任を設定する必要があります。 https://www.iis.net/learn/publish/using-web-deploy/configure-the-web-deployment-handler
アカウントがログインできても、コンテンツの公開に必要な権限が付与されていない場合は、次のように表示されます。
Web deployment task failed. (Unable to perform the operation ("Create Directory") for the specified
directory ("bin"). This can occur if the server administrator has not authorized this operation for
the user credentials you are using.
WMSvc ログには、これらの要求に対する HTTP 200 応答が表示されます。 幸いにも、Web Deploy 2.1 は Microsoft Web Deploy サービス ログにも情報を書き込みます。 これを表示するには、イベント ビューアーを開き、[アプリケーションとサービス ログ] ->Microsoft Web Deploy に移動します。
この特定のエラーの場合、イベント ログには追加の詳細が含まれます (簡潔にするために切り捨てられます)。
User: DEPLOYSERVER\User1
Client IP: 192.168.0.203
Content-Type: application/msdeploy
Version: 8.0.0.0
MSDeploy.VersionMin: 7.1.600.0
MSDeploy.VersionMax: 7.1.1070.1
MSDeploy.Method: Sync
MSDeploy.RequestId: 50de0746-f10d-4640-9b3d-4ba773520e38
MSDeploy.RequestCulture: en-US
MSDeploy.RequestUICulture: en-US
Skip: objectName="^configProtectedData$"
Provider: auto, Path:
Tracing deployment agent exception. Request ID '50de0746-f10d-4640-9b3d-4ba773520e38'. Request Timestamp: '5/12/2011 9:18:12 AM'. Error Details:
Microsoft.Web.Deployment.DeploymentDetailedUnauthorizedAccessException: Unable to perform the operation ("Create Directory")
for the specified directory ("C:\inetpub\wwwroot\bin"). This can occur if the server administrator has not authorized this
operation for the user credentials you are using.
---> Microsoft.Web.Deployment.DeploymentException: The error code was 0x80070005. ---> System.UnauthorizedAccessException:
Access to the path 'C:\inetpub\wwwroot\bin' is denied.
at Microsoft.Web.Deployment.Win32Native.RaiseIOExceptionFromErrorCode(Win32ErrorCode errorCode, String maybeFullPath)
at Microsoft.Web.Deployment.DirectoryEx.CreateDirectory(String path)
at Microsoft.Web.Deployment.DirPathProvider.CreateDirectory(String fullPath, DeploymentObject source)
at Microsoft.Web.Deployment.DirPathProvider.Add(DeploymentObject source, Boolean whatIf)
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
このメッセージは、この特定のエラーに対してアクセス許可を付与する必要がある場所を示します。 Visual Studio に表示される可能性がある別のアクセス許可エラーは、次のエラーです。
Web deployment task failed.((5/12/2011 11:31:41 AM) An error occurred when the request was processed on the remote computer.)
(5/12/2011 11:31:41 AM) An error occurred when the request was processed on the remote computer.
The server experienced an issue processing the request. Contact the server administrator for more information.
この特定のエラーでは、実行する必要はあまりありませんが、イベント ビューアーの Web 配置エラー ログを見ると、画像がはるかに明確になります。
User: DEPLOYSERVER\User1
Client IP: 192.168.0.203
Content-Type: application/msdeploy
Version: 8.0.0.0
MSDeploy.VersionMin: 7.1.600.0
MSDeploy.VersionMax: 7.1.1070.1
MSDeploy.Method: Sync
MSDeploy.RequestId: 63b2f3d1-1817-444f-8280-9fa4f6f85d53
MSDeploy.RequestCulture: en-US
MSDeploy.RequestUICulture: en-US
Skip: objectName="^configProtectedData$"
Provider: auto, Path:
Tracing deployment agent exception. Request ID '63b2f3d1-1817-444f-8280-9fa4f6f85d53'. Request Timestamp: '5/12/2011 9:31:41 AM'. Error Details:
System.UnauthorizedAccessException: Attempted to perform an unauthorized operation.
at System.Security.AccessControl.Win32.SetSecurityInfo(ResourceType type, String name, SafeHandle handle, SecurityInfos securityInformation, SecurityIdentifier owner, SecurityIdentifier group, GenericAcl sacl, GenericAcl dacl)
at System.Security.AccessControl.NativeObjectSecurity.Persist(String name, SafeHandle handle, AccessControlSections includeSections, Object exceptionContext)
at System.Security.AccessControl.NativeObjectSecurity.Persist(String name, AccessControlSections includeSections, Object exceptionContext)
at Microsoft.Web.Deployment.FileSystemSecurityEx.Persist(String path)
at Microsoft.Web.Deployment.SetAclProvider.Add(DeploymentObject source, Boolean whatIf)
at Microsoft.Web.Deployment.DeploymentObject.Update(DeploymentObject source, DeploymentSyncContext syncContext)
at Microsoft.Web.Deployment.DeploymentSyncContext.HandleUpdate(DeploymentObject destObject, DeploymentObject sourceObject)
at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenOrder(DeploymentObject dest, DeploymentObject source)
at Microsoft.Web.Deployment.DeploymentSyncContext.ProcessSync(DeploymentObject destinationObject, DeploymentObject sourceObject)
このことから、User1 にはセキュリティ情報を設定する権限がないことがわかります。 この場合、ユーザーはコンテンツに対する変更アクセス許可を持っていません。 コンテンツに "アクセス許可の変更" を付与すると、問題が解決します。