0

I am using CosmosDB>BulkExecutor nuget in a .net Standard 2.0 project using this nuget (latest pre-release version 2.4.1 preview) reference link for bulk executor which says that it has support for .net standard 2.0 however errors out when performing linq operation on the collection

“One or more errors occurred. (, Request URI: /, RequestStats: , SDK: Windows/10.0.18363 documentdb-netcore-sdk/2.4.0)” 

Following is the code snippet :

var dburi = UriFactory.CreateDatabaseUri(databaseId); var collection = client.CreateDocumentCollectionQuery(dburi); var container = collection.Where(c => c.Id.Equals(containerId)).AsEnumerable().FirstOrDefault(); return container;

The error is thrown while performing linq operation where and First in line #3 above.

Following is a partial stack trace of the library:

   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Microsoft.Azure.Documents.Linq.DocumentQuery`1.<GetEnumerator>d__31.MoveNext()
   at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Boolean& found)
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   

This nuget documentation link is also confusing for Graph as it says if you are using “Bulk Executor” use the V3 version and looks like this V3 version does not have support for Graph API. So not sure how to use GraphBulkImport in cosmosdb.

José Pedro
  • 1,097
  • 3
  • 14
  • 24
  • Can you share the full stack trace? The code snippet you share does not seem to belong to the Graph Bulk Executor, so I would assume is something in your code? – Matias Quaranta Aug 05 '20 at 19:48
  • Thanks Matias for the response . There was a typo in my sdk url configuration. I wish there was better messaging though. I dont get this error now – Jitendra Mishra Aug 05 '20 at 23:56

2 Answers2

1

The issue was in my SDK url configuration . It was incorrect. After changing to the correct SDK url , I no longer get this error . Thanks to the people who responded.

There was a message saying InternalSErver error in the inner exception which made me recheck the url however a better message saying that there was a problem connecting to the source would have helped more

0

I think you may be using the wrong namespace in that package. For graph it should be Microsoft.Azure.CosmosDB.BulkExecutor.Graph.

There is an article here that walks through how to use Bulk Executor Library to do bulk graph import and should be helpful.

Mark Brown
  • 8,113
  • 2
  • 17
  • 21
  • Thanks Mark for the response . There was a typo in my sdk url configuration. I wish there was better messaging though. I dont get this error now – Jitendra Mishra Aug 05 '20 at 23:55