imranmomin / Hangfire.AzureCosmosDb

Azure Cosmos DB storage provider for Hangfire
https://www.hangfire.io/
MIT License
17 stars 16 forks source link

UseAzureCosmosDbStorage Failure on start #26

Closed andyvig closed 3 years ago

andyvig commented 3 years ago

I get the following error when I try to wire up a simple console app. Any ideas what the issue might be? System.AggregateException: '(consistency: NotSet, prgns:[])pe: 65535, erd: Fal)'

GlobalConfiguration.Configuration.UseAzureCosmosDbStorage("<myuri>", "<mykey>", "<mycontainer>", "dev-hangfire");
var client = new BackgroundJobClient();
client.Enqueue(() => Console.WriteLine("Easy!"));

Stack: at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.Wait() at Hangfire.Azure.CosmosDbStorage.Initialize() at Hangfire.Azure.CosmosDbStorage..ctor(String url, String authSecret, String database, String collection, CosmosClientOptions options, CosmosDbStorageOptions storageOptions) at Hangfire.CosmosDbStorageExtensions.UseAzureCosmosDbStorage(IGlobalConfiguration configuration, String url, String authSecret, String database, String collection, CosmosClientOptions option, CosmosDbStorageOptions storageOptions) at HangfireConsoleTest.Program.Main(String[] args) in repos\HangfireConsoleTest\Program.cs:line 10

andyvig commented 3 years ago

Ahhh, I see, the container should NOT be created manually. I had set one up myself beforehand, once I deleted that things worked. Of course I realize this 2 minutes after I post this...