Closed jvkersch closed 1 year ago
@jvkersch can you share the configs you were using?
I'm also wondering: Isn't .drop_indexes()
only called on the collections that are defined in the app config and that are created automatically prior to dropping indexes? So when exactly is this an issue, @jvkersch ?
This is embarrassing, but due to my lack of note-taking when the issue first occurred, I am unable to reproduce the issue... I will close this as-is, but I did encounter the issue on a number of occasions, and if I spot it again I will take the time to create a minimal working example. Sorry for wasting your time!
No worries at all, @jvkersch. Just re-open it once you can reproduce it. Happy to look at the problem and (hopefully) fix it :)
Calling
drop_indexes
on a non-existent collection raises apymongo.errors.OperationFailure
. This makes it difficult to use an empty database with a foca app; one needs to manually create the required collections ahead of time.A fix could be to wrap the call to
drop_indexes
in a simple try/except.https://github.com/elixir-cloud-aai/foca/blob/d52e16218e953b34125afb4d541c0e3b47cd4336/foca/database/register_mongodb.py#L57