You can
./launcher enter app
sudo su - postgres
psql
And then, (EDIT: I looked it up and this appears to be the actual command)
REINDEX CONCURRENTLY DATABASE discourse;
And that will try to rebuild them and if it succeeds, you’re in good shape. If it fails, you need to go and delete the things that have duplicate ids. That’s more complicated.