Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't retry on 401 in PromptNode #4380

Closed
1 task
FHardow opened this issue Mar 10, 2023 · 0 comments · Fixed by #4389
Closed
1 task

Don't retry on 401 in PromptNode #4380

FHardow opened this issue Mar 10, 2023 · 0 comments · Fixed by #4389

Comments

@FHardow
Copy link
Member

FHardow commented Mar 10, 2023

Describe the bug
When running a pipeline with a PromptNode, we retry HTTP requests that return a 401 error code. We should not retry these, but instead fail early.

Error message
No error thrown, that is the message on which it is retried

WARNING:haystack.utils.reflection:OpenAIError - OpenAI returned an error.                                                                                  │
│ Status code: 401                                                                                                                                           │
│ Response body: {                                                                                                                                           │
│     "error": {                                                                                                                                             │
│         "message": "Incorrect API key provided: **************************************. You can find your API key at https://platform.openai. │
│         "type": "invalid_request_error",                                                                                                                   │
│         "param": null,                                                                                                                                     │
│         "code": "invalid_api_key"                                                                                                                          │
│     }                                                                                                                                                      │
│ }               

Expected behavior
Don't retry a 401 and raise an exception.

Additional context
/

To Reproduce
Create a pipeline with an openai PromptNode, let the pipeline run and delete the key in the background.

FAQ Check

System:

  • OS:
  • GPU/CPU:
  • Haystack version (commit or version number):
  • DocumentStore:
  • Reader:
  • Retriever:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant