Migration doesn't work: Index already exists


My mastodon-instance on Bonn.social keeps having problems. Some users report problems following other people from different instances: they get an error 500.

When I tried to rebuild and to get the newest release candidate, there is an error message during the migration:

StandardError: An error has occurred, all later migrations canceled:
Index name ‘index_notifications_on_account_id_and_id’ on table ‘notifications’ already exists

I reported the error on GitHub with more details, but I couldn’t get help there:

Does anyone have some ideas how to solve this problem?

Kind regards!

Sascha from https://Bonn.social


Can you try to DROP INDEX by hand? most probably some database migration was interrupted.

Please backup your database :slight_smile:


I would give it a try, if you could help me with some hints about the commands to drop index with an docker installation and also how to create a backup before and how to put back the backup in place. I am not so good with postgresql or whatever Mastodon uses. :wink:

Kind regards



pg_dump databasename

once you can connect to it.

Will create a whole DB in the SQL format


Problem solved: Can't follow accounts from other instances (error 500) · Issue #6796 · tootsuite/mastodon · GitHub