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

Handle the error in case the ollama URL is empty (or wrong/not accessible) #817

Open
rdimitrov opened this issue Jan 29, 2025 · 0 comments
Labels

Comments

@rdimitrov
Copy link
Member

Describe the issue

I think this is a bug in the text that uncovers a bug in codegate:

decoded_line = ' {"error": "[Errno -2] Name or service not known", "type": "error",      │ │
│ │                    "choices": ['+2                                                           │ │
│ │                e = IndexError('list index out of range')                                     │ │
│ │        json_line = {                                                                         │ │
│ │                    │   'error': '[Errno -2] Name or service not known',                      │ │
│ │                    │   'type': 'error',                                                      │ │
│ │                    │   'choices': []                                                         │ │
│ │                    }                                                                         │ │
│ │             line = b'data: {"error": "[Errno -2] Name or service not known", "type":         │ │
│ │                    "error", "choice'+7                                                       │ │

So what happens here is that we get a line and expect it to cointain choices but it only contains an error. We should handle the error, perhaps by raising an HTTP exception. But the root cause is that we cannot reach a service (or ollama can't?)

Originally posted by @jhrozek in #802 (comment)

Steps to Reproduce

Configure and run codegate with a wrong Ollama URL.

Operating System

Linux (Intel)

IDE and Version

Extension and Version

Provider

Ollama

Model

Codegate version

Logs

https://github.com/stacklok/codegate/actions/runs/13026634572/job/36336880374

Additional Context

This was found during CI so thus why there are not specific versions matched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants