microsoft / AzureSearch_JFK_Files

This repo contains the sample code of the Azure Search and Cognitive Services used to provide insights and analysis around the JFK Files.
MIT License
388 stars 225 forks source link

Initializer exception at CheckIndexerStatus #110

Open glyphgitjembo opened 3 years ago

glyphgitjembo commented 3 years ago

When running the initializer I got this error: Error retrieving indexer status: Object reference not set to an instance of an object

I tried to debug where does it happen and it is on this line.

https://github.com/microsoft/AzureSearch_JFK_Files/blob/9ba42347a6285ce0b73b5bcb935e8c84852f9cfc/JfkWebApiSkills/JfkInitializer/Program.cs#L338

Trying to check info.Status it is running. But info.LastResult is null.

Careyjmac commented 3 years ago

Usually this is because the indexer hasn't started running yet. There is usually a little bit of a delay for the indexer to get going, and usually by the time you have built and deployed the website that delay is over so this code can successfully run, but it looks like in your case it wasn't, so sorry about that. It could also depend on if the region you selected for your search service to run in is currently busy with other jobs, in which case it may take a few minutes for there to be space for your newly created job.

glyphgitjembo commented 3 years ago

I tried to add an if info.LastResult == null check inside the while loop to continue checking with a cap of 30x. But still after thread sleep 3000 x30 still the info.LastResult is still null.

I haven't changed any region on the deployment settings. Search service is at South Central US. Is this the right region?

Careyjmac commented 3 years ago

Hmmm, it shouldn't take that long. South Central US is one of our busiest regions though. It should work but like I said might just take awhile. I am changing the default region to West US 2 to hopefully help with this in #111 and I was having no issues testing there over the last day or so.