Migration failed: relation "user_required_fields_versions" already exists

Yes it does.

I ended up destroying my backup dev site and reinstalling Discourse. It worked fine as the basic installation.

I then installed the plugins and it suddenly gave me the Bad Gateway error again.
I then started manually uninstalling the plugins to see if one of them might be causing the issue, but this is the error I get:

735:C 08 Sep 2024 18:08:02.491 # Redis version=7.0.7, bits=64, commit=00000000, modified=0, pid=735, just started
735:C 08 Sep 2024 18:08:02.492 # Configuration loaded
735:M 08 Sep 2024 18:08:02.492 * monotonic clock: POSIX clock_gettime
735:M 08 Sep 2024 18:08:02.493 # Warning: Could not create server TCP listening socket *:6379: bind: Address already in use
735:M 08 Sep 2024 18:08:02.493 # Failed listening on port 6379 (TCP), aborting.
I, [2024-09-08T18:08:12.483662 #1]  INFO -- : 
I, [2024-09-08T18:08:12.484827 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
rake aborted!
Errno::EPIPE: Broken pipe @ rb_io_flush_raw - <STDOUT> (Errno::EPIPE)

It looks like the moment I try to install any plugin, it gives this error and I can’t undo it just by uninstalling the plugin.

Any idea what I should do?