@pnoeric The endless loop has been fixed in FIX: Infinite loop in migrate_to_s3 rake task · discourse/discourse@baae0e7 · GitHub
@pfaffman The problem should be fixed in FIX: Restore to S3 didn't work without env variables · discourse/discourse@c6b411f · GitHub