在将微服务应用程序部署到Azure中的远程Service Fabric群集时遇到问题。
该应用程序由5个服务组成,其中4个服务可以启动,其状态显示为InBuild
。但是,其中一个失败并出现以下错误(所有节点上的状态在Error
和'System.RA' reported Warning for property 'ReplicaOpenStatus'.
Replica had multiple failures during open on _nt1bm_5. API call:
IStatelessServiceInstance.Open(); Error =
System.Resources.MissingManifestResourceException (-2146233038)
Could not find any resources appropriate for the specified culture or the
neutral culture. Make sure
"Microsoft.ServiceFabric.Services.Communication.AspNetCore.SR.resources" was
correctly embedded or linked into assembly
"Microsoft.ServiceFabric.AspNetCore" at compile time, or that all the
satellite assemblies required are loadable and fully signed.
at System.Resources.ManifestBasedResourceGroveler.HandleResourceStreamMissing(String fileName)
at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
at Microsoft.ServiceFabric.Services.Communication.AspNetCore.AspNetCoreCommunicationListener.GetEndpointResourceDescription(String endpointName)
at Microsoft.ServiceFabric.Services.Communication.AspNetCore.KestrelCommunicationListener.GetListenerUrl()
at Microsoft.ServiceFabric.Services.Communication.AspNetCore.AspNetCoreCommunicationListener.OpenAsync(CancellationToken cancellationToken)
at Microsoft.ServiceFabric.Services.Runtime.StatelessServiceInstanceAdapter.OpenCommunicationListenersAsync(CancellationToken cancellationToken)
at Microsoft.ServiceFabric.Services.Runtime.StatelessServiceInstanceAdapter.System.Fabric.IStatelessServiceInstance.OpenAsync(IStatelessServicePartition partition, CancellationToken cancellationToken)
For more information see: https://aka.ms/sfhealth
之间变化)
{{1}}
一些注意事项:
可能是什么原因?
如何调试此类错误?
是否可以在某处找到Service Fabric的源代码来查看失败的代码?
如果您需要任何其他信息,请询问:)
答案 0 :(得分:0)
我发现了此错误的原因!
即此错误:
Could not find any resources appropriate for the specified culture or the
neutral culture.
在解决方案中,我们具有独特的项目结构:
src:
Startup
等也是如此)Program.cs
和Web主机构建器-适用于Service Fabric)两个项目的appsettings.json
不同-但名称相同( !!! )
使用Visual Studio在本地进行构建和打包时,一切都很好,但是在Azure DevOps上进行构建(无论使用哪种构建类型:dotnet build
,Visual Studio build
时),都会发生奇怪的错误。
在为部署而创建的包中(使用-t:Package
构建.sfproj),即使我们引用的是ServicFabric项目appsettings.json
,有时还是从自托管项目中获取的。 (与ServiceFabric项目中的appsettings.json
不同)该错误来自尝试读取appsettings.json
TLDR;
该错误来自尝试读取appsettings.json
中不存在的条目
我们当前的解决方案是为来自不同项目的appsettings.json
使用不同的名称。如果我们找到更好的解决方案,我将更新答案。在此问题上的任何帮助也将不胜感激。