ScriptableObject Asset Files Invalid Header, Perforce Revision


I’m currently working on a project using Perforce to handle version control and syncing with team members. One thing we’ve recently noticed is that our ScriptableObjects stored in .asset files are always corrupt upon import from another client.

The specific error we receive on import is

“Fatal error while reading file.
Header is invalid!”

followed by

“Failed to read file
because it is corrupted.”

I have not seen any posts or information on UnityAnswers, or the Internet, regarding .asset files being corrupted by Perforce.

We’re using P4Connect, our Version Control setting (Edit->ProjectSetting->EditorSetting) is set to Visible Meta Files, and our Asset Serialization is set to Mixed.

If it can help, we had this problem but only on one developper computer

The data on the server are right

The perforce client of this developper has 2 pending change list (let’s say with revision 1 and 2).
Each pending change list has modifications on the same file

the version 2 is committed
so everybody else is able to get non-corrupted file

but the developper, with its local settings (with the remaining unuseful pending changes list version 1), gets corrupted files

So the solution : clean your perforce client by removing/reverting unused pending changes list