Azure AI Vision 3.2 GA Read OCR container Internal Server Error
I'm getting an Internal Server Error when I try to run my docker container with the Azure AI Vision image. It worked last week and suddenly stopped working.
Any suggestions on how to fix that?
Here is my output from docker logs.
Using API key for authentication.
Using '/share' for shared mounts.
Logging to console.
Submitting metering to 'https://[removed].cognitiveservices.azure.com/'.
Is hosting: False
Build information: Computer Vision Read cv-3-2 2022-04-30 20250917.2-40a4109f
Logging to console.
Using file-based Object storage.
Hosting environment: Production
Content root path: /app
Now listening on: http://[::]:5000
Application started. Press Ctrl+C to shut down.
WARNING: Logging before InitGoogleLogging() is written to STDERR
I1024 23:56:19.449842 30 TextPipelineDevImpl.cpp:39] Text Pipeline initialize with option
I1024 23:56:19.450259 30 TextPipelineDevImpl.cpp:40] UseModelDelayLoad: 1
I1024 23:56:19.450269 30 EnvVarUtility.cpp:55] Environment variable "ONEOCR_INSTALL_FAILURES_SIGNAL_HANDLER": "0".
fail: Microsoft.CloudAI.Containers.Diagnostics.ExceptionMiddlewareV2[0]
Value cannot be null. (Parameter 'url') SubscriptionId='' RequestId='018cfd31-ca38-40e4-8ea6-e654b683bbca' Timestamp=''
System.ArgumentNullException: Value cannot be null. (Parameter 'url')
at System.ArgumentNullException.Throw(String paramName)
at System.ArgumentNullException.ThrowIfNull(Object argument, String paramName)
at System.ArgumentException.ThrowNullOrEmptyException(String argument, String paramName)
at System.ArgumentException.ThrowIfNullOrEmpty(String argument, String paramName)
at System.Xml.XmlTextReaderImpl..ctor(String url, XmlNameTable nt)
at System.Xml.XPath.XPathDocument..ctor(String uri, XmlSpace space)
at Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.<>c__DisplayClass46_0.<IncludeXmlComments>b__0()
at Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.IncludeXmlComments(SwaggerGenOptions swaggerGenOptions, Func`1 xmlDocFactory, Boolean includeControllerXmlComments)
at Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.IncludeXmlComments(SwaggerGenOptions swaggerGenOptions, String filePath, Boolean includeControllerXmlComments)
at Swashbuckle.AspNetCore.Swagger.SwaggerGenOptionsExtensions.LoadXmlComments
at Swashbuckle.AspNetCore.Swagger.SwaggerGenOptionsExtensions.ConfigureHullSwagger
at Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions.<>c__DisplayClass0_0.<AddOnpremCommonServices>b__1(SwaggerGenOptions c)
at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name)
at Microsoft.Extensions.Options.UnnamedOptionsManager`1.get_Value()
at Swashbuckle.AspNetCore.SwaggerGen.ConfigureSwaggerGeneratorOptions..ctor(IOptions`1 swaggerGenOptionsAccessor, IServiceProvider serviceProvider, IWebHostEnvironment hostingEnv)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier)
at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService
at Microsoft.Extensions.DependencyInjection.SwaggerGenServiceCollectionExtensions.<>c.<AddSwaggerGen>b__0_3(IServiceProvider s)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass2_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService
at Microsoft.Extensions.DependencyInjection.SwaggerGenServiceCollectionExtensions.<>c.<AddSwaggerGen>b__0_1(IServiceProvider s)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass2_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at lambda_method1(Closure, Object, HttpContext, IServiceProvider)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.TryServeStaticFile(HttpContext context, String contentType, PathString subPath)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.StaticFiles.DefaultFilesMiddleware.Invoke(HttpContext context)
at Microsoft.CloudAI.Containers.Security.ApiKeyGateMiddleware.Invoke(HttpContext httpContext)
at Microsoft.CloudAI.Containers.Diagnostics.RequestCorrelationMiddleware.InvokeRequestCorrelationMiddleware(HttpContext httpContext)
at Microsoft.CloudAI.Containers.Diagnostics.RequestCorrelationMiddleware.Invoke(HttpContext httpContext)
at Microsoft.CloudAI.Containers.Diagnostics.TrustedChannelMiddleware.InvokeHostedTrustedChannelMiddleware(HttpContext httpContext)
at Microsoft.CloudAI.Containers.Diagnostics.TrustedChannelMiddleware.Invoke(HttpContext httpContext)
at Microsoft.CloudAI.Containers.Diagnostics.ExceptionMiddlewareV2.Invoke(HttpContext httpContext)
-
SRILAKSHMI C 19,195 Reputation points • Microsoft External Staff • Moderator
Hi Dennis,
Did you get any chance to review the above response. Do let me know if you have any further queries.
Thank you!
-
SRILAKSHMI C 19,195 Reputation points • Microsoft External Staff • Moderator
Hi Dennis,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. In case if you have any resolution please do share that same with the community as it can be helpful to others. Otherwise, will respond with more details and we will try to help.
Thank you!
Sign in to comment
1 answer
-
SRILAKSHMI C 19,195 Reputation points • Microsoft External Staff • Moderator
Hello Dennis,
Welcome to Microsoft Q&A and thank you for reaching out.
I understand that you’re encountering an Internal Server Error while running the Azure AI Vision 3.2 (Read OCR) container, and the log trace shows a
System.ArgumentNullException: Value cannot be null (Parameter 'url')error. This typically indicates that one of the required parameters or environment variables (such as the endpoint or billing URL) was not properly initialized when the container started.Since you mentioned it was working last week and suddenly stopped, this could be caused by either a configuration/environment variable issue, a recent container image update, or a temporary backend issue.
Here’s a comprehensive approach to help troubleshoot and resolve this:
- Verify API Key and Endpoint
Make sure the API key and endpoint are correctly set and valid. If the endpoint or key is null, the service initialization will fail with the exact “Value cannot be null (Parameter 'url')” error. You can confirm your credentials in the Azure Portal → Cognitive Services → Keys and Endpoint section.
- Check Your Docker Run Command
Double-check that all required parameters are included, especially the billing and apikey parameters. Here’s the recommended command format:
docker run --rm -it -p 5000:5000 \ -e EULA=accept \ -e VISION_API_KEY=<your-key> \ -e VISION_API_ENDPOINT=https://<your-region>.api.cognitive.microsoft.com/ \ -v /path/to/shared:/share \ mcr.microsoft.com/azure-cognitive-services/vision/read:3.2If either
VISION_API_KEYorVISION_API_ENDPOINTis missing, you’ll see this startup failure.- Validate Environment Variables
Run the following to confirm all required environment variables are set properly:
docker inspect <container_name> | grep -i envLook for any blank or missing values, especially for
VISION_API_ENDPOINT,BILLING, orVISION_API_KEY.- Clear and Remount Volumes
If you’re using shared mounts (like
/share), clear any cached state and restart cleanly:docker rm -f vision-container docker run ...Old or corrupted cache files in the mounted volume can occasionally cause initialization issues.
- Test Network Connectivity
You can use the diagnostic container to check whether your endpoint and billing URLs are accessible:
docker pull mcr.microsoft.com/azure-cognitive-services/diagnostic docker run --rm mcr.microsoft.com/azure-cognitive-services/diagnostic \ eula=accept \ Billing={ENDPOINT_URI} \ ApiKey={API_KEY}Replace
{ENDPOINT_URI}and{API_KEY}with your actual endpoint and key values. If this test fails, the Vision container will not initialize properly.- Pull a Fresh Image
Since the logs show
Build information: cv-3-2 20250917.2-40a4109f, it’s possible that the container was recently updated. Pulling a fresh copy ensures you’re using the latest stable build:docker pull mcr.microsoft.com/azure-cognitive-services/vision/read:3.2- Review Logs and Enable Verbose Diagnostics
You already have console logging enabled, but for additional detail, try running with:
-e ASPNETCORE_ENVIRONMENT=DevelopmentThis will display deeper stack trace information and may help confirm whether the issue stems from a missing XML documentation file or endpoint initialization.
- Check for Recent Configuration or Service Changes
Since it was functioning last week, review whether there were:
- Any changes in your Azure endpoint or resource configuration
- Container host environment updates
- Or Azure service updates affecting container startup
Please refer this
- Troubleshooting Azure AI services containers
- Image Analysis inputs limits
- Docker troubleshooting with the diagnostic container
I Hope this helps. Do let me know if you have any further queries.
Thank you!
