Error -504 on appliation installation
I think this is a bug in Lollipop, I found this on another app forum:


  I’m getting the Error Code -504 (INSTALL_FAILED_UID_CHANGED) when installing App from Google Play
  
  Try to erase the “/data/data/appnamespace” directory on your device and try again. This is a “bug” Android 5.0 Lollipop developer preview which was fixed in the final release version.


That (plus a reboot, remove + reinstall of the app and remove + replace of my google account) fixed this issue for me.

It definitely isn't a connectivity issue, and it's nothing to do with a 504 HTTP error.