BUG: Cannot delete investigations
Describe the bug When we try to delete an investigation, we get the error message "This path does not exist." The collection does not appear in the database or the redis cache. We tried to delete it from the cli alephclient and curl, same error. This investigation appears in https://aleph.example.com/investigations list though.
To Reproduce Steps to reproduce the behavior:
- Go to investigations
- Click on an investigation
- See error "This path does not exist."
or
curl -X DELETE "https://aleph.example.com/api/2/investigations/383" -H "Authorization: ApiKey XXX"
{"status": "error", "message": "This path does not exist."}
or
$alephclient --host https://aleph-aws.lemonde.fr --api-key XXX delete -f 383
Error: Collection does not exist.
$ alephclient --host https://aleph-aws.lemonde.fr --api-key XXX flush -f 383
Error: Collection does not exist.
$ alephclient --host https://aleph-aws.lemonde.fr --api-key XXX touch -f 383
Error: Collection does not exist.
Expected behavior Web console: the option to delete the investigation and confirm CLI or curl: deletion successful
Aleph version 4.0.2
Screenshots
Additional context We migrated our aleph data to a new infra: elasticsearch, database, etc. and upgraded at the same time from version 3 to 4.0.2
Hi @shabasma , just to rule this out: I'm assuming you are using an API Key that belongs to an admin users (or at least one with write access to that collection)?
And are you able to test this workaround: using the aleph cli (not alephclient, but the one you access from a shell in a live running Aleph container) is aleph delete <FOREIGN_ID> working for you?
Hello Chris,
Yes I'm using an admin API KEY
The aleph workaround does not work
Also, the collection has no foreign ID associated
DB:
SELECT id, foreign_id, label, summary, created_at, updated_at FROM collection WHERE id = 383;
id | foreign_id | label | summary | created_at | updated_at
----+------------+-------+---------+------------+------------
(0 rows)
Redis
keys *Collection:383*
(empty array)
And yet we see it in the /investigations web page
The collection id corresponds to the id column in the collection table of the postgres ALEPH_DATABASE, but the foreign_id is something different (typically it looks like an UUID). You can find it in the right hand column in the collection overview.
For instance for https://aleph.occrp.org/datasets/2226 it is on the bottom right:
Hi there!
So actually, this issue occured when transferring our instance from one cloud provider to another. I don't know how we arrived there, we must have done something wrong but there must be a way to fix it. The situation is :
- for every collection we had previously, we now have 2 collections with the same metadata showing in the UI. They have the same foreign id but not the same collection_id.
- One of them shows "This path doesn't exist" with 0 entities but the other one works fine.
- The problem is when we tried to upload anything using those foreign id, it goes to the first collection and we get the error : "This path does not exist"
If only we could delete the first ones, I think it would be fixed. I tried doing so using the collection_id with the cli, but I get back the same error "This path does not exist".
I hope that's more clear.