2014-10-30 84 views
1

我有一些設置&拆卸腳本,使用csrun.exe爲一些自動化測試準備本地計算模擬器。Azure計算仿真器錯誤「通信對象...不能用於通信,因爲它處於Faulted狀態。」

 
C:\Program Files\Microsoft SDKs\Azure\Emulator\csrun.exe /removeall 
C:\Program Files\Microsoft SDKs\Azure\Emulator\csrun.exe /devfabric:clean 
 
C:\Program Files\Microsoft SDKs\Azure\Emulator\csrun.exe /run:"c:\myapp\csx\Release";"c:\myapp\bin\Release\app.publish\ServiceConfiguration.Local.cscfg" 

的csrun調用不一致removeall過失敗,此錯誤:

 
Encountered an unexpected error The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state. 
Server stack trace: 
at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout) 
Exception rethrown at [0]: 
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) 
at System.IDisposable.Dispose() 
at Microsoft.ServiceHosting.Tools.DevelopmentFabric.SingleInstanceFabricClient.Connect() 
at Microsoft.ServiceHosting.Tools.DevelopmentFabric.DevFabric.EnsureClient(Boolean checkConnection) 
at Microsoft.ServiceHosting.Tools.DevelopmentFabric.DevFabric.d__0.MoveNext() 
at Microsoft.ServiceHosting.Tools.CloudServiceRun.DoActions.RemoveAll() 
at Microsoft.ServiceHosting.Tools.CloudServiceRun.DoActions.ParseArguments(String[] args, Boolean doActions) 
at Microsoft.ServiceHosting.Tools.CloudServiceRun.DoActions.ExecuteActions(String[] args). 

而且csrun呼籲部署也不一致失敗,出現同樣的錯誤(稍有不同的堆棧跟蹤):

 
Encountered an unexpected error The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state. 
Server stack trace: 
at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout) 
Exception rethrown at [0]: 
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) 
at System.IDisposable.Dispose() 
at Microsoft.ServiceHosting.Tools.DevelopmentFabric.SingleInstanceFabricClient.RunServiceDeployment(String tenantName) 
at Microsoft.ServiceHosting.Tools.DevelopmentFabric.Deployment.Start() 
at Microsoft.ServiceHosting.Tools.CloudServiceRun.DoActions.Run(DirectoryInfo dir, FileInfo serviceConfiguration, Boolean launchBrowser, Boolean paused, String debugger, Boolean useIISExpress, List`1 portOverrides) 
at Microsoft.ServiceHosting.Tools.CloudServiceRun.DoActions.ParseArguments(String[] args, Boolean doActions) 
at Microsoft.ServiceHosting.Tools.CloudServiceRun.DoActions.ExecuteActions(String[] args). 

這是Compute Emulator v2.4。

我已確認web.config是可寫且有效的。 (如this thread所示)

我在另一臺機器上進行了類似的設置,沒有問題。我知道的唯一區別是工作機器有單核CPU,而這個失敗的是雙核。

+0

你解決了這個,因爲我剛剛開始出現此錯誤? – 2015-01-20 01:52:39

+0

我剛開始也是這樣,可以通過刪除我的雲服務設置中的https端點來解決此問題。 我的月度天藍信用完了,我懷疑這跟它有關。 – Socardo 2015-01-20 02:41:21

+0

通過將虛擬機移動到另一臺主機來解決這個問題 – Socardo 2015-01-21 04:03:28

回答

0

使更多的日誌記錄在c:\Program Files\Microsoft SDKs\Azure\Emulator\csrun.exe.config,調查csrun.svclog,並在%LOCALAPPDATA%\dftmp調查日誌後,確定根本錯誤是可能發生這種情況在dfservice.exe:」 System.UnauthorizedAccessException的。0X80070005 (E_ACCESSDENIED))」。

使用procmon中,發現周圍的錯誤時,dfservice.exe遇到了「文件,其中僅有讀者已鎖定」問題,試圖訪問myapp\csx\Release\roles\MyWorkerRoleName\base\x64\WaHostBootstrapper.exe

我最好的猜測是,仿真器持有到文件從當儘管我努力做清理和清理,但事先的事例。

我想我通過改變我的構建腳本來爲每個構建執行(和模擬器部署)在%TEMP%中創建一個新的唯一目錄,在那裏我可以事先複製csx\Release\的內容;然後我從那裏部署到模擬器。 (用一些額外的腳本代碼,後來試圖遞歸刪除所有這些臨時文件,但忽略任何錯誤。)

1

就我而言,我刪除了用於SSL的證書並創建了一個新證書。解決了我的問題。從HRESULT訪問被拒絕(例外:

+0

我能夠通過將證書導入IIS來解決一些警告。但通信錯誤依然存在。 – 2016-04-05 22:10:22

相關問題