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] data.py /data/delete endpoint is throwing error message #181

Open
daperez80 opened this issue Sep 25, 2024 · 0 comments
Open

[BUG] data.py /data/delete endpoint is throwing error message #181

daperez80 opened this issue Sep 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@daperez80
Copy link

Describe the bug
Team is testing GraphRag Data Management API. We are able to list and upload containers but the delete operation fails

To Reproduce
Steps to reproduce the behavior:

  1. Start backend server
  2. Go to localhost:port#/manpages/docs
  3. trigger the /data/delete/{storage_name}
  4. See error

Expected behavior
Sucessfully delete the container both on cosmos and storage account.

Screenshots
If applicable, add screenshots to help explain your problem. -- see attached

Desktop (please complete the following information):

  • OS: Mac - Sonoma
  • Version 14.6.1

Additional context
GraphRag API is deployed to kubernetes as pod. We are running it via service / port forward to local host. Delete operations fail at File "/backend/src/api/data.py", line 208, in delete_files
container_store_client.delete_item(

@data_route.delete(
"/{storage_name}",
summary="Delete a data storage container",
response_model=BaseResponse,
responses={200: {"model": BaseResponse}},
)
async def delete_files(storage_name: str):
"""
Delete a specified data storage container.
"""
sanitized_storage_name = sanitize_name(storage_name)
try:
# delete container in Azure Storage
delete_blob_container(sanitized_storage_name)
# update container-store in cosmosDB
container_store_client = (
azure_storage_client_manager.get_cosmos_container_client(
database_name="graphrag", container_name="container-store"
)
)
container_store_client.delete_item(
item=sanitized_storage_name,
partition_key=sanitized_storage_name

    )
except Exception:
    reporter = ReporterSingleton().get_instance()
    reporter.on_error(
        f"Error deleting container {storage_name}.",
        details={"Container": storage_name},
    )
    raise HTTPException(
        status_code=500, detail=f"Error deleting container '{storage_name}'."
    )
return BaseResponse(status="Success")
Screenshot 2024-09-24 at 8 50 04 PM
@daperez80 daperez80 added the bug Something isn't working label Sep 25, 2024
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

1 participant