marqo-ai/marqo

Unable to delete index [BUG]

Opened this issue · 4 comments

I seem unable to delete an index

I've got no idea on how to reproduce this.
Maybe try spamming this?
image

image

Ubuntu server 22.04 LTS
All is up to date

INFO:     172.17.0.1:35950 - "DELETE /indexes/index001 HTTP/1.1" 500 Internal Server Error
INFO:     172.17.0.1:60816 - "DELETE /indexes/index002 HTTP/1.1" 200 OK
ERROR:marqo.api.route:Invalid application: Document type 'index001' not found in application package
Traceback (most recent call last):
  File "/app/src/marqo/vespa/vespa_client.py", line 827, in _raise_for_status
    resp.raise_for_status()
  File "/usr/local/lib/python3.8/site-packages/httpx/_models.py", line 749, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '400 Bad Request' for url 'http://localhost:19071/application/v2/tenant/default/prepareandactivate'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/src/marqo/api/route.py", line 20, in marqo_custom_route_handler
    return await original_route_handler(request)
  File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 235, in app
    raw_response = await run_endpoint_function(
  File "/usr/local/lib/python3.8/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
  File "/usr/local/lib/python3.8/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
  File "/usr/local/lib/python3.8/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/usr/local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "/usr/local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/app/src/marqo/tensor_search/api.py", line 265, in delete_index
    tensor_search.delete_index(index_name=index_name, config=marqo_config)
  File "/app/src/marqo/tensor_search/tensor_search.py", line 1835, in delete_index
    index_management.delete_index_by_name(index_name)
  File "/app/src/marqo/core/index_management/index_management.py", line 186, in delete_index_by_name
    self.delete_index(marqo_index)
  File "/app/src/marqo/core/index_management/index_management.py", line 172, in delete_index
    self.vespa_client.deploy_application(app)
  File "/app/src/marqo/vespa/vespa_client.py", line 90, in deploy_application
    self._raise_for_status(response)
  File "/app/src/marqo/vespa/vespa_client.py", line 837, in _raise_for_status
    self._raise_for_error_code(error_code, message, e)
  File "/app/src/marqo/vespa/vespa_client.py", line 842, in _raise_for_error_code
    raise exception(message=message, cause=cause) from cause
marqo.vespa.exceptions.InvalidVespaApplicationError: Invalid application: Document type 'index001' not found in application package
INFO:     172.17.0.1:57840 - "DELETE /indexes/index001 HTTP/1.1" 500 Internal Server Error

Hi @DuckY-Y .

Thanks for reporting this issue. Unfortunately I haven't been able to reproduce this. I tried running this code (Marqo 2.4.0):

while True:
    mq.create_index('my_index_1')
    print('Created index')
    mq.delete_index('my_index_1')
    print('Deleted index')

which continues to create and delete an index for as long as I ran it for.

Do you have any set of steps that will cause this issue with some consistency (e.g., after a number of tries)? Also, are you running one client thread or are multiple clients calling the API concurrently?

This happened outside of production live branch, locally on my test bench.
I was the only client and at the same time the host.
I've been unable to reproduce this.

I suspect you might have had another process creating/deleting the same index. This could cause issues at times and will be addressed in Marqo 2.7, scheduled to be released next week