404 Resource not found error appears when trying to access Azure OpenAI deployment

Luqman Rumaiz 20 Reputation points
2024-09-19T08:12:58.7566667+00:00

Hi all, I am encountering a 404 error in my FastAPI Python backend logs when attempting to access an OpenAI API deployment. The logs show the following error:


[09/19/24 07:18:51] DEBUG    https://hbs-openai-poc.openai connectionpool.py:549
                             .azure.com:443 "POST                               
                             /openai/deployments/peopleshr                      
                             -help-chat-4o+/chat/completio                      
                             ns?api-version=2024-02-01                          
                             HTTP/1.1" 404 198                                  
                    DEBUG    message='OpenAI API response'            util.py:60
                             path=https://hbs-openai-poc.openai.azure           
                             .com//openai/deployments/peopleshr-help-           
                             chat-4o+/chat/completions?api-version=20           
                             24-02-01 processing_ms=None                        
                             request_id=None response_code=404                  
                    INFO     error_code=DeploymentNotFound            util.py:67
                             error_message='The API deployment for              
                             this resource does not exist. If you               
                             created the deployment within the last 5           
                             minutes, please wait a moment and try              
                             again.' error_param=None error_type=None           
                             message='OpenAI API error

When accessing the deployments with a simple GET request, I also receive a "404 resource not found" error. I've ensured that the deployment URI is correct and have followed the provided troubleshooting steps, but the issue persists.

User's image

This same issue happens in even deployments in other subscriptions, any guidance on resolving this would be greatly appreciated.

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
3,100 questions
{count} votes

Accepted answer
  1. AshokPeddakotla-MSFT 34,031 Reputation points
    2024-10-01T03:21:59.74+00:00

    Luqman Rumaiz I'm glad that your issue is resolved and thank you for posting your solution so that others experiencing the same thing can easily reference this!

    Since the Microsoft Q&A community has a policy that the question author cannot accept their own answer, they can only accept answers by others, I'll repost your solution in case you'd like to Accept the answer.

    Error Message:

    I am encountering a 404 error in my FastAPI Python backend logs when attempting to access an OpenAI API deployment.

    Solution:

    The issue was actually caused by a "+" symbol after the deployment name in the request, and an extra space in the environment variable.

    If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Luqman Rumaiz 20 Reputation points
    2024-09-27T11:38:57.9033333+00:00

    Hey @AshokPeddakotla-MSFT and @Daniel FANG,

    I realized the issue was actually caused by a "+" symbol after the deployment name in the request, and an extra space in the environment variable. Sorry for the confusion and for taking up your time!

    Thanks for your answers!

    0 comments No comments

Your answer

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