How to recover my broken (not web-accessible) Discourse installation after failed upgrade

cd /var/discourse
./launcher rebuild app