Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

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

Discussion in 'Unity Cloud Build' started by tatata, May 17, 2016.

  1. tatata

    tatata

    Joined:
    Jul 11, 2013
    Posts:
    12
    Build failed often on Unity Cloud Build with the following errors:

    Often failed, and sometimes succeeded.

    On Editor, alway succeeded.

    Are there any solutions?
     
    luma3001 likes this.
  2. Prophet6989

    Prophet6989

    Joined:
    Jul 8, 2012
    Posts:
    37
    Same problem today, but with 'Legacy Shaders/VertexLit' shader. Did you find solutuin?
     
  3. spiraltoys

    spiraltoys

    Joined:
    Jul 21, 2015
    Posts:
    3
    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?
     
  4. remi_roofdog

    remi_roofdog

    Joined:
    Feb 19, 2016
    Posts:
    6
    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.
     
  5. BAnyBudde

    BAnyBudde

    Joined:
    Jun 3, 2014
    Posts:
    49
    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.
     
  6. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    163
    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.
     
    luma3001 likes this.
  7. BAnyBudde

    BAnyBudde

    Joined:
    Jun 3, 2014
    Posts:
    49
    @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.
     
  8. thrive

    thrive

    Joined:
    Aug 12, 2016
    Posts:
    1
    @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 :D 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
     
  9. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    163
    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.
     
    luma3001 likes this.
  10. jdewitt_DHH

    jdewitt_DHH

    Joined:
    Apr 27, 2016
    Posts:
    1
    @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...
     
    Last edited: Aug 23, 2016
  11. MapMan

    MapMan

    Joined:
    Oct 27, 2013
    Posts:
    37
    Same issue. Repro:
    1. Had cloud build set up with Unity 5.3.4f1, target Android. Everything worked.
    2. Switched to Unity 5.4.0f1. Updated project settings and pushed. Updated cloud build settings for the branch to use
      5.3.4f1.
    3. 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
     
  12. chandler55

    chandler55

    Joined:
    Jun 8, 2010
    Posts:
    13
    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
     
  13. MapMan

    MapMan

    Joined:
    Oct 27, 2013
    Posts:
    37
    This is somewhat non-deterministic. In my case, restarting a build often results in a successful build.
     
  14. mollermanden

    mollermanden

    Joined:
    Apr 2, 2013
    Posts:
    23
    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.

    @Unity: 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
     
  15. OneWhoMikes

    OneWhoMikes

    Joined:
    Jul 16, 2012
    Posts:
    4
    @Unity We are also seeing this issue pretty regularly in our builds, let us know if you need anything to help debug.
     
  16. goble

    goble

    Joined:
    Jun 30, 2016
    Posts:
    8
    I'm seeing this in Unity Cloud builds (but not local builds) after attempting to upgrade from 3.5.5f1 to 5.4.x.
     
  17. StefanoCecere

    StefanoCecere

    Joined:
    Jun 10, 2011
    Posts:
    142
    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
     
  18. OlafZ

    OlafZ

    Joined:
    Aug 3, 2016
    Posts:
    17
    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.
     
  19. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    163
    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.
     
    Black_Stormy likes this.
  20. josephsaade

    josephsaade

    Joined:
    Apr 18, 2016
    Posts:
    30
    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.
     
  21. 4fthawaiian

    4fthawaiian

    Joined:
    Dec 18, 2013
    Posts:
    33
    We've been trying all day to get a build out to our testers, and it keeps failing. I really hope you guys have something up your sleeves - this is severely affecting our productivity. :/
     
  22. DanTaylor

    DanTaylor

    Joined:
    Jul 6, 2013
    Posts:
    64
    Plus one for this error!

    [Unity] Player export failed. Reason: Shader error in 'Hidden/Unlit/Transparent Colored 2': Internal error communicating with the shader compiler process

    :(
     
  23. MarkZeroTG

    MarkZeroTG

    Joined:
    Jan 13, 2014
    Posts:
    6
    Also have this error occurring in something like 25% of our builds. Another 25% are errors during pull from our mercurial repository on bitbucket.

    We can still use Cloud Build since building again 1-2 times usually results in a successful build, but It would be nice if Cloud Build only failed if there is an actual error in the project.
     
    patrickjarnfelt likes this.
  24. Hargrim

    Hargrim

    Joined:
    Apr 23, 2015
    Posts:
    1
    The issue still persists. It fails about once per 10 builds.

     
  25. Ludomade

    Ludomade

    Joined:
    Nov 11, 2014
    Posts:
    11
    Getting these as well now

     
  26. Pavel_D

    Pavel_D

    Joined:
    Nov 17, 2013
    Posts:
    9
    Project one from Cloud iOS Build give this:

    Project two from Cloud iOS Build give this:

     
  27. UberGeoff

    UberGeoff

    Joined:
    Feb 19, 2014
    Posts:
    1
    Seems to still be happening:

    [Unity] Shader compiler: internal error compiling shader snippet type=0 platform=5: Protocol error - failed to read correct magic number
    907: [Unity] Shader error in 'Particles/Additive': Internal error communicating with the shader compiler process

    Unity 5.5 UCB

    - But only for the first build. 2nd build runs successfully.
     
    Last edited: Feb 12, 2017
  28. KeithT

    KeithT

    Joined:
    Nov 23, 2011
    Posts:
    79
    Shader compiler: internal error disassembling shader snippet type=16 platform=4: Protocol error - failed to read correct magic number on 5.4.4f1

    Failing all the time, currently blocked :(
     
  29. RDeluxe

    RDeluxe

    Joined:
    Sep 29, 2013
    Posts:
    86
    Got the same error today

    http://i.imgur.com/ADzAsIA.png

    I would really much like to know what the status on this, because relaunching the build manually and hoping it's going to work ... for a premium service it's not acceptable.
     
  30. SophiaC

    SophiaC

    Unity Technologies

    Joined:
    Sep 6, 2016
    Posts:
    236
    Hello,

    As mentioned in the Known Issues thread:

    So you should be seeing the errors very infrequently.

    I hope this helps.

    - Sophia
     
  31. JoRouss

    JoRouss

    Joined:
    Apr 1, 2014
    Posts:
    50
    Happened to me today after changing unity target build from 5.5.0f3 to unity 5.5.2f1
     
  32. marshmatter

    marshmatter

    Joined:
    Oct 2, 2013
    Posts:
    42
    Having the seem issue today.

    36146: [Unity] Shader error in 'Particles/Alpha Blended': Internal error communicating with the shader compiler process
    36136: [Unity] Shader compiler: internal error compiling shader snippet type=0 platform=5: Protocol error - failed to read correct magic number
     
  33. hromoyDron

    hromoyDron

    Joined:
    Jan 24, 2013
    Posts:
    52
    Unity] Shader compiler: internal error compiling shader snippet type=0 platform=5: Protocol error - failed to read correct magic number
    [Unity] Shader error in 'Sprites/Default': Internal error communicating with the shader compiler process

    today(
     
  34. martaaay

    martaaay

    Joined:
    Apr 13, 2009
    Posts:
    136
    Got this today:
    1080: [Unity] Player export failed. Reason: Shader error in 'Standard': Internal error communicating with the shader compiler process
     
  35. Gwom

    Gwom

    Joined:
    Aug 5, 2015
    Posts:
    5
    Me too :(

    280: [Unity] Shader compiler: internal error compiling shader snippet type=0 platform=5: Protocol error - failed to read correct magic number
    281: [Unity] Shader error in 'Sprites/Default': Internal error communicating with the shader compiler process
    282: [Unity] Player export failed. Reason: Shader error in 'Sprites/Default': Internal error communicating with the shader compiler process

    After as load of
    PVRTC texture format is not supported, decompressing texture
     
  36. FaetterJens

    FaetterJens

    Joined:
    Aug 18, 2015
    Posts:
    10
    @SophiaC will this ever be fixed? This has been a problem for us for more than half a year now. The cloud build is useless when it cannot be relied on and we are paying for this service. 3 of 4 build attempts fail.
     
  37. PhilMcJ

    PhilMcJ

    Unity Technologies

    Joined:
    May 29, 2014
    Posts:
    182
    Quick update on shader compiler errors:
    - That process in Unity can be fragile sometimes; it's more likely to show problems in server environments (like Cloud Build) than a desktop build, although it's possible to reproduce it anywhere if you try hard enough.
    - The UCB team tracks the overall rate of these errors and it's low overall, and many projects don't see it - the problem is that certain projects that do hit it tend to run into it recurrently (sometimes very often, unfortunately).
    - There has been a (modest but noticeable) uptick in the rate of this error in UCB logged over the past few days, and some tuning is underway now to bring it back down. The planned server maintenance on Wednesday night - https://forum.unity3d.com/threads/ucb-team-minor-maintenance-wednesday-night-april-26th.467812/ - will open up a few more options for the team to work with.
    - In the longer term, the UCB and graphics team are working on improving this process for anyone on any project in any environment - but in the meantime, tuning work will keep happening to keep bringing that error rate down. If you have a project that encounters that error on the majority of build attempts (and it's still the case by the end of this week, in particular), please open a support ticket as there may be some useful info in looking at that project for the engineering team here.

    thanks everyone.
     
  38. FaetterJens

    FaetterJens

    Joined:
    Aug 18, 2015
    Posts:
    10
    Thanks for your reply.

    Average build fail rate (not success rate) is 64% for us the last three months, caused by internal shader compiler error. It should be fairly easy for your team to spot which project build configurations have exactly this kind of problem and improve the build process from there? I do not understand why this has taken so long. Anyway, let's see after Thursday...
     
  39. FaetterJens

    FaetterJens

    Joined:
    Aug 18, 2015
    Posts:
    10
    ..and the problem persists.
     
  40. TheADrain

    TheADrain

    Joined:
    Nov 16, 2016
    Posts:
    48
    Hi guys,

    I'm having this an awful lot since upgrading to 5.6, more than 50% easily.

    Project name is PuzzlerNameGame, it's causing me a lot of headaches. I'm also having a lot of complaints about .meta files that shouldn't exist (for files I've removed), but I don't have those in my local builds. I've tried clean builds too.
     
  41. Jeremy-Lv

    Jeremy-Lv

    Joined:
    Mar 17, 2013
    Posts:
    9
    I got the same problem ,unity version is 5.5.3f1
     
  42. Jeremy-Lv

    Jeremy-Lv

    Joined:
    Mar 17, 2013
    Posts:
    9
    I just add the these shaders to always include group,and no compile errors when use ucloud build .But I do not think this is the right way to solve this issue.
     
  43. SophiaC

    SophiaC

    Unity Technologies

    Joined:
    Sep 6, 2016
    Posts:
    236
    Please do not add the Standard Shader to the Always Included list, though! I don't know if you have done that but I'm just putting that out there for anyone who might see :)
     
  44. Jeremy-Lv

    Jeremy-Lv

    Joined:
    Mar 17, 2013
    Posts:
    9
    Thanks for replay . But If I don't put these shaders to always include , When UCloud build ,it will show me the compile error "Shader compiler: internal error compiling shader snippet type=0 platform=5: Protocol error - failed to read correct magic number" ,and I don't know how to fix these . These shaders I build without UCloud gets no this error ...

    Thanks ~
     
  45. SophiaC

    SophiaC

    Unity Technologies

    Joined:
    Sep 6, 2016
    Posts:
    236
    Hi @fisher-lv, please see Phil's post about the Shader compiler

     
  46. Paylo

    Paylo

    Joined:
    Jun 14, 2014
    Posts:
    18
    Hey,

    Fixed it by resetting the line endings

    This error happend to me multiple times on a shader that had LF & CRLF due to git commit as-is setting.

    Seems to work now. But might be just coincidence fix
     
    Last edited: May 15, 2017
  47. Maras

    Maras

    Joined:
    Dec 11, 2012
    Posts:
    16
    Hey, any update on how to fix? I started getting these errors few days ago and now I am unable to build it via cloud anymore (build via editor works fine).

    Thanks!
     
  48. niceplay_games

    niceplay_games

    Joined:
    Jun 25, 2015
    Posts:
    14
    Same here, started gettings these errors one day ago. First I though it's my problem, but no. In editor everything is fine.



    Error example:

    Code (CSharp):
    1. 211: [Unity] Shader compiler: internal error compiling shader snippet type=0 platform=5: Protocol error - failed to read correct magic number
    2. 212: [Unity] Shader error in 'Sprites/Default': Internal error communicating with the shader compiler process
    3. 213: [Unity] UnityEngine.Debug:LogWarning(Object)
    4. 214: [Unity] Player export failed. Reason: Shader error in 'Sprites/Default': Internal error communicating with the shader compiler process
    5. 215: ! build of 'ios-development' failed. compile failed
    6. 216: publishing finished successfully.
    7. 217: Finished: FAILURE
     
  49. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    662
    I find that this occurs almost 100% after I build without caching the library.
    After I get this error, I switch back to caching and it builds fine.
     
  50. jice_nolaroads

    jice_nolaroads

    Joined:
    Oct 2, 2016
    Posts:
    21
    even with caching it can occur.
    but with caching it's (obviously) less frequent; because there is less things to build.