Getting Service request failed. 404 (Not Found) error while calling azure vision ocr running in a docker container
Getting Service request failed. 404 (Not Found) error while calling azure vision ocr running in a docker container. Everything works fine if I make a call to azure vision cloud ocr service.
I'm using endpoint "http://localhost:5000" for container call. When I enter this url in browser, it shows "Your Azure Cognitive Service Container is up and running" page with samples etc.
Azure Container Instances
-
Amira Bedhiafi • 28,221 Reputation points
2025-01-16T16:32:08.09+00:00 Try to check the exact API path you are calling. For example:
- Cloud OCR:
https://<your-cognitive-service-endpoint>/vision/v3.2/read/analyze
- Container OCR might require something like
/vision/v3.2/read/analyze
- Verify the path
/vision/v3.2/read/analyze
or the equivalent for the version of the container you're using is appended tohttp://localhost:5000
http://localhost:5000/vision/v3.2/read/analyze
You can use the Docker logs to see what is happening within the container when the request is made.
docker logs <container-id>
- Cloud OCR:
-
kushal kaleshwari • 1 Reputation point
2025-01-16T19:45:56.0833333+00:00 No log messages, Looks like the request is not even reaching the container
-
kushal kaleshwari • 1 Reputation point
2025-01-16T21:26:33.2333333+00:00 http://localhost:5000/vision/v3.2/read/analyze
The above url is for asynchronous operation. However I'm trying to perform synchronous operation with the following url
http://localhost:5000/computervision/imageanalysis:analyze
This is where the container fails.
-
Srinud • 3,590 Reputation points • Microsoft Vendor
2025-01-21T18:18:17.6+00:00 Hi kushal kaleshwari,
Thank you for reaching out to us on the Microsoft Q&A forum.I am looking on it, will get back to you soon.
-
Srinud • 3,590 Reputation points • Microsoft Vendor
2025-01-22T04:15:28.7966667+00:00 The 404 (Not Found) error you are encountering when calling the Azure Vision OCR service running in a Docker container indicates that the specific API endpoint you are attempting to access is either unavailable or incorrectly specified.
First, verify the status of the container by running the following command docker container ls. Once the container is in a running state you can log into the container using the command docker exec -it <container-name-or-id> /bin/bash. After accessing the container, check the service status with the command systemctl status <service_name>.
If the information is helpful, please consider by clicking the "Upvote" on the post.
If you have any further queries, please let us know in the comment. -
Srinud • 3,590 Reputation points • Microsoft Vendor
2025-01-22T13:18:50.1166667+00:00 As you confirmed in the above that no logs messages and please ensure that logging is configured whenever you execute docker run command.
Please follow below documentation for more information.
Thank you.
-
kushal kaleshwari • 1 Reputation point
2025-01-22T17:19:06.8666667+00:00 After enabling debug level logging, I see following in the logs.
Request starting HTTP/1.1 POST http://localhost:5000/computervision/imageanalysis:analyze?features=caption%2Cread&api-version=2023-10-01&gender-neutral-caption=true application/octet-stream 110421
dbug: Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware[0]
Wildcard detected, all requests with hosts will be allowed.
dbug: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[1]
POST requests are not supported
dbug: Microsoft.AspNetCore.Routing.Matching.DfaMatcher[1000]
No candidates found for the request path '/computervision/imageanalysis:analyze'
dbug: Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware[2]
Request did not match any endpoints
dbug: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[1]
POST requests are not supported
-
kushal kaleshwari • 1 Reputation point
2025-01-22T17:56:49.7933333+00:00 Apparently, container supports /vision/v3.2/read/syncAnalyze path and not /computervision/imageanalysis:analyze supported by cloud API call. With this change, the call is going through successfully now.
-
Srinud • 3,590 Reputation points • Microsoft Vendor
2025-01-23T18:29:02.26+00:00 Hi kushal kaleshwari,
Thank you for the update!
I hope that your issue has been resolved. If you find the information helpful, kindly consider clicking the Upvote button on my post. -
Srinud • 3,590 Reputation points • Microsoft Vendor
2025-01-27T08:55:10.6866667+00:00 Hi kushal kaleshwari,
Thank you for the update!
I hope that your issue has been resolved. If you find the information helpful, kindly consider clicking the Upvote button on my post. -
kushal kaleshwari • 1 Reputation point
2025-01-27T17:39:23.63+00:00 This is resolved now.
The response from 2023-10-01 model and 2022-04-30 models are different too.
-
Srinud • 3,590 Reputation points • Microsoft Vendor
2025-01-30T07:05:45.8066667+00:00 Yes, based on models you use, there can be differences in how API calls are structured or how responses are formatted between the two models.
Thank you.
Sign in to comment