Can't connect to source control error

A bit of an Hail Mary, but recently I’ve been having this problem when trying to connect to Perforce with a “empty identifier not allowed” error.
Does anyone have had this issue before? Any help would be greatly appreciated!

Apparently when lunching P4V (before starting unreal) one has to switch to the current working space in order to setup the correct variable environment which unreal will then read and use, otherwise this will happen.