alembic.util.exc.CommandError: Can’t locate revision identified by

Spotipo uses Flask-Migrate to keep the database up to-date , if there is a mismatch on the local migration scripts and this error is shown.

To fix this, follow below steps. Remember to take a database backup just in case.

  • Delete the table called alembic_version from database.
mysql -u root -p -e 'use spotipo; drop table alembic_version'
  • Delete the migrations folder. Its kept in /usr/share/nginx/spotipo
rm -rf /usr/share/nginx/spotipo/migrations/

How did we do?