Hi,
I had this same problem in my last grow, white foam on top and cloudy/milky water (posted -> here <- some month ago)
Cleaned all the system with water and bleach, removed all organic nute but after some days again some white foam on top, luckily it disappear after some days and water still...