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

[Bug]: 500 server error on a collection not found #896

Open
dblock opened this issue Jul 27, 2023 · 4 comments
Open

[Bug]: 500 server error on a collection not found #896

dblock opened this issue Jul 27, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@dblock
Copy link

dblock commented Jul 27, 2023

What happened?

Fetching a collection by name via the HTTP API fails with a 500 Internal Server Error. Should be a 404.

Versions

Chroma 0.4.6, OSX.

Relevant log output

$ curl http://localhost:8000/api/v1/collections/foobar -v
*   Trying 127.0.0.1:8000...
* Connected to localhost (127.0.0.1) port 8000 (#0)
> GET /api/v1/collections/foobar HTTP/1.1
> Host: localhost:8000
> User-Agent: curl/7.88.1
> Accept: */*
> 
< HTTP/1.1 500 Internal Server Error
< date: Thu, 27 Jul 2023 19:34:19 GMT
< server: uvicorn
< content-length: 59
< content-type: application/json
< 
* Connection #0 to host localhost left intact
{"error":"ValueError('Collection foobar does not exist.')"}
@dblock dblock added the bug Something isn't working label Jul 27, 2023
@huineng
Copy link

huineng commented Aug 1, 2023

Correct , even
try
Except ValueError as e
does not work , only (Exception as e) does

@tazarov
Copy link
Contributor

tazarov commented Aug 7, 2023

@dblock I have a PR coming for this:

curl http://localhost:8000/api/v1/collections/foobar -v
*   Trying 127.0.0.1:8000...
* Connected to localhost (127.0.0.1) port 8000 (#0)
> GET /api/v1/collections/foobar HTTP/1.1
> Host: localhost:8000
> User-Agent: curl/8.1.2
> Accept: */*
> 
< HTTP/1.1 404 Not Found
< date: Mon, 07 Aug 2023 07:00:18 GMT
< server: uvicorn
< content-length: 76
< content-type: application/json
< 
* Connection #0 to host localhost left intact
{"error":"CollectionNotFound","message":"Collection foobar does not exist."}

tazarov added a commit to amikos-tech/chroma that referenced this issue Aug 7, 2023
The API now returns 404 whenever the user attempts to modified non-existent collection. Applies to:  Get Collection, Modify Collection, Delete Collection

Refs: chroma-core#896
@jeffchuber
Copy link
Contributor

@tazarov did this commit land somewhere?

@tazarov
Copy link
Contributor

tazarov commented Sep 6, 2023

@jeffchuber, I think this PR will resolve the issue - #991. I'll close my PR and do any additional enhancements I did there once #991 gets merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants