Exactly the same problem here. Got my new PS4 yesterday and when trying to sign in it got all the way to the end of the privacy settings then booted me out with "An error has occurred". Tried several times with the same result. I then logged on to my account on my laptop and iPhone - noticed that my Real Name on my profile was blank and tried to update it but it failed with "An error occurred while performing this operation". Everything else on my account seems fine so I'm leaning towards the Real Name issue being the root of the problem. Phoned support and went through it all with a very helpful guy but he couldn't shed any light on the problem. He was focussing on the PS4 being the issue and has sent me a list of operations to start the PS in safe mode, perform a system software
update and rebuild the database. Haven't tried this yet as I'm sure it's nothing to do with the console and everything to do with my account. Like RoTTeNOTTeR, I created a dummy account and managed to log in absolutely fine so it's definitely an account problem. VERY frustrating!