Same problem for me. Upgraded from 3.5.5 to 4.0 today and lost the webadmin. Javier's fix solved the problem Thank you Javier!
I want to add some information that might help in tracking this bug. I maintain 2 identically configured Zentyal machines. One is my primary network gateway, the 2nd is always running as a hot spare. I keep their configurations identical, and I test updates on the hot spare before applying them to the primary machine. Although configured the same, the two machines have completely different hardware.
The upgrade from 3.5 to 4 went without a hitch on the hot spare. When I applied the same upgrade to my primary machine, this Internal Server Error bug arose. So I'm wondering if this is an issue that is somehow hardware related.