question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Vision.ClientException when running for the first time

See original GitHub issue

Hi,

when running for the first time after creating the services on Azure, I get the following exception. Since it does not really say much, could you help me troubleshoot it?

Initializing Services
Creating Synonym Map
Create the index
Boosting Documents
Sending a test image through the pipeline
01/25/2018 08:26:52 Info Processing blob:photo_jpg
Processing resized-image
Processing ocr-result
An Error has occured: System.AggregateException: One or more errors occurred. ---> Microsoft.ProjectOxford.Vision.ClientException: Exception of type 'Microsoft.ProjectOxford.Vision.ClientException' was thrown.
   at Microsoft.ProjectOxford.Vision.VisionServiceClient.HandleException(Exception exception)
   at Microsoft.ProjectOxford.Vision.VisionServiceClient.<SendAsync>b__39_1[TRequest,TResponse](Exception e)
   at System.AggregateException.Handle(Func`2 predicate)
   at Microsoft.ProjectOxford.Vision.VisionServiceClient.<SendAsync>d__39`2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at CallSite.Target(Closure , CallSite , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
   at Microsoft.ProjectOxford.Vision.VisionServiceClient.<RecognizeTextAsync>d__31.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.Cognitive.Skills.Vision.<GetText>d__6.MoveNext() in E:\Boulot\Genesys\Cloud Architects\Gennovation\AzureSearch_JFK_Files\Microsoft.Cognitive.Skills\Vision.cs:line 55
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.Cognitive.Skills.SkillSet`1.<>c__DisplayClass12_0`2.<<AddSkill>b__0>d.MoveNext() in E:\Boulot\Genesys\Cloud Architects\Gennovation\AzureSearch_JFK_Files\Microsoft.Cognitive.Skills\SkillSet.cs:line 85
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.Cognitive.Skills.Skill`1.<GetAsync>d__6.MoveNext() in E:\Boulot\Genesys\Cloud Architects\Gennovation\AzureSearch_JFK_Files\Microsoft.Cognitive.Skills\Skill.cs:line 41
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Microsoft.Cognitive.Skills.SkillSet`1.<ApplyAsync>d__5.MoveNext() in E:\Boulot\Genesys\Cloud Architects\Gennovation\AzureSearch_JFK_Files\Microsoft.Cognitive.Skills\SkillSet.cs:line 40
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at EnricherFunction.EnrichFunction.<Run>d__12.MoveNext() in E:\Boulot\Genesys\Cloud Architects\Gennovation\AzureSearch_JFK_Files\EnricherFunction\EnrichFunction.cs:line 172
   --- End of inner exception stack trace ---
   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 DataEnricher.Program.InitializeServices() in E:\Boulot\Genesys\Cloud Architects\Gennovation\AzureSearch_JFK_Files\DataEnricher\Program.cs:line 158
   at DataEnricher.Program.Main(String[] args) in E:\Boulot\Genesys\Cloud Architects\Gennovation\AzureSearch_JFK_Files\DataEnricher\Program.cs:line 30
---> (Inner Exception #0) Microsoft.ProjectOxford.Vision.ClientException: Exception of type 'Microsoft.ProjectOxford.Vision.ClientException' was thrown.
   at Microsoft.ProjectOxford.Vision.VisionServiceClient.HandleException(Exception exception)
   at Microsoft.ProjectOxford.Vision.VisionServiceClient.<SendAsync>b__39_1[TRequest,TResponse](Exception e)
   at System.AggregateException.Handle(Func`2 predicate)
   at Microsoft.ProjectOxford.Vision.VisionServiceClient.<SendAsync>d__39`2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at CallSite.Target(Closure , CallSite , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
   at Microsoft.ProjectOxford.Vision.VisionServiceClient.<RecognizeTextAsync>d__31.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.Cognitive.Skills.Vision.<GetText>d__6.MoveNext() in E:\Boulot\Genesys\Cloud Architects\Gennovation\AzureSearch_JFK_Files\Microsoft.Cognitive.Skills\Vision.cs:line 55
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.Cognitive.Skills.SkillSet`1.<>c__DisplayClass12_0`2.<<AddSkill>b__0>d.MoveNext() in E:\Boulot\Genesys\Cloud Architects\Gennovation\AzureSearch_JFK_Files\Microsoft.Cognitive.Skills\SkillSet.cs:line 85
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.Cognitive.Skills.Skill`1.<GetAsync>d__6.MoveNext() in E:\Boulot\Genesys\Cloud Architects\Gennovation\AzureSearch_JFK_Files\Microsoft.Cognitive.Skills\Skill.cs:line 41
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Microsoft.Cognitive.Skills.SkillSet`1.<ApplyAsync>d__5.MoveNext() in E:\Boulot\Genesys\Cloud Architects\Gennovation\AzureSearch_JFK_Files\Microsoft.Cognitive.Skills\SkillSet.cs:line 40
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at EnricherFunction.EnrichFunction.<Run>d__12.MoveNext() in E:\Boulot\Genesys\Cloud Architects\Gennovation\AzureSearch_JFK_Files\EnricherFunction\EnrichFunction.cs:line 172<---

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
CoromTcommented, Feb 5, 2018

Unfortunately, the ClientException thrown by the Vision API doesn’t indicate what the error is. This failure is occurring sending the test image through the pipeline, so the problem is most likely with either the API key being used or the endpoint. As Emmanuel pointed out the API will default to the westus region endpoint.

I’ll update the code so that this is in the configuration if you want to change it. In the meantime you can change this by changing line 23 of Microsoft.Cognitive.Skills\Vision.cs from: visionClient = new VisionServiceClient(visionApiKey); to: visionClient = new VisionServiceClient(visionApiKey, “northeurope.api.cognitive.microsoft.com”); where “northeurope.api.cognitive.microsoft.com” is the region you deployed the vision service to that are listed here: https://westus.dev.cognitive.microsoft.com/docs/services/56f91f2d778daf23d8ec6739/operations/56f91f2e778daf14a499e1fa

1reaction
torokzscommented, Feb 6, 2018

In Vision.cs line 23 the following modification helped me:

visionClient = new VisionServiceClient(visionApiKey, “https://westcentralus.api.cognitive.microsoft.com/vision/v1.0”);

Uri should be modified in line 142 as well:

var uri = “https://westcentralus.api.cognitive.microsoft.com/vision/v1.0/recognizeText?handwriting=true”;

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vision.ClientException when running for the first time · Issue #1
Hi, when running for the first time after creating the services on Azure, I get the following exception. Since it does not really...
Read more >
Troubleshoot common errors with API calls in Amazon ECS
The Amazon ECS APIs might fail with one of the following errors: AccessDeniedException; ClientException; ClusterNotFoundException ...
Read more >
Failed to run the WC DB work queue associated with file
Each time I do this I have to delete the records in the WORK_QUEUE table in wc.db and then do a cleanup before...
Read more >
My cloud hub application is frequently logging an error
This request will be retried after some backoff time. Reason: com.mulesoft.mule.runtime.gw.client.exception.HttpResponseException: Server returned wrong ...
Read more >
Solved: 503 error in Windows VC 6.5 - VMware Communities
Hello everyone. I've been getting 503 errors trying to connect to our VC6.5 Windows-based server. The environment is a three-host cluster running a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found