Code Monkey home page Code Monkey logo

Comments (9)

eaelmoneem1 avatar eaelmoneem1 commented on May 30, 2024

Additional update :
I can see the following error in the function "ProcessImage" logs:
Critical error: No MediaTypeFormatter is available to read an object of type 'OCRResult' from content with media type 'application/octet-stream'.

from mcw-serverless-architecture.

eaelmoneem1 avatar eaelmoneem1 commented on May 30, 2024

@joelhulen @timahenning Sorry guys for bothering you , But do you have any idea what could be the reason for the error up?
I have tried several things but with no luck

from mcw-serverless-architecture.

joelhulen avatar joelhulen commented on May 30, 2024

@eaelmoneem1 Sorry, I was away on vacation. Cold you please tell me what the value of your computerVisionApiUrl app setting is?

from mcw-serverless-architecture.

eaelmoneem1 avatar eaelmoneem1 commented on May 30, 2024

Hi @joelhulen NP, thanks for looking into this.
The value for computerVisionApiUrl is: https://tollboothvisioninitlab.cognitiveservices.azure.com/vision/v2.0/ocr added in the Azure function

from mcw-serverless-architecture.

joelhulen avatar joelhulen commented on May 30, 2024

Thank you. When you look at your other App Settings, do you see the indicator that shows that the Key Vault reference was successfully retrieved? This will be for computerVisionApiKey, eventGridTopicKey, cosmosDBAuthorizationKey, and blobStorageConnection.

from mcw-serverless-architecture.

eaelmoneem1 avatar eaelmoneem1 commented on May 30, 2024

I'm not sure exactly from where I can see this, But I think that all the connections are correct because I have modified this part manually and removed the else condition. Just to test that the event for "savePlateData" is working fine, and I was able to see data in CosmosDB "Processed" document but again with empty "licensePlateText" :

if (data.LicensePlateFound)
{
// TODO 3: Modify send method to include the proper eventType name value for saving plate data.
await Send("savePlateData", "TollBooth/CustomerService", data);
}
else
{
// TODO 4: Modify send method to include the proper eventType name value for queuing plate for manual review.
await Send("queuePlateForManualCheckup", "TollBooth/CustomerService", data);
}

and when i check the Function logs in the portal i see this logs for each file:

2020-09-16 12:13:52.738
Executing 'ProcessImage' (Reason='EventGrid trigger fired at 2020-09-16T12:13:51.5869921+00:00', Id=8607afca-fbcf-481c-b8cc-b93d738f007f)
Information

2020-09-16 12:13:53.011
Processing XVK7CDMI.jpg
Information

2020-09-16 12:13:53.196
Making OCR request
Information

2020-09-16 12:13:53.456
Critical error: No MediaTypeFormatter is available to read an object of type 'OCRResult' from content with media type 'application/octet-stream'.
Critical

2020-09-16 12:13:53.462
Finished OCR request. Result:
Information

2020-09-16 12:13:53.475
Sending license plate data to the queuePlateForManualCheckup Event Grid type
Information

2020-09-16 12:13:53.574
Sent the following to the Event Grid topic: TollBooth.Models.Event`1[TollBooth.Models.LicensePlateData]
Information

2020-09-16 12:13:53.575
Finished processing. Detected the following license plate:
Information

2020-09-16 12:13:53.604
Executed 'ProcessImage' (Succeeded, Id=8607afca-fbcf-481c-b8cc-b93d738f007f, Duration=2016ms)

from mcw-serverless-architecture.

joelhulen avatar joelhulen commented on May 30, 2024

Can you please update the GetImageHttpContent method of the FindLicensePlateText.cs file (https://github.com/microsoft/MCW-Serverless-architecture/blob/master/Hands-on%20lab/starter/TollBooth/TollBooth/FindLicensePlateText.cs#L103) by replacing content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); with content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); or text/plain if that doesn't work?

from mcw-serverless-architecture.

eaelmoneem1 avatar eaelmoneem1 commented on May 30, 2024

This is strange, I deleted the function from the portal and then I made the changes and published it.
But I keep receiving the same error :
Critical error: No MediaTypeFormatter is available to read an object of type 'OCRResult' from content with media type 'application/octet-stream'.

I have tried (application/json) & (text/plain)

@joelhulen Do you have any idea what else could cause this error in the code if it's not the HeaderValue?

from mcw-serverless-architecture.

eaelmoneem1 avatar eaelmoneem1 commented on May 30, 2024

The issue has been resolved. The problem was in one of the KeyVault keys.
Thanks for your help

from mcw-serverless-architecture.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.