avrdude: failed to read all of flash memory, rc=-2

Update: I think it is happening when my ESP8266 is connected. I don't have an external 3.3V power supply for it. I removed module and problems went away.