502 Bad Gateway - לא ניתן לבנות מחדש

You could try to add to your rebuild command the --skip-prereqs flag (but be sure to have downloaded a backup and your app.yml beforehand, just in case)