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]: Cannot delete some files from File Management #5298

Open
1 task done
michnovka opened this issue Jan 13, 2025 · 3 comments
Open
1 task done

[Bug]: Cannot delete some files from File Management #5298

michnovka opened this issue Jan 13, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@michnovka
Copy link

What happened?

in the past I was messing with different embeddings, so it is very much propable I caused this myself somehow. The issue is that I have some files in UI which I cannot delete. When I click on delete, UI makes it look like they are deleted fine, but on refresh the files are back.
This is because the files no longer exist in RAG.
I would argue this is a bug at least in UI, where if I try to delete file that does not exist (therefore was deleted before) it should delete it from its own DB of files, as, the file is really not present.
At the very least it should show the error to the user, not silently make it seem like all went fine, removing files from list only to find them again on reload.

Steps to Reproduce

  1. upload file to RAG
  2. delete file from RAG somehow not thru UI (I have no idea how I managed it, I never interfaced with RAG directly. maybe due to changing embeddings provider? Or some other bug in UI, as I was deleting files in bulk from UI a while back)
  3. try to delete the file from UI

What browsers are you seeing the problem on?

No response

Relevant log output

librechat-rag-api      | 2025-01-13 12:42:59,430 - root - ERROR - Failed to delete documents | IDs: ['ca46ab84-4773-4ec7-b795-ddc6206552fb'] | Error: 404: One or more IDs not found | Traceback: Traceback (most recent call last):
librechat-rag-api      |   File "/app/main.py", line 201, in delete_documents
librechat-rag-api      |     raise HTTPException(status_code=404, detail="One or more IDs not found")
librechat-rag-api      | fastapi.exceptions.HTTPException: 404: One or more IDs not found
librechat-rag-api      | 
librechat-rag-api      | 2025-01-13 12:42:59,430 - root - INFO - Request DELETE http://rag_api:8000/documents - 500
librechat-rag-api      | 2025-01-13 12:42:59,433 - root - ERROR - Failed to delete documents | IDs: ['2c5d12f2-486b-4b13-b796-47a4e11fac7f'] | Error: 404: One or more IDs not found | Traceback: Traceback (most recent call last):
librechat-rag-api      |   File "/app/main.py", line 201, in delete_documents
librechat-rag-api      |     raise HTTPException(status_code=404, detail="One or more IDs not found")
librechat-rag-api      | fastapi.exceptions.HTTPException: 404: One or more IDs not found
librechat-rag-api      | 
librechat-api          | 2025-01-13T12:42:59.435Z error: Error deleting vectors The request was made and the server responded with a status code that falls out of the range of 2xx: Request failed with status... [truncated]
librechat-rag-api      | 2025-01-13 12:42:59,434 - root - ERROR - Failed to delete documents | IDs: ['362d1c2c-a8f6-40c1-ab92-1e0e1bfbe321'] | Error: 404: One or more IDs not found | Traceback: Traceback (most recent call last):
librechat-api          | 2025-01-13T12:42:59.435Z error: Error deleting file Request failed with status code 500
librechat-rag-api      |   File "/app/main.py", line 201, in delete_documents
librechat-api          | 2025-01-13T12:42:59.436Z error: Error deleting vectors The request was made and the server responded with a status code that falls out of the range of 2xx: Request failed with status... [truncated]
librechat-rag-api      |     raise HTTPException(status_code=404, detail="One or more IDs not found")
librechat-api          | 2025-01-13T12:42:59.437Z error: Error deleting file Request failed with status code 500
librechat-rag-api      | fastapi.exceptions.HTTPException: 404: One or more IDs not found
librechat-api          | 2025-01-13T12:42:59.437Z error: Error deleting vectors The request was made and the server responded with a status code that falls out of the range of 2xx: Request failed with status... [truncated]
librechat-rag-api      | 
librechat-api          | 2025-01-13T12:42:59.438Z error: Error deleting file Request failed with status code 500
librechat-rag-api      | 2025-01-13 12:42:59,434 - root - INFO - Request DELETE http://rag_api:8000/documents - 500
librechat-api          | 2025-01-13T12:42:59.439Z error: Error deleting vectors The request was made and the server responded with a status code that falls out of the range of 2xx: Request failed with status... [truncated]
librechat-rag-api      | 2025-01-13 12:42:59,434 - root - INFO - Request DELETE http://rag_api:8000/documents - 500
librechat-api          | 2025-01-13T12:42:59.440Z error: Error deleting file Request failed with status code 500
librechat-rag-api      | 2025-01-13 12:42:59,436 - root - ERROR - Failed to delete documents | IDs: ['f0d0a3c1-df17-4d84-8c26-b43bcfedaa3d'] | Error: 404: One or more IDs not found | Traceback: Traceback (most recent call last):
librechat-api          | 2025-01-13T12:42:59.442Z debug: [/files] Files deleted successfully: ca46ab84-4773-4ec7-b795-ddc6206552fb, f0d0a3c1-df17-4d84-8c26-b43bcfedaa3d, 362d1c2c-a8f6-40c1-ab92-1e0e1bfbe321,... [truncated]
librechat-rag-api      |   File "/app/main.py", line 201, in delete_documents
librechat-rag-api      |     raise HTTPException(status_code=404, detail="One or more IDs not found")
librechat-rag-api      | fastapi.exceptions.HTTPException: 404: One or more IDs not found
librechat-rag-api      | 
librechat-rag-api      | 2025-01-13 12:42:59,436 - root - INFO - Request DELETE http://rag_api:8000/documents - 500

Screenshots

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@michnovka michnovka added the bug Something isn't working label Jan 13, 2025
@michnovka
Copy link
Author

I would like to add that I cannot delete also files which were generated by DALL-E and show as type "Image gen"

image

Again, not sure how i got here, as if I ask dalle via agent to generate new image now, then I delete it, it works without issues. But this one is "stuck"

@michnovka
Copy link
Author

michnovka commented Jan 15, 2025

ok, I found a way to reproduce this:

  1. ask agent with dalle to generate image
    image

  2. when the image is generated, refresh page - you will see it is added to list of files in file management:
    image

  3. download the image (I used same filename as default)

  4. go to agent builder and edit agent -> assign it the very same image as avatar.

  5. refresh page. The image now shows twice in files:
    image

  6. select both images and Delete.

  7. the ImageGen is now stuck, it cannot be removed. no matter how many times you try again, its not removed.
    image

Maybe it has to do with the names being same?

here is the log

librechat-api          | 2025-01-15T23:33:50.282Z error: Error deleting file ENOENT: no such file or directory, unlink '/app/client/public/images/66c846f7809c9f24886b9058/img-79ba65b6-2752-4b19-bca9-8abdfcf1... [truncated]
librechat-api          | 2025-01-15T23:33:50.282Z error: Error deleting file ENOENT: no such file or directory, unlink '/app/client/public/images/66c846f7809c9f24886b9058/img-36c5a1e8-f79c-4167-81c9-f4c74245... [truncated]
librechat-api          | 2025-01-15T23:33:50.283Z debug: [/files] Files deleted successfully: 76c9ec99-93d3-4e47-824f-b90da832d880, 1a07ea11-8cc7-4588-9e01-71568fd33373

@mansiibm
Copy link

Hi can you try deleting it one by one. I too have been using the latest version of RAG and this issue exists for non-image type of files.

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

2 participants