Upgrade failed with "duplicate key value violates unique constraint" error

You have a corrupted index. See Can't restore due to corrupt indexes (with some clues on how to deal with corrupt indexes) for some hints.

Do you have a separate database container? My guess is that you do and need to enter that container instead.