Setup of a new farm, all going well - tried to create a web application. It was created but show the message 'MD2' is an unexpected token. Expecting white space. Line 1, position 15478 and there was no link to create a site.
In my case, the "MD2" was the start of the names of the databases that were being created for the services.
What I thought could this be? Turns out the PowerShell scripts I was using was putting a space in the database name - i.e. "MD2 SessionState" due to an edit error.
The workaround is let it create then assign a site - however, the PROPER fix is to rebuild all services and be sure that there is NO space in the name.