Invalid Serialized File Header Unity

Posted on

(Sort of. It’s at least better than what we did before)

The BugSi9000.

In the last post I talked about the weird Unity serialization bug that ruined all of Tuesday night, and which we were only able to avoid by sticking with an old revision of the material.

Header

The solution wasn’t very practical though, because if you pulled any version of the material after revision, and then accidentally clicked back on Unity, it would stall and crash. This is quite easy to do, because if you checked out the project folder in Perforce, and then try to submit, Perforce will ask you to get latest version first.

If this stalled, I would have to delete the Library and Temp folders and have Unity build again. Due to the size of the project, this would take around 20 minutes.

This is clearly not at all practical.

In the previous post, I talked about the thread I found, which seemed to pinpoint the problem to the way Unity does serialization and some weird way that it’s handled by Perforce.

What we’ve been experiencing seems to confirm this, as even making the material exactly like what it was in revision 7 and then resubmitting still led to problems.

Solution

I started to wonder if maybe the problem was actually over on the Perforce server, and so when we pulled, it messed up the project.

So what I did was to delete the asset that was giving us the “invalid serialized file header”, in our case default_prototype.mat, as well as the associated meta file from the Perforce server. I also deleted them locally.

Then I opened up a new Unity project, and reimported ProBuilder (we’re using the source version by the way).

Then I copied default_prototype.mat from this new project into the original project.

Allowed Unity to generate the meta file, and then committed those to the server.

Had no idea this would work. Here are my commit messages:

Incredibly, this actually fixed the problem!

This problem had actually been bugging us for several weeks now. David had first noticed it and discovered reverting the material to older version fixed it. However, I had only been pulling the project in bits, so it wasn’t until Tuesday that it really affected me.

Anyway, really happy that this is resolved. It’s possible that another asset could have serialization messed up in the future, so I think we will take care of changing the setting on the P4 server.

If you’re experiencing the same problem, I hope this helps.

STORE COMMUNITY
HomeDiscussionsWorkshopMarketBroadcasts
ABOUT SUPPORT login language
简体中文 (Simplified Chinese)繁體中文 (Traditional Chinese)日本語 (Japanese)한국어 (Korean)ไทย (Thai)Български (Bulgarian)Čeština (Czech)Dansk (Danish)Deutsch (German)Español - España (Spanish - Spain)Español - Latinoamérica (Spanish - Latin America)Ελληνικά (Greek)Français (French)Italiano (Italian)Magyar (Hungarian)Nederlands (Dutch)Norsk (Norwegian)Polski (Polish)Português (Portuguese)Português - Brasil (Portuguese - Brazil)Română (Romanian)Русский (Russian)Suomi (Finnish)Svenska (Swedish)Türkçe (Turkish)Tiếng Việt (Vietnamese)Українська (Ukrainian)Help us translate Steam