Build error: "Shader compiler: internal error compiling shader snippet type=0 platform=5"

Build failed often on Unity Cloud Build with the following errors:

Often failed, and sometimes succeeded.

On Editor, alway succeeded.

Are there any solutions?

1 Like

Same problem today, but with ‘Legacy Shaders/VertexLit’ shader. Did you find solutuin?

We are seeing a similar error with our iOS Unity Cloud Build.

3043: [Unity] Shader compiler: internal error compiling shader snippet type=0 platform=14: Protocol error - failed to read correct magic number
3044: [Unity] UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String[ ], String, BuildTarget, BuildOptions, Boolean, UInt32&)
3045: [Unity] UnityEditor.CloudBuild.Builder:Build()
3046: [Unity] Shader compiler: UnityShaderCompiler compiler executable disappeared on thread 1915822848, restarting

We don’t have any custom shaders and initiating a “Clean Build All” sometimes results in a successful build. We are running Unity 5.3.3f1. Has this been resolved in later versions?

Any news on this? We have a project that has the same error. Builds most of the time on Android, but fails most of the time on Android.
Always works when building from Editor.

I can’t state this as a definitive answer, but I was having the same issues after Updating to Unity 5.3.4b19.
I found that everywhere I had the Material ‘Sprites-Default’. It had been removed and replaced by nothing in the Sprite Renderers. And If I used that material in a Particle it showed this caption where the material should have been 'Hidden/InternalErrorShader.

So you don’t really need any custom shaders for this kind of thing to occur in my experience.

Hey all,
We’ve been trying to track this issue down for a bit now and could use some more examples. So if you are still seeing the issue on your project, please send me a direct message with a link to your project in cloud build. Thanks.

1 Like

@Ryanc_unity ,

I would be willing to share my project with you in order to get this fixed.
Is there any other way to get my project to you besides cloud build?

Sorry for the inconvenience.

@Ryanc_unity
Having the same issue here. First we used a legacy shader on the player and started cloud build. The Android target went through nicely, however the iOS target failed. I tried building for iOS locally and everything was good.

So I switched the shader to “Mobile/Bumped Specular”, pushed waited… and then the iOS build worked. However the Android target failed :smile: So just the other way around…

I’ll send you a link to the cloud build project in a moment. I hope you guys can figure something out.

And for completeness: we are using version 5.4.0f3

Hey all, just jumping in here for a quick note that we haven’t been ignoring this issue. We’ve been working on it quite a bit and this issue has proven to be hard to track down. As soon as we have more information on this either unitychrism or myself will let you all know.

1 Like

@Ryanc_unity I also seem to be experiencing this issue with both iOS and Android

EDIT: I just retried building with no changes and now it works…

Same issue. Repro:

  • Had cloud build set up with Unity 5.3.4f1, target Android. Everything worked.
  • Switched to Unity 5.4.0f1. Updated project settings and pushed. Updated cloud build settings for the branch to use
    5.3.4f1.
  • Started build. Result: Failure.

Here’s log:
56: [Unity] Shader compiler: internal error compiling shader snippet type=0 platform=5: Protocol error - failed to read correct magic number
57: [Unity] Shader error in ‘Sprites/Default’: Internal error communicating with the shader compiler process
58: [Unity] Player export failed. Reason: Shader error in ‘Sprites/Default’: Internal error communicating with the shader compiler process
59: ! build of ‘develop-android’ failed. compile failed

starting to see this error in my android cloud build now too, in addition to the ios build. really weird. seems to be random as my builds were working fine up until a few days ago and I didnt really make any real changes

This is somewhat non-deterministic. In my case, restarting a build often results in a successful build.

Making a new build configuration might be a work around.

I’ve consistently been experiencing this error in 8 out of my last 9 builds for both iOS and Android on Cloud Build - but not locally.
Now I simple renamed my build configuration in Cloud Build, made a copy of it and gave the copy a new name - and now it builds. Library Cache is disabled for my project but the error was still consistent.

@ : Let me now if I somehow can be helpful tracking this bug down by providing build logs, build configurations or anything. I would be happy to help as this bug is really really annoying.

/Martin

@ We are also seeing this issue pretty regularly in our builds, let us know if you need anything to help debug.

I’m seeing this in Unity Cloud builds (but not local builds) after attempting to upgrade from 3.5.5f1 to 5.4.x.

lot’s of shader compiltion errors lately

Cloud both 5.4.1 and 5.4.2
both iOS and Android

it was workign perfecly until a few days a go

Same here. In this past week, >75% of our Android/iOS builds (Unity 5.4.2f2) with no library cache failed with this error, and a small percentage of Android/iOS builds with library cache. It appears to be entirely independent of the actual shader being compiled, we’ve tried replacing complicated shaders with simple ones, moved shaders to Resources folder and back and even removed shaders only for building to fail on the next shader in the list.
This is a huge issue within our build process.

Hey All, sorry for the radio silence on this issue. We’ve been working on infrastructure upgrades over the past few months that we hope will reduce the occurrence of this error quite a bit, but we still have more upgrades to go. We believe the issue that the shader compiler has with Cloud Build is that it is a bit sensitive to any performance interruptions. Specifically and technically, when Unity needs to compiler a shader, it launches the Shader Compiler which then creates a network communication socket that Unity connects to, Unity then streams the shader data to the compiler, the compiler does its job, and streams back the results. However, it’s sometimes not able to respond fast enough, particularity noticed when Cloud Build hardware is under heavy load.

We’re addressing this in a few ways, including working with the graphics team, as well as making some hardware changes and upgrade in the Cloud Build infrastructure. We hope to see the rate of these errors drop in the coming days and weeks, and we’ll keep monitoring here.

1 Like

iOS: still getting shader compilation error 100% of the time, I am unable to get any build on the cloud.

Android, build failing 100% of the time, shader error disappeared today but got another error without any explanation.

Both iOS and Android builds are working locally.