Are you using stock [Docker compose setup]?

Yes

If not, either reproduce this issue on the official demo or switch to Docker and see if the issue is resolved.


Describe the problem you’re having:

Error: SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation “ttrss_user_prefs2” already exists

Include steps to reproduce the problem:

I found that tt-rss wasn’t running (HTTP 502) and discovered I needed to update. I ended up having to delete the existing docker containers and used the docker-compose file (https://git.tt-rss.org/fox/ttrss-docker-compose/src/branch/master/README.md) to do this. I then imported my existing database back in using:

cat path/to/ttrss-backup-20210109.sql | docker exec -i ttrss-docker_db_1 psql -U postgres

I can login to tt-rss using the default admin/password login. It then prompts me to upgrade the DB, when I try this I get the error:
Performing updates to version 142

Updating to version 141

create table ttrss_user_prefs2 (	owner_uid integer not null references ttrss_users(id) ON DELETE CASCADE,	pref_name varchar(250) not null,	profile integer references ttrss_settings_profiles(id) ON DELETE CASCADE,	value text not null)

Error: SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation "ttrss_user_prefs2" already exists

One of the updates failed. Either retry the process or perform updates manually.

tt-rss version (including git commit id):

The latest - git commit e3dd638852827d93f2bf24160e5f28ad83af321f

Platform (i.e. Linux distro, PHP, PostgreSQL, etc) versions:

Ubuntu 20.04

Please provide any additional information below:

i’m just going to quote the exact part when you broke your database by doing things without thinking:

anyway, to unfuck whatever you did

  • drop schema public cascade ; create schema public;
  • load your dump back
  • in the future, think before typing in commands you don’t fully understand