Solved it:
Detailed answer here: Index.upsert() + "Failed to connect; did you specify the correct index name?" - #3 by ankur.gupta