![](/img/trans.png)
[英]Service Fabric: Authenticating with Azure KeyVault via cert: “KeySet does not exist”
[英]Service Fabric error: “Service does not exist”
我收到錯誤FabricServiceNotFoundException: Service does not exist.
我無法弄清楚為什么。 我正在創建的服務名稱正是它在我的集群中部署的名稱。
這是我創建服務的代碼:
return ServiceProxy.Create<ICheckoutService>(
new Uri("fabric:/ECommerce/ECommerce.CheckoutService"),
new ServicePartitionKey(0));
這是探險家的觀點。 服務名稱與我的代碼匹配。 我正在使用其他服務,沒有問題。
我嘗試完全重啟但我得到了同樣的錯誤:
經過測試后,我發現錯誤的發生取決於我通過API方法調用服務的順序。
如果我部署應用程序並調用方法checkout
並get basket
,則會出現“Service not found”錯誤。
但是,如果我先調用其他方法來執行某些更改(POST),那么它的工作原理......很奇怪吧? 這是我的回購,以幫助看看代碼。
https://github.com/epomatti/azure-servicefabric-productcatalog
在@ maf748的幫助下,我為所有CLR異常打開了“Break When Thrown”配置,我發現實際的異常不是“服務不存在”。
在我的例子中,我為Actor服務留下了以下自動生成的方法,該方法將我的狀態設置為錯誤的狀態,后來我的代碼失敗了。
我需要做的就是刪除Visual Studio從我的方法創建的這個方法,並且它正常工作。
/// <summary>
/// This method is called whenever an actor is activated.
/// An actor is activated the first time any of its methods are invoked.
/// </summary>
protected override Task OnActivateAsync()
{
ActorEventSource.Current.ActorMessage(this, "Actor activated.");
// The StateManager is this actor's private state store.
// Data stored in the StateManager will be replicated for high-availability for actors that use volatile or persisted state storage.
// Any serializable object can be saved in the StateManager.
// For more information, see https://aka.ms/servicefabricactorsstateserialization
return this.StateManager.TryAddStateAsync("count", 0);
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.