Azure AI Vision 3.2 GA Read OCR container Internal Server Error

Dennis 0 Reputation points
2025-10-25T00:23:31.99+00:00

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.LoadXmlCommentsT

         at Swashbuckle.AspNetCore.Swagger.SwaggerGenOptionsExtensions.ConfigureHullSwaggerT1

         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.GetRequiredServiceT

         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.GetRequiredServiceT

         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)

Computer Vision
Computer Vision
An Azure artificial intelligence service that analyzes content in images and video.
{count} votes

1 answer

Sort by: Most helpful
  1. SRILAKSHMI C 10,640 Reputation points Microsoft External Staff Moderator
    2025-10-27T01:43:48.2766667+00:00

    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:

    1. 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.

    1. 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.2
    

    If either VISION_API_KEY or VISION_API_ENDPOINT is missing, you’ll see this startup failure.

    1. Validate Environment Variables

    Run the following to confirm all required environment variables are set properly:

    docker inspect <container_name> | grep -i env
    

    Look for any blank or missing values, especially for VISION_API_ENDPOINT, BILLING, or VISION_API_KEY.

    1. 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.

    1. 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.

    1. 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
    
    1. Review Logs and Enable Verbose Diagnostics

    You already have console logging enabled, but for additional detail, try running with:

    -e ASPNETCORE_ENVIRONMENT=Development
    

    This will display deeper stack trace information and may help confirm whether the issue stems from a missing XML documentation file or endpoint initialization.

    1. 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 Install Azure AI Vision 3.2 GA Read OCR container

    I Hope this helps. Do let me know if you have any further queries.

    Thank you!

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.