如何修复由于 docker 错误而导致的服务结构网格失败



我一直在使用Service Fabric Mesh Preview来测试服务。一切正常,我什至能够发布到 Azure,然后在我尝试向解决方案添加其他服务网格应用程序后,一切都失败了,由于 docker 生成的错误,我的本地群集不再切换到网格节点。日志在下面,从我所看到的,它尝试创建网络失败,并说对象已经存在,但是,当我从命令行列出docker ntworks时,它只显示默认的,而不显示日志中的那个:"servicefabric_nat"我已经尝试卸载所有内容(Docker,SDK,VS Tools,删除注册表项(并重新定位,仍然是相同的问题。我应该怎么做才能解决错误?

谢谢

**********************
Windows PowerShell transcript start
Start time: 20190331163515
Username: AzureADEduardoFonseca
RunAs User: AzureADEduardoFonseca
Configuration Name: 
Machine: DESKTOP-CAP3E26 (Microsoft Windows NT 10.0.17134.0)
Host Application: PowerShell.exe -WindowStyle Hidden -NonInteractive -ExecutionPolicy RemoteSigned -Command & 'C:Program FilesMicrosoft SDKsService FabricClusterSetupDevClusterSetup.ps1' -Auto -PathToClusterLogRoot C:SFDevClusterLog -SetupLogFileName DevClusterSetup.log -CreateOneNodeCluster -CreateMeshCluster
Process ID: 12248
PSVersion: 5.1.17134.407
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.17134.407
BuildVersion: 10.0.17134.407
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1
**********************
Transcript started, output file is C:SFDevClusterLogDevClusterSetup.log
Installing certificates for secure cluster setup...
Cleaning existing certificates...
Certificates removed.
Installing new certificates...
WARNING: This will install certificate with 'CN=ServiceFabricDevClusterCert' in following stores:
    # LocalMachineMy
    # LocalMachineroot &
    # CurrentUserMy
The CleanCluster.ps1 will clean these certificates or you can clean them up using script 'CertSetup.ps1 -Clean -CertSubjectName CN=ServiceFabricDevClusterCert'.
FabricSetup.exe invoked with arguments (C:Program FilesMicrosoft Service FabricbinFabricFabric.CodeFabricSetup.exe
 /operation:installsfvolumedriver). Current Exe version 6.4.644.9590
Environment information Data Root C:ProgramDataMicrosoft Service Fabric, Log Root C:ProgramDataMicrosoft Service Fab
riclog
Starting service eventlog
Starting service pla
Starting DriverInstallManager::Install
SFBDMiniport driver install path : C:Program FilesMicrosoft Service FabricbinFabricFabric.CodeSFBDMiniport.inf for
 uninstalling device.
SFBDMiniport driver uninstalled sucessfully.
Sign Location is empty ''
Installing SFBDMiniport Driver
SFBDMiniport driver path : C:Program FilesMicrosoft Service FabricbinFabricFabric.CodeSFBDMiniport.inf for install
ing device.
SFBDMiniport installed from path : C:Program FilesMicrosoft Service FabricbinFabricFabric.CodeSFBDMiniport.inf.
DriverInstallManager::Install successful
Operation successful
Creating Docker network and adding firewall rule...
Status   Name               DisplayName
------   ----               -----------
Running  docker             Docker Engine
docker : Error: No such network: servicefabric_nat
At C:Program FilesMicrosoft SDKsService FabricToolsScriptsClusterSetupUtilities.psm1:590 char:35
+ ... onContent = docker $dockercommandParameters.Split(" ") 2> $tempErrorF ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Error: No such ...rvicefabric_nat:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
docker : Error response from daemon: HNS failed with error : The object already exists.
At C:Program FilesMicrosoft SDKsService FabricToolsScriptsClusterSetupUtilities.psm1:590 char:35
+ ... onContent = docker $dockercommandParameters.Split(" ") 2> $tempErrorF ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Error response ...already exists.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
docker : Error response from daemon: HNS failed with error : The object already exists.
At C:Program FilesMicrosoft SDKsService FabricToolsScriptsClusterSetupUtilities.psm1:590 char:35
+ ... onContent = docker $dockercommandParameters.Split(" ") 2> $tempErrorF ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Error response ...already exists.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
docker : Error response from daemon: HNS failed with error : The object already exists.
At C:Program FilesMicrosoft SDKsService FabricToolsScriptsClusterSetupUtilities.psm1:590 char:35
+ ... onContent = docker $dockercommandParameters.Split(" ") 2> $tempErrorF ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Error response ...already exists.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
docker : Error response from daemon: HNS failed with error : The object already exists.
At C:Program FilesMicrosoft SDKsService FabricToolsScriptsClusterSetupUtilities.psm1:590 char:35
+ ... onContent = docker $dockercommandParameters.Split(" ") 2> $tempErrorF ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Error response ...already exists.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
docker : Error response from daemon: HNS failed with error : The object already exists.
At C:Program FilesMicrosoft SDKsService FabricToolsScriptsClusterSetupUtilities.psm1:590 char:35
+ ... onContent = docker $dockercommandParameters.Split(" ") 2> $tempErrorF ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Error response ...already exists.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
docker : Error response from daemon: HNS failed with error : The object already exists.
At C:Program FilesMicrosoft SDKsService FabricToolsScriptsClusterSetupUtilities.psm1:590 char:35
+ ... onContent = docker $dockercommandParameters.Split(" ") 2> $tempErrorF ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Error response ...already exists.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
docker : Error response from daemon: HNS failed with error : The object already exists.
At C:Program FilesMicrosoft SDKsService FabricToolsScriptsClusterSetupUtilities.psm1:590 char:35
+ ... onContent = docker $dockercommandParameters.Split(" ") 2> $tempErrorF ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Error response ...already exists.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
docker : Error response from daemon: HNS failed with error : The object already exists.
At C:Program FilesMicrosoft SDKsService FabricToolsScriptsClusterSetupUtilities.psm1:590 char:35
+ ... onContent = docker $dockercommandParameters.Split(" ") 2> $tempErrorF ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Error response ...already exists.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
docker : Error response from daemon: HNS failed with error : The object already exists.
At C:Program FilesMicrosoft SDKsService FabricToolsScriptsClusterSetupUtilities.psm1:590 char:35
+ ... onContent = docker $dockercommandParameters.Split(" ") 2> $tempErrorF ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Error response ...already exists.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
docker : Error response from daemon: HNS failed with error : The object already exists.
At C:Program FilesMicrosoft SDKsService FabricToolsScriptsClusterSetupUtilities.psm1:590 char:35
+ ... onContent = docker $dockercommandParameters.Split(" ") 2> $tempErrorF ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Error response ...already exists.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
WARNING: Unable to communicate with Docker. Validate the following
WARNING:     Docker is installed on the machine
WARNING:     Docker service is running
WARNING:     Docker is configured to run Windows containers
WARNING:     Open a command prompt and make sure the following command succeeds
WARNING:         docker network create -d=nat --subnet="10.128.0.0/24" --gateway="10.128.0.1" servicefabric_nat
DockerNetworkCommandFailed : Unable to communicate with Docker. Visit FAQ at https://aka.ms/sfmesh for details
At C:Program FilesMicrosoft SDKsService FabricToolsScriptsClusterSetupUtilities.psm1:617 char:9
+         DockerNetworkCommandFailed $warningOnFail
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,DockerNetworkCommandFailed
DockerNetworkCommandFailed : Unable to communicate with Docker. Visit FAQ at https://aka.ms/sfmesh for details
At C:Program FilesMicrosoft SDKsService FabricToolsScriptsClusterSetupUtilities.psm1:617 char:9
+         DockerNetworkCommandFailed $warningOnFail
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,DockerNetworkCommandFailed
PS>TerminatingError(): "ScriptHalted"
>> TerminatingError(): "ScriptHalted"
>> TerminatingError(): "ScriptHalted"
>> TerminatingError(): "ScriptHalted"
>> TerminatingError(): "ScriptHalted"
ScriptHalted
**********************
Windows PowerShell transcript end
End time: 20190331163742
**********************

已经找到了问题的原因,显然 docker 无法创建网络,因为网络适配器已经存在,它们在 Windows 中被列为网络适配器,这是我解决问题的方法:*卸载Hyper-V* 使用设备管理器卸载 Hyper-V 网络*重新安装Hyper-V

有了该 Service Fabric 本地群集,它又开始按预期工作。

最新更新