Lightning Build Failed. Swarm Failed to Kick off

Hello everyone. This question should be in the Answerhub, however I have literally looked through every solution I can find in the Answerhub and asked the same question 3 times without getting a solution. This problem started happening when I created a duplicate of the project in 4.7 from 4.6. Here is a list of thigns I tried so far

  • Making sure Firewall isn’t the issue
  • Making sure there aren’t multiple Swarm clients running
  • Reinstalling UE4
  • Making sure I have a decent amount of space in my C drive
  • Renaming all the meshes in my project
  • Deleting all lights in my level (point lights, spotlights)
  • Copying everything from the level to another level

And none of these solutions have worked for me! Unless I did not try a solution properly, or something really weird is going on here. I’ve been having this problem ever since 4.7 came out and it’s kept me frustrated for the past month.

Can anyone here help?

This is the error I’m getting from the Swarm Agent:

9:55:34 PM: [Interface:OpenChannel] Error: System.IO.IOException: The process cannot access the file ‘C:\Users\Valachio\AppData\Local\UnrealEngine\4.7\Saved\Swarm\SwarmCache\AgentStagingArea\A6640D7233BF47B4BBCF76BB4350A2B5.25C261E544319B7D3D2EAFB0A8192CAB.mtrlgz’ because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share)
at NSwarm.FSwarmInterface.OpenChannel(String ChannelName, EChannelFlags ChannelFlags)

Go to Users->(your username)->Appdata->Local->UnrealEngine->4.7 and delete everything that is inside that folder. Before deleting make sure to take a backup just in-case. Also you can try is to go the launcher select your version and verify. Hope this works

Best Regards

Tried that, did not work

Anyone else have any suggestions? :frowning:

Well we had similiar problem. There was some bizzare issue with a material that was not working properly like for e.g. some material is not complied properly. If you have fewer assets in your scene, just go through assets and check if they all are complied properly.

How do I check if they are compiled properly?

The only way I know is to open up each material in the material editor with the “stats” panel open, it will tell you if there’s a bad sampler type or something like that.

In my case of updating a project to 4.7, I didn’t have a problem with any assets (that I know of…) but I had swarm failing to start right after “exporting geometry”. In addition to deleting the local AppData, I also had to open swarm and clean/validate the cache before swarm would build successfully. Hope that helps.

I got hundreds of materials and it’ll be a ***** to go through them all. I highly doubt it’s the meshes/materials that is causing my problem because I can build lighting on any other level in the same project, just not on my main level. I did try the cleaning/validating options in the Swarm client but it still doesn’t work.

I agree with Wes H about material editor. I understand the hassale that you have to go though but it’s worth the effort.

Best Regards

If you can build fine in other maps of the same project, the issue may lie within that particular map itself, or materials/meshes that are unique to that map.

Alright, I’ll go through all the meshes/materials on my map.

For the materials, I’m not 100% sure but I think you can skip the materialInstances, as they should inherit the fixes from the parent material’s recompile… Another good motivation to use fewer raw materials and more materialInstances.

Also one more thing, you can try just cooking/“Launch” the map, when cooking it might log all the assets with errors for you to track down. Also if you run in the viewport/PIE, be sure to look at the “output Log” too, just in case more info pops up there to help narrow down your problem.

Agreed, material instances are very efficient for times like this. Although I got the impression based on his comment that they weren’t. You should still be able to isolate which materials/meshes are in use in that particular map I would think.

What do you mean by cooking/“Launch” the map? You mean just like starting up the map from the Library?


I solved it by deleting a mesh. Tens of hours of pain and misery caused by a single corrupt mesh. Oh man…

… Unfortunately now it seems like the lighting build is stuck at 0%

How long was it at 0%? The other day I built lighting in a new level and it was stuck at 85% for about ten minutes. Give it about ten to fifteen to see if it completes or progresses. Also I may be stating the obvious but be sure you have a lightmass importance volume. The fact that you can build other maps within the project just fine, but not this particular one means there has to be something unique to that map that is impeding the light build. What caused you to delete the mesh that you did, was there something you found wrong with it?

Yes I do have a lightmass importance volume, I even shrunk it into a tiny size to see if it will build faster. Both attempts made building lighting stuck at 0% for more than 5 minutes.

Again, building lighting on other levels in the same project has no problems. Just on this particular level.

I encountered the same problem, lightening stuck at 0%. It was better with previous versions.

You can be stuck at 0% for hours…if the scene is huge and/or the settings are very high. Check in the swarm agent program and look for the SWARM STATUS tab to see if it’s working or frozen. Usually it’s doing something even tho the completion % isn’t updating in Ue4. Good luck