Azure-Samples / azure-ai-vision-sdk

SDK for Microsoft's Azure AI Vision
MIT License
76 stars 46 forks source link

0x70 (SPXERR_COULD_NOT_CREATE_ENGINE_ADAPTER), Code: -1 #54

Closed Flickza closed 8 months ago

Flickza commented 8 months ago

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

The error I am getting comes from the OCR REST API v4.0. I don't know exactly what is causing the issue, the only thing that is different is if it's running locally or in the Azure app service.

Any log messages given by the failure

System.Exception: Reason: RuntimeError, Message: Exception with an error code: 0x70 (SPXERR_COULD_NOT_CREATE_ENGINE_ADAPTER), Code: -1

Expected/desired behavior

I have set up an endpoint that receives an image and some data from the front-end, this then repackages the image to send to Azure. I then retrieve the data from Azure, do some regex extraction, and do a db lookup. Bundle it and return it to the front end. This works locally but breaks in our Azure app service. The log message comes from the OCR REST API v4.0

OS and Version?

OS version: Microsoft Windows NT 10.0.14393.0 64 bit system: True 64 bit process: True Processor count: 2 CLR version: 4.0.30319.42000

Environment

Build 100.50921.6442.0 (Commit: e35b28e7cb)

Azure App Service 100.0.7.517

Mention any other details that might be useful

My Code (if relevant)

using Azure;
using Azure.AI.Vision.Common;
using Azure.AI.Vision.ImageAnalysis;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System.Text.Json;
using System.Text.RegularExpressions;

namespace Web.Controllers;
[ApiController]
[Route("api/")]
public class Controller : ControllerBase
{
    private readonly Settings _Settings;
    private readonly UserContext _userContext;
    private readonly ILogger _logger;

    public Controller(Settings Settings, UserContext userContext, ILogger<Controller> logger)
    {
        this._Settings = Settings;
        this._userContext = userContext;
        _logger = logger;
    }
    [HttpPost("ocr/from-image")]
    public async Task<ObjectResult> GetTextFromImage([FromForm] IFormFile image, CancellationToken cancellationToken)
    {
        try
        {
            // Validate keys & endpoint
            if (string.IsNullOrWhiteSpace(this._Settings.AzureAIVisionKey) || string.IsNullOrWhiteSpace(this._Settings.AzureAIVisionEndpoint))
            {
                return Problem("Invalid  settings found.");
            }
            // Validate image size
            if (!ValidateImageSize(image))
            {
                return BadRequest("File size exceeds 4MB.");
            }
            // Get text
            OcrResultWrapper? ocrResult;
            try
            {
                ocrResult = await ExtractTextFromImage(image, cancellationToken);
            }
            catch (Exception ex)
            {
                _logger.LogWarning(ex, "Unable to extract text from image.");
                return BadRequest($"{ex}");
            }

            if (ocrResult == null) return BadRequest($"Error retrieving text from image.");

            return Ok(ocrResult);

        }
        catch (Exception ex)
        {
            return BadRequest($"{ex}");
        }
    }
    private bool ValidateImageSize([FromForm] IFormFile image)
    {
        long sizeInBytes = image.Length;
        double sizeInKilobytes = sizeInBytes / 1024.0;
        double sizeInMegabytes = sizeInKilobytes / 1024.0;
        return sizeInMegabytes < 4;
    }
    private async Task<OcrResultWrapper?> ExtractTextFromImage([FromForm] IFormFile image, CancellationToken cancellationToken)
    {

        var serviceOptions = new VisionServiceOptions(this._Settings.AzureAIVisionEndpoint, new AzureKeyCredential(this._Settings.AzureAIVisionKey));

        if (image == null || image.Length == 0)
        {
            return null;
        }

        // Read the image data into a byte array
        using var memoryStream = new MemoryStream();
        await image.CopyToAsync(memoryStream);
        var imageBytes = memoryStream.ToArray();

        using var imageSourceBuffer = new ImageSourceBuffer();
        imageSourceBuffer.GetWriter().Write(imageBytes);
        using var imageSource = VisionSource.FromImageSourceBuffer(imageSourceBuffer);

        // Perform text extraction using the Computer Vision API
        var analysisOptions = new ImageAnalysisOptions()
        {
            Features = ImageAnalysisFeature.Text,
            Language = "en",
        };
        using var analyzer = new ImageAnalyzer(serviceOptions, imageSource, analysisOptions);

        var result = analyzer.Analyze();

        if (result.Reason == ImageAnalysisResultReason.Analyzed)
        {
            return result;
        }

        var errorDetails = ImageAnalysisErrorDetails.FromResult(result);
        throw new Exception($"Reason: {errorDetails.Reason}, Message: {errorDetails.Message}, Code: {errorDetails.ErrorCode}");

    }
}

Thanks! We'll be in touch soon.

dargilco commented 8 months ago

Hi @Flickza , this is Darren from the Vision SDK team. The error you cite is coming from the SDK itself, not from the service. Can you please re-run, but this time with SDK logs enabled? Share the SDK log here. These are the two lines you need to add to your C# source code to start and stop SDK logging:

Azure.AI.Vision.Common.Diagnostics.Logging.FileLogger.Start("c:\\path\\to\\sdk-log.txt");

... Your SDK calls here...

Azure.AI.Vision.Common.Diagnostics.Logging.FileLogger.Stop();

Also note, the service has 20MB image size limit, not 4MB (as I see a check for 4MB in your code).

Flickza commented 8 months ago

I will try this tomorrow when i am back at work and update you.

Flickza commented 8 months ago

Here are the logs I received. I have checked multiple times for missing dependencies but I don't see any missing.

[705500]: 116ms AZAC_TRACE_VERBOSE InteropSafeHandles.cs:59 Releasing handle 1B967C82928 Disposing: True
[705500]: 117ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:180 CSpxHandleTable::StopTracking(h) h=0x000001B967C82928
[705500]: 117ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:195 CSpxHandleTable::StopTracking(h) class=ISpxNamedProperties, h=0x000001B967C82928, p=0x000001B967C82928, tot=0
[705500]: 134ms SPX_DBG_TRACE_SCOPE_ENTER:  create_module_object.cpp:41 Session2_CreateModuleObject
[705500]: 152ms SPX_DBG_TRACE_SCOPE_EXIT:  create_module_object.cpp:41 Session2_CreateModuleObject
[705500]: 152ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:131 Created 'CSpxMediaFrameSource' as '950403736'
[705500]: 153ms SPX_DBG_TRACE_SCOPE_ENTER:  create_module_object.cpp:41 Session2_CreateModuleObject
[705500]: 154ms SPX_DBG_TRACE_SCOPE_ENTER:  vision_source.cpp:42 CSpxVisionSource::CSpxVisionSource
[705500]: 163ms SPX_DBG_TRACE_SCOPE_EXIT:  vision_source.cpp:42 CSpxVisionSource::CSpxVisionSource
[705500]: 163ms SPX_DBG_TRACE_SCOPE_EXIT:  create_module_object.cpp:41 Session2_CreateModuleObject
[705500]: 163ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:131 Created 'CSpxVisionSource' as '917166957'
[705500]: 163ms SPX_DBG_TRACE_VERBOSE:  media_frame_source.cpp:49 CSpxMediaFrameSource::Init
[705500]: 163ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:111 CSpxHandleTable::TrackHandle p=0x000001B966477E00
[705500]: 163ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:121 CSpxHandleTable::TrackHandle class=ISpxMediaFrameSource, h=0x000001B966477E00, p=0x000001B966477E00, tot=1
[705500]: 166ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:111 CSpxHandleTable::TrackHandle p=0x000001B966477C48
[705500]: 166ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:121 CSpxHandleTable::TrackHandle class=ISpxNamedProperties, h=0x000001B966477C48, p=0x000001B966477C48, tot=1
[705500]: 178ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:111 CSpxHandleTable::TrackHandle p=0x000001B966477CE0
[705500]: 178ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:121 CSpxHandleTable::TrackHandle class=ISpxMediaFrameWriter, h=0x000001B966477CE0, p=0x000001B966477CE0, tot=1
[705500]: 181ms SPX_DBG_TRACE_SCOPE_ENTER:  vision_source.cpp:154 CSpxVisionSource::InitMediaSource
[705500]: 181ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:131 Created 'CSpxMediaSourceWrapper' as '797580902'
[705500]: 201ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001BE74DBD618; name='adapter.streams.count'; value='1'
[705500]: 202ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001BE74DBD618; name='media.buffer.size.frames'; value='300'
[705500]: 202ms SPX_DBG_TRACE_SCOPE_EXIT:  vision_source.cpp:154 CSpxVisionSource::InitMediaSource
[705500]: 208ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:131 Created 'CSpxFrameBuffer' as '225257341'
[705500]: 208ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxNamedProperties::GetStringValue: this=0x000001BE74DBD618; name='media.buffer.size.frames'; value='300'
[705500]: 208ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxNamedProperties::GetStringValue: this=0x000001BE74DBD618; name='adapter.streams.count'; value='1'
[705500]: 208ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:131 Created 'CSpxFrame' as '288828509'
[705500]: 215ms SPX_TRACE_FUNCTION:  media_source_wrapper.cpp:155 CSpxMediaSourceWrapper::NotifyFramesReady
[705500]: 215ms SPX_DBG_TRACE_VERBOSE:  media_source_wrapper.cpp:194 [000001B966481398][Enqueue] ThreadService Background. Size: 1, Source: CSpxMediaSourceWrapper::NotifyFramesReady (194)
[705500]: 215ms SPX_DBG_TRACE_SCOPE_ENTER:  create_module_object.cpp:41 Session2_CreateModuleObject
[705500]: 215ms SPX_DBG_TRACE_SCOPE_EXIT:  create_module_object.cpp:41 Session2_CreateModuleObject
[705500]: 215ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:131 Created 'CSpxThreadService' as '303073113'
[705500]: 216ms SPX_TRACE_INFO:  thread_service.cpp:92 Started thread Background with ID [63245ll]
[705500]: 216ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:111 CSpxHandleTable::TrackHandle p=0x000001BE74DBD750
[705500]: 217ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:121 CSpxHandleTable::TrackHandle class=ISpxVisionSource, h=0x000001BE74DBD750, p=0x000001BE74DBD750, tot=1
[705500]: 218ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:111 CSpxHandleTable::TrackHandle p=0x000001BE74DBD618
[705500]: 218ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:121 CSpxHandleTable::TrackHandle class=ISpxNamedProperties, h=0x000001BE74DBD618, p=0x000001BE74DBD618, tot=2
[705500]: 240ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:131 Created 'CSpxNamedProperties' as '876984227'
[705500]: 240ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:111 CSpxHandleTable::TrackHandle p=0x000001B967C84B48
[705500]: 240ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:121 CSpxHandleTable::TrackHandle class=ISpxNamedProperties, h=0x000001B967C84B48, p=0x000001B967C84B48, tot=3
[705500]: 242ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C84B48; name='service.endpoint'; value='https://********.cognitiveservices.azure.com/'
[705500]: 242ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C84B48; name='adapter.passthrough'; value='true'
[705500]: 242ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C84B48; name='source.file.max.size'; value='20971520'
[705500]: 242ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C84B48; name='source.file.type'; value='512'
[705500]: 243ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C84B48; name='image.analysis.option.visualfeatures'; value='read'
[705500]: 243ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C84B48; name='image.analysis.option.language'; value='en'
[705500]: 243ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:111 CSpxHandleTable::TrackHandle p=0x000001B967C84B48
[705500]: 243ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:121 CSpxHandleTable::TrackHandle class=ISpxNamedProperties, h=0x000001B967C84B48, p=0x000001B967C84B48, tot=4
[705500]: 243ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:131 Created 'CSpxNamedProperties' as '876984227'
[705500]: 243ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:111 CSpxHandleTable::TrackHandle p=0x000001B967C83D48
[705500]: 243ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:121 CSpxHandleTable::TrackHandle class=ISpxNamedProperties, h=0x000001B967C83D48, p=0x000001B967C83D48, tot=5
[705500]: 244ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:135 ISpxNamedProperties::Copy from=0x67c84b48 to=0x67c83d48
[705500]: 245ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C83D48; name='adapter.passthrough'; value='true'
[705500]: 245ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C83D48; name='image.analysis.option.language'; value='en'
[705500]: 245ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C83D48; name='image.analysis.option.visualfeatures'; value='read'
[705500]: 245ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C83D48; name='service.endpoint'; value='https://********.cognitiveservices.azure.com/'
[705500]: 245ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C83D48; name='source.file.max.size'; value='20971520'
[705500]: 245ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C83D48; name='source.file.type'; value='512'
[705500]: 245ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C83D48; name='AZAC-SDK-PROGRAMMING-LANGUAGE'; value='net'
[705500]: 245ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:135 ISpxNamedProperties::Copy from=0x67c83d48 to=0x74dbd618
[705500]: 245ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001BE74DBD618; name='AZAC-SDK-PROGRAMMING-LANGUAGE'; value='net'
[705500]: 245ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001BE74DBD618; name='adapter.passthrough'; value='true'
[705500]: 245ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001BE74DBD618; name='image.analysis.option.language'; value='en'
[705500]: 245ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001BE74DBD618; name='image.analysis.option.visualfeatures'; value='read'
[705500]: 245ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001BE74DBD618; name='service.endpoint'; value='https://********.cognitiveservices.azure.com/'
[705500]: 245ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001BE74DBD618; name='source.file.max.size'; value='20971520'
[705500]: 246ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001BE74DBD618; name='source.file.type'; value='512'
[705500]: 246ms SPX_DBG_TRACE_SCOPE_ENTER:  create_module_object.cpp:41 Session2_CreateModuleObject
[63245]: 248ms SPX_DBG_TRACE_SCOPE_ENTER:  media_source_wrapper.cpp:194 CSpxMediaSourceWrapper::NotifyFramesReady
[63245]: 248ms SPX_DBG_TRACE_VERBOSE:  media_source_wrapper.cpp:194 [000001B966481398][Dequeue] ThreadService Background. Size: 0, Source: CSpxMediaSourceWrapper::NotifyFramesReady (194)
[63245]: 248ms SPX_DBG_TRACE_SCOPE_EXIT:  media_source_wrapper.cpp:194 CSpxMediaSourceWrapper::NotifyFramesReady
[705500]: 255ms SPX_DBG_TRACE_SCOPE_ENTER:  session2.cpp:63 CSpxSession2::CSpxSession2
[705500]: 255ms SPX_DBG_TRACE_SCOPE_EXIT:  session2.cpp:63 CSpxSession2::CSpxSession2
[705500]: 255ms SPX_DBG_TRACE_SCOPE_EXIT:  create_module_object.cpp:41 Session2_CreateModuleObject
[705500]: 255ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:131 Created 'CSpxSession2' as '719828142'
[705500]: 255ms SPX_DBG_TRACE_SCOPE_ENTER:  session2.cpp:90 CSpxSession2::Init
[705500]: 255ms SPX_DBG_TRACE_SCOPE_EXIT:  session2.cpp:90 CSpxSession2::Init
[705500]: 255ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:111 CSpxHandleTable::TrackHandle p=0x000001BE74F5DAB8
[705500]: 255ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:121 CSpxHandleTable::TrackHandle class=ISpxSession2, h=0x000001BE74F5DAB8, p=0x000001BE74F5DAB8, tot=1
[705500]: 256ms AZAC_TRACE_VERBOSE InteropSafeHandles.cs:59 Releasing handle 1B967C83D48 Disposing: True
[705500]: 256ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:180 CSpxHandleTable::StopTracking(h) h=0x000001B967C83D48
[705500]: 256ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:195 CSpxHandleTable::StopTracking(h) class=ISpxNamedProperties, h=0x000001B967C83D48, p=0x000001B967C83D48, tot=4
[705500]: 256ms AZAC_TRACE_VERBOSE InteropSafeHandles.cs:59 Releasing handle 1B967C84B48 Disposing: True
[705500]: 256ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:180 CSpxHandleTable::StopTracking(h) h=0x000001B967C84B48
[705500]: 256ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:195 CSpxHandleTable::StopTracking(h) class=ISpxNamedProperties, h=0x000001B967C84B48, p=0x000001B967C84B48, tot=3
[705500]: 257ms SPX_DBG_TRACE_SCOPE_ENTER:  create_module_object.cpp:41 Session2_CreateModuleObject
[705500]: 257ms SPX_DBG_TRACE_SCOPE_ENTER:  session2_view.cpp:23 CSpxSession2View::CSpxSession2View
[705500]: 257ms SPX_DBG_TRACE_SCOPE_EXIT:  session2_view.cpp:23 CSpxSession2View::CSpxSession2View
[705500]: 257ms SPX_DBG_TRACE_SCOPE_EXIT:  create_module_object.cpp:41 Session2_CreateModuleObject
[705500]: 257ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:131 Created 'CSpxSession2View' as '688556507'
[705500]: 257ms SPX_DBG_TRACE_SCOPE_ENTER:  session2_view.cpp:47 CSpxSession2View::Init
[705500]: 257ms SPX_DBG_TRACE_VERBOSE:  session2.cpp:185 [000001BE74F5DAB8][Enqueue] ThreadService Background. Size: 1, Source: CSpxSession2::AddSessionView (185)
[705500]: 257ms SPX_DBG_TRACE_SCOPE_EXIT:  session2_view.cpp:47 CSpxSession2View::Init
[705500]: 257ms SPX_DBG_TRACE_SCOPE_ENTER:  session2_view.cpp:85 CSpxSession2View::InitFromProperties
[705500]: 257ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001BE75121288; name='session.view.kind'; value='image.analyzer'
[705500]: 257ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:135 ISpxNamedProperties::Copy from=0x67c84b48 to=0x75121288
[705500]: 257ms SPX_DBG_TRACE_SCOPE_ENTER:  create_module_object.cpp:41 Session2_CreateModuleObject
[705500]: 257ms SPX_DBG_TRACE_SCOPE_EXIT:  create_module_object.cpp:41 Session2_CreateModuleObject
[705500]: 257ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:131 Created 'CSpxSession2ViewPropertyAdapter' as '876984227'
[705500]: 257ms SPX_DBG_TRACE_SCOPE_ENTER:  session2_view_property_adapter.cpp:16 CSpxSession2ViewPropertyAdapter::InitDelegatePtr
[705500]: 257ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxNamedProperties::GetStringValue: this=0x000001BE75121288; name='session.view.kind'; value='image.analyzer'
[705500]: 257ms SPX_DBG_TRACE_SCOPE_ENTER:  create_module_object.cpp:41 Session2_CreateModuleObject
[705500]: 257ms SPX_DBG_TRACE_SCOPE_EXIT:  create_module_object.cpp:41 Session2_CreateModuleObject
[705500]: 257ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:131 Created 'CSpxImageAnalyzerViewPropertyAdapter' as '876984227'
[705500]: 257ms SPX_DBG_TRACE_SCOPE_EXIT:  session2_view_property_adapter.cpp:16 CSpxSession2ViewPropertyAdapter::InitDelegatePtr
[705500]: 257ms SPX_DBG_TRACE_SCOPE_ENTER:  image_analyzer_view_property_adapter.cpp:19 CSpxImageAnalyzerViewPropertyAdapter::InitDelegatePtr
[705500]: 257ms SPX_DBG_TRACE_SCOPE_ENTER:  create_module_object.cpp:41 Session2_CreateModuleObject
[705500]: 257ms SPX_DBG_TRACE_SCOPE_EXIT:  create_module_object.cpp:41 Session2_CreateModuleObject
[705500]: 257ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:131 Created 'CSpxImageAnalyzerPropertyAdapter' as '876984227'
[705500]: 257ms SPX_DBG_TRACE_SCOPE_ENTER:  image_analyzer_property_adapter.cpp:18 CSpxImageAnalyzerPropertyAdapter::Init
[705500]: 257ms SPX_DBG_TRACE_SCOPE_EXIT:  image_analyzer_property_adapter.cpp:18 CSpxImageAnalyzerPropertyAdapter::Init
[705500]: 257ms SPX_DBG_TRACE_SCOPE_EXIT:  image_analyzer_view_property_adapter.cpp:19 CSpxImageAnalyzerViewPropertyAdapter::InitDelegatePtr
[705500]: 257ms SPX_DBG_TRACE_SCOPE_EXIT:  session2_view.cpp:85 CSpxSession2View::InitFromProperties
[705500]: 257ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:111 CSpxHandleTable::TrackHandle p=0x000001BE75121390
[705500]: 257ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:121 CSpxHandleTable::TrackHandle class=ISpxSession2View, h=0x000001BE75121390, p=0x000001BE75121390, tot=1
[705500]: 259ms AZAC_TRACE_VERBOSE InteropSafeHandles.cs:59 Releasing handle 1B967C84B48 Disposing: True
[705500]: 259ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:180 CSpxHandleTable::StopTracking(h) h=0x000001B967C84B48
[705500]: 259ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:195 CSpxHandleTable::StopTracking(h) class=ISpxNamedProperties, h=0x000001B967C84B48, p=0x000001B967C84B48, tot=2
[705500]: 259ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:111 CSpxHandleTable::TrackHandle p=0x000001BE74F5D828
[705500]: 259ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:121 CSpxHandleTable::TrackHandle class=ISpxNamedProperties, h=0x000001BE74F5D828, p=0x000001BE74F5D828, tot=3
[705500]: 263ms SPX_DBG_TRACE_VERBOSE:  session2.cpp:334 [000001BE74F5DAB8][Enqueue] ThreadService Background. Size: 2, Source: CSpxSession2::FutureStartSingleShot (334)
[705500]: 263ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:111 CSpxHandleTable::TrackHandle p=0x000001BE78483BC0
[705500]: 263ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:121 CSpxHandleTable::TrackHandle class=CSpxAsyncOp<std::shared_ptr<ISpxRecognitionResult2>>, h=0x000001BE78483BC0, p=0x000001BE78483BC0, tot=1
[63245]: 264ms SPX_DBG_TRACE_SCOPE_ENTER:  session2.cpp:185 CSpxSession2::AddSessionView
[63245]: 264ms SPX_DBG_TRACE_VERBOSE:  session2.cpp:185 [000001BE74F5DAB8][Dequeue] ThreadService Background. Size: 1, Source: CSpxSession2::AddSessionView (185)
[63245]: 264ms SPX_DBG_TRACE_SCOPE_EXIT:  session2.cpp:185 CSpxSession2::AddSessionView
[63245]: 264ms SPX_DBG_TRACE_SCOPE_ENTER:  session2.cpp:334 CSpxSession2::FutureStartSingleShot
[63245]: 264ms SPX_DBG_TRACE_VERBOSE:  session2.cpp:334 [000001BE74F5DAB8][Dequeue] ThreadService Background. Size: 0, Source: CSpxSession2::FutureStartSingleShot (334)
[63245]: 264ms SPX_DBG_TRACE_VERBOSE:  session2_partial_adapter2_promise_wrapper.h:112 Promising result...
[63245]: 264ms SPX_DBG_TRACE_SCOPE_ENTER:  create_module_object.cpp:41 Session2_CreateModuleObject
[63245]: 264ms SPX_DBG_TRACE_SCOPE_EXIT:  create_module_object.cpp:41 Session2_CreateModuleObject
[63245]: 265ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:131 Created 'CSpxSession2Adapter' as '138230148'
[63245]: 265ms SPX_TRACE_INFO:  reco_engine_adapter2_track_delegate_impl.h:31 ISpxRecoEngineAdapter2TrackDelegateImpl::shouldSendModeChangeNotifications(): true
[63245]: 265ms SPX_TRACE_INFO:  reco_engine_adapter2_mode_tracker.h:43 CSpxRecoEngineAdapter2ModeTracker::StartMode() sendNotifications: true
[63245]: 265ms SPX_DBG_TRACE_VERBOSE:  session2_adapter.cpp:20 [000001BE754D2470][Enqueue] ThreadService Background. Size: 1, Source: CSpxSession2Adapter::OnModeChanging (20)
[63245]: 265ms SPX_DBG_TRACE_VERBOSE:  session2_adapter.cpp:29 [000001BE754D2470][Enqueue] ThreadService Background. Size: 2, Source: CSpxSession2Adapter::OnModeChanged (29)
[63245]: 265ms SPX_DBG_TRACE_SCOPE_ENTER:  create_module_object.cpp:41 Session2_CreateModuleObject
[63245]: 265ms SPX_DBG_TRACE_SCOPE_EXIT:  create_module_object.cpp:41 Session2_CreateModuleObject
[63245]: 265ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:131 Created 'CSpxSession2AdapterExceptionGuard' as '138230148'
[63245]: 265ms SPX_DBG_TRACE_SCOPE_ENTER:  create_module_object.cpp:41 Session2_CreateModuleObject
[63245]: 265ms SPX_DBG_TRACE_SCOPE_EXIT:  create_module_object.cpp:41 Session2_CreateModuleObject
[63245]: 265ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:131 Created 'CSpxSession2AdapterCreator' as '138230148'
[63245]: 265ms SPX_DBG_TRACE_SCOPE_ENTER:  session2_adapter_creator.cpp:19 CSpxSession2AdapterCreator::InitDelegatePtr
[63245]: 265ms SPX_DBG_TRACE_SCOPE_ENTER:  image_analyzer_property_adapter.cpp:23 CSpxImageAnalyzerPropertyAdapter::GetRecoEngineAdapter
[63245]: 265ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxNamedProperties::GetStringValue: this=0x000001B967C46318; name='reco.engine.adapter'; value='image-analysis'
[63245]: 265ms SPX_TRACE_INFO:  image_analyzer_property_adapter.cpp:31 CSpxImageAnalyzerPropertyAdapter::GetRecoEngineAdapter(): recoEngineAdapter: image-analysis
[63245]: 265ms SPX_DBG_TRACE_SCOPE_EXIT:  image_analyzer_property_adapter.cpp:23 CSpxImageAnalyzerPropertyAdapter::GetRecoEngineAdapter
[63245]: 265ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxNamedProperties::GetStringValue: this=0x000001B967B866A8; name='reco.engine.adapter'; value='image-analysis'
[63245]: 265ms SPX_DBG_TRACE_SCOPE_ENTER:  create_module_object.cpp:41 Session2_CreateModuleObject
[63245]: 265ms SPX_DBG_TRACE_SCOPE_EXIT:  create_module_object.cpp:41 Session2_CreateModuleObject
[63245]: 265ms SPX_TRACE_WARNING: resource_manager.cpp:139 Failed to create 'CSpxImageAnalyzerRecoEngineAdapter' as '138230148'. Are all required extension libraries loaded?
[63245]: 265ms SPX_DBG_TRACE_WARNING: session2_adapter_creator.cpp:28 Couldn't create engine adapter; zombified...
[63245]: 1231ms SPX_DBG_TRACE_SCOPE_EXIT:  session2_adapter_creator.cpp:19 CSpxSession2AdapterCreator::InitDelegatePtr
[63245]: 1239ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:131 Created 'CSpxNamedProperties' as '876984227'
[63245]: 1239ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C81428; name='error.unhandled.exception'; value='Exception with an error code: 0x70 (SPXERR_COULD_NOT_CREATE_ENGINE_ADAPTER)'
[63245]: 1239ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C81428; name='error.message'; value='Exception with an error code: 0x70 (SPXERR_COULD_NOT_CREATE_ENGINE_ADAPTER)'
[63245]: 1239ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C81428; name='error.reason'; value='9'
[63245]: 1239ms SPX_DBG_TRACE_VERBOSE:  session2_adapter.cpp:65 [000001BE754D2470][Enqueue] ThreadService Background. Size: 3, Source: CSpxSession2Adapter::NotifyOnAdapterError (65)
[63245]: 1239ms SPX_DBG_TRACE_SCOPE_EXIT:  session2.cpp:334 CSpxSession2::FutureStartSingleShot
[63245]: 1239ms SPX_DBG_TRACE_SCOPE_ENTER:  session2_adapter.cpp:20 CSpxSession2Adapter::OnModeChanging
[63245]: 1239ms SPX_DBG_TRACE_VERBOSE:  session2_adapter.cpp:20 [000001BE754D2470][Dequeue] ThreadService Background. Size: 2, Source: CSpxSession2Adapter::OnModeChanging (20)
[63245]: 1239ms SPX_DBG_TRACE_SCOPE_ENTER:  session2.cpp:269 CSpxSession2::NotifyOnModeChanging
[63245]: 1239ms SPX_DBG_TRACE_VERBOSE:  session2.cpp:270 Mode changing; old=0, new=1, ptr=0x74F5D7E0
[63245]: 1239ms SPX_DBG_TRACE_SCOPE_EXIT:  session2.cpp:269 CSpxSession2::NotifyOnModeChanging
[63245]: 1239ms SPX_DBG_TRACE_SCOPE_EXIT:  session2_adapter.cpp:20 CSpxSession2Adapter::OnModeChanging
[63245]: 1239ms SPX_DBG_TRACE_SCOPE_ENTER:  session2_adapter.cpp:29 CSpxSession2Adapter::OnModeChanged
[63245]: 1239ms SPX_DBG_TRACE_VERBOSE:  session2_adapter.cpp:29 [000001BE754D2470][Dequeue] ThreadService Background. Size: 1, Source: CSpxSession2Adapter::OnModeChanged (29)
[63245]: 1239ms SPX_DBG_TRACE_SCOPE_ENTER:  session2.cpp:278 CSpxSession2::NotifyOnModeChanged
[63245]: 1239ms SPX_DBG_TRACE_VERBOSE:  session2.cpp:279 Mode changed; old=0, new=1, ptr=0x74F5D7E0
[63245]: 1239ms SPX_DBG_TRACE_VERBOSE:  session2_partial_adapter2_promise_wrapper.h:143 Checking mode promises... mode=1
[63245]: 1239ms SPX_DBG_TRACE_SCOPE_ENTER:  create_module_object.cpp:41 Session2_CreateModuleObject
[63245]: 1239ms SPX_DBG_TRACE_SCOPE_EXIT:  create_module_object.cpp:41 Session2_CreateModuleObject
[63245]: 1239ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:131 Created 'CSpxSession2EventArgs' as '359354704'
[63245]: 1239ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C465F8; name='event.name'; value='session.started'
[63245]: 1239ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C465F8; name='result.pos'; value='-9223372036854775808'
[63245]: 1239ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C465F8; name='result.unit'; value='1'
[63245]: 1239ms SPX_DBG_TRACE_SCOPE_ENTER:  session2.cpp:303 CSpxSession2::NotifyOnAdapterEvent
[63245]: 1239ms SPX_DBG_TRACE_VERBOSE:  session2.cpp:305 Adapter event; name='session.started'
[63245]: 1239ms SPX_DBG_TRACE_VERBOSE:  session2_partial_site_event_helper.h:60 Firing event: session.started
[63245]: 1239ms SPX_DBG_TRACE_VERBOSE:  session2.cpp:309 [000001BE74F5DAB8][Enqueue] ThreadService User. Size: 2, Source: CSpxSession2::NotifyOnAdapterEvent (309)
[63245]: 1239ms SPX_TRACE_INFO:  thread_service.cpp:92 Started thread User with ID [589683ll]
[63245]: 1239ms SPX_DBG_TRACE_SCOPE_EXIT:  session2.cpp:303 CSpxSession2::NotifyOnAdapterEvent
[63245]: 1239ms SPX_DBG_TRACE_SCOPE_EXIT:  session2.cpp:278 CSpxSession2::NotifyOnModeChanged
[63245]: 1239ms SPX_DBG_TRACE_SCOPE_EXIT:  session2_adapter.cpp:29 CSpxSession2Adapter::OnModeChanged
[63245]: 1239ms SPX_DBG_TRACE_SCOPE_ENTER:  session2_adapter.cpp:65 CSpxSession2Adapter::NotifyOnAdapterError
[63245]: 1239ms SPX_DBG_TRACE_VERBOSE:  session2_adapter.cpp:65 [000001BE754D2470][Dequeue] ThreadService Background. Size: 1, Source: CSpxSession2Adapter::NotifyOnAdapterError (65)
[63245]: 1240ms SPX_DBG_TRACE_SCOPE_ENTER:  create_module_object.cpp:41 Session2_CreateModuleObject
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B901AEE2B8; name='result.id'; value='9cc27b531c014671af081faabea173fd'
[63245]: 1240ms SPX_DBG_TRACE_SCOPE_EXIT:  create_module_object.cpp:41 Session2_CreateModuleObject
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:131 Created 'CSpxRecognitionResult2' as '507662804'
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B901AEE2B8; name='result.name'; value='error'
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B901AEE2B8; name='result.pos'; value='0'
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B901AEE2B8; name='result.unit'; value='1'
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:135 ISpxNamedProperties::Copy from=0x67c81428 to=0x1aee2b8
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B901AEE2B8; name='error.message'; value='Exception with an error code: 0x70 (SPXERR_COULD_NOT_CREATE_ENGINE_ADAPTER)'
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B901AEE2B8; name='error.reason'; value='9'
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B901AEE2B8; name='error.unhandled.exception'; value='Exception with an error code: 0x70 (SPXERR_COULD_NOT_CREATE_ENGINE_ADAPTER)'
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B901AEE2B8; name='result.reason'; value='1'
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B901AEE2B8; name='session.stopped.reason'; value='-1'
[63245]: 1240ms SPX_DBG_TRACE_SCOPE_ENTER:  create_module_object.cpp:41 Session2_CreateModuleObject
[63245]: 1240ms SPX_DBG_TRACE_SCOPE_EXIT:  create_module_object.cpp:41 Session2_CreateModuleObject
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:131 Created 'CSpxSession2EventArgs' as '359354704'
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C43AF8; name='event.name'; value='error'
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C43AF8; name='result.pos'; value='0'
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C43AF8; name='result.unit'; value='1'
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:135 ISpxNamedProperties::Copy from=0x67c81428 to=0x67c43af8
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C43AF8; name='error.message'; value='Exception with an error code: 0x70 (SPXERR_COULD_NOT_CREATE_ENGINE_ADAPTER)'
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C43AF8; name='error.reason'; value='9'
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C43AF8; name='error.unhandled.exception'; value='Exception with an error code: 0x70 (SPXERR_COULD_NOT_CREATE_ENGINE_ADAPTER)'
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C43AF8; name='session.stopped.reason'; value='-1'
[63245]: 1240ms SPX_DBG_TRACE_SCOPE_ENTER:  session2.cpp:303 CSpxSession2::NotifyOnAdapterEvent
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  session2.cpp:305 Adapter event; name='error'
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  session2_partial_site_event_helper.h:60 Firing event: error
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  session2.cpp:309 [000001BE74F5DAB8][Enqueue] ThreadService User. Size: 2, Source: CSpxSession2::NotifyOnAdapterEvent (309)
[63245]: 1240ms SPX_TRACE_INFO:  reco_engine_adapter2_track_delegate_impl.h:40 ISpxRecoEngineAdapter2TrackDelegateImpl::GetAdapterMode()
[63245]: 1240ms SPX_TRACE_WARNING: reco_engine_adapter2_track_delegate_impl.h:43 GetAdapterMode mismatch: tracked=1, delegated=0
[63245]: 1240ms SPX_TRACE_INFO:  reco_engine_adapter2_track_delegate_impl.h:31 ISpxRecoEngineAdapter2TrackDelegateImpl::shouldSendModeChangeNotifications(): true
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  session2_partial_adapter2_promise_wrapper.h:87 Completing result promises...
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  session2_partial_adapter2_promise_wrapper.h:96 Completing result promise callbacks...
[63245]: 1240ms SPX_DBG_TRACE_SCOPE_EXIT:  session2.cpp:303 CSpxSession2::NotifyOnAdapterEvent
[63245]: 1240ms SPX_TRACE_INFO:  reco_engine_adapter2_track_delegate_impl.h:40 ISpxRecoEngineAdapter2TrackDelegateImpl::GetAdapterMode()
[63245]: 1240ms SPX_TRACE_WARNING: reco_engine_adapter2_track_delegate_impl.h:43 GetAdapterMode mismatch: tracked=1, delegated=0
[63245]: 1240ms SPX_TRACE_INFO:  reco_engine_adapter2_track_delegate_impl.h:31 ISpxRecoEngineAdapter2TrackDelegateImpl::shouldSendModeChangeNotifications(): true
[63245]: 1240ms SPX_DBG_TRACE_WARNING: session2_adapter.cpp:78 CheckSwitchModeAfterError: Stopping mode=1
[63245]: 1240ms SPX_TRACE_INFO:  reco_engine_adapter2_track_delegate_impl.h:31 ISpxRecoEngineAdapter2TrackDelegateImpl::shouldSendModeChangeNotifications(): true
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  session2_adapter.cpp:29 [000001BE754D2470][Enqueue] ThreadService Background. Size: 3, Source: CSpxSession2Adapter::OnModeChanged (29)
[63245]: 1240ms SPX_DBG_TRACE_SCOPE_EXIT:  session2_adapter.cpp:65 CSpxSession2Adapter::NotifyOnAdapterError
[63245]: 1240ms SPX_DBG_TRACE_SCOPE_ENTER:  session2_adapter.cpp:29 CSpxSession2Adapter::OnModeChanged
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  session2_adapter.cpp:29 [000001BE754D2470][Dequeue] ThreadService Background. Size: 2, Source: CSpxSession2Adapter::OnModeChanged (29)
[63245]: 1240ms SPX_DBG_TRACE_SCOPE_ENTER:  session2.cpp:278 CSpxSession2::NotifyOnModeChanged
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  session2.cpp:279 Mode changed; old=1, new=0, ptr=0x74F5D7E0
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  session2_partial_adapter2_promise_wrapper.h:143 Checking mode promises... mode=0
[63245]: 1240ms SPX_DBG_TRACE_SCOPE_ENTER:  create_module_object.cpp:41 Session2_CreateModuleObject
[63245]: 1240ms SPX_DBG_TRACE_SCOPE_EXIT:  create_module_object.cpp:41 Session2_CreateModuleObject
[63245]: 1240ms SPX_DBG_TRACE_VERBOSE:  resource_manager.cpp:131 Created 'CSpxSession2EventArgs' as '359354704'
[63245]: 1241ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C437F8; name='event.name'; value='session.stopped'
[63245]: 1241ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C437F8; name='result.pos'; value='1'
[63245]: 1241ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C437F8; name='result.unit'; value='1'
[63245]: 1241ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:135 ISpxNamedProperties::Copy from=0x67c81428 to=0x67c437f8
[63245]: 1241ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C437F8; name='error.message'; value='Exception with an error code: 0x70 (SPXERR_COULD_NOT_CREATE_ENGINE_ADAPTER)'
[63245]: 1241ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C437F8; name='error.reason'; value='9'
[63245]: 1241ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C437F8; name='error.unhandled.exception'; value='Exception with an error code: 0x70 (SPXERR_COULD_NOT_CREATE_ENGINE_ADAPTER)'
[63245]: 1241ms SPX_DBG_TRACE_VERBOSE:  named_properties.h:478 ISpxPropertyBagImpl::SetStringValue: this=0x000001B967C437F8; name='session.stopped.reason'; value='-1'
[63245]: 1241ms SPX_DBG_TRACE_SCOPE_ENTER:  session2.cpp:303 CSpxSession2::NotifyOnAdapterEvent
[63245]: 1241ms SPX_DBG_TRACE_VERBOSE:  session2.cpp:305 Adapter event; name='session.stopped'
[63245]: 1241ms SPX_DBG_TRACE_VERBOSE:  session2_partial_site_event_helper.h:60 Firing event: session.stopped
[63245]: 1241ms SPX_DBG_TRACE_VERBOSE:  session2.cpp:309 [000001BE74F5DAB8][Enqueue] ThreadService User. Size: 3, Source: CSpxSession2::NotifyOnAdapterEvent (309)
[63245]: 1241ms SPX_DBG_TRACE_SCOPE_EXIT:  session2.cpp:303 CSpxSession2::NotifyOnAdapterEvent
[63245]: 1241ms SPX_DBG_TRACE_SCOPE_EXIT:  session2.cpp:278 CSpxSession2::NotifyOnModeChanged
[63245]: 1241ms SPX_DBG_TRACE_SCOPE_EXIT:  session2_adapter.cpp:29 CSpxSession2Adapter::OnModeChanged
[705500]: 1241ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:111 CSpxHandleTable::TrackHandle p=0x000001B901AEE340
[705500]: 1241ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:121 CSpxHandleTable::TrackHandle class=ISpxRecognitionResult2, h=0x000001B901AEE340, p=0x000001B901AEE340, tot=1
[705500]: 1241ms AZAC_TRACE_VERBOSE InteropSafeHandles.cs:59 Releasing handle 1BE78483BC0 Disposing: True
[705500]: 1242ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:180 CSpxHandleTable::StopTracking(h) h=0x000001BE78483BC0
[705500]: 1242ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:195 CSpxHandleTable::StopTracking(h) class=CSpxAsyncOp<std::shared_ptr<ISpxRecognitionResult2>>, h=0x000001BE78483BC0, p=0x000001BE78483BC0, tot=0
[705500]: 1244ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:111 CSpxHandleTable::TrackHandle p=0x000001B901AEE2B8
[705500]: 1244ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:121 CSpxHandleTable::TrackHandle class=ISpxNamedProperties, h=0x000001B901AEE2B8, p=0x000001B901AEE2B8, tot=4
[705500]: 1251ms AZAC_TRACE_VERBOSE InteropSafeHandles.cs:59 Releasing handle 1B901AEE2B8 Disposing: True
[705500]: 1251ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:180 CSpxHandleTable::StopTracking(h) h=0x000001B901AEE2B8
[705500]: 1251ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:195 CSpxHandleTable::StopTracking(h) class=ISpxNamedProperties, h=0x000001B901AEE2B8, p=0x000001B901AEE2B8, tot=3
[705500]: 1255ms AZAC_TRACE_VERBOSE InteropSafeHandles.cs:59 Releasing handle 1B901AEE340 Disposing: True
[705500]: 1256ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:180 CSpxHandleTable::StopTracking(h) h=0x000001B901AEE340
[705500]: 1256ms SPX_DBG_TRACE_VERBOSE:  handle_table.h:195 CSpxHandleTable::StopTracking(h) class=ISpxRecognitionResult2, h=0x000001B901AEE340, p=0x000001B901AEE340, tot=0
dargilco commented 8 months ago

@Flickza you will get that error when the native binary runtimes\win-x64\native\Azure-AI-Vision-Extension-Image.dll is missing. The runtimes folder should be in the same folder as your executable.

Can you please try to compile and run the public sample in the same environment? https://github.com/Azure-Samples/azure-ai-vision-sdk/tree/main/samples/csharp/image-analysis/dotnet . It's enough to run the first sample there (option 1).

First, set the two environment variables VISION_ENDPOINT and VISION_KEY (or provide them as command line arguments to the sample executable)

 Azure AI Vision SDK - Image Analysis Samples

 To run the samples:

   dotnet image-analysis-samples.dll [--key|-k <your-key>] [--endpoint|-e <your-endpoint>]

 Where:
   <your-key> - A computer vision key you get from your Azure portal.
     It should be a 32-character HEX number.
   <your-endpoint> - A computer vision endpoint you get from your Azure portal.
     It should have the form: https://<your-computer-vision-resource-name>.cognitiveservices.azure.com

 As an alternative to specifying the above command line arguments, you can define
 these environment variables: VISION_KEY and/or VISION_ENDPOINT.

 To get this usage help, run:

   dotnet image-analysis-samples.dll --help|-h
Flickza commented 8 months ago

We have found the problem, being with our assembly loader solution. Thanks for your help 👍

dargilco commented 8 months ago

@Flickza glad to hear this and thank you for the update!