# Swarm failed to kick off. The process cannot access the file

**URL:** <https://forums.unrealengine.com/t/swarm-failed-to-kick-off-the-process-cannot-access-the-file/365964>\
**Category:** Rendering\
**Tags:** swarm, unreal-engine, lighting-problem, question\
**Created:** [August 3, 2016, 8:20am UTC](https://forums.unrealengine.com/t/swarm-failed-to-kick-off-the-process-cannot-access-the-file/365964 "2016-08-03T08:20:35Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raghu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Raghu](https://forums.unrealengine.com/u/Raghu)\
**Post date:** [August 3, 2016, 8:20am UTC](https://forums.unrealengine.com/t/swarm-failed-to-kick-off-the-process-cannot-access-the-file/365964/1 "2016-08-03T08:20:35Z")

</div>

1:45:25 PM: [Interface:TryOpenConnection] Local connection established  
1:45:25 PM: [Job] Accepted Job 8D6ABE68-455CF99C-92AF0D89-03B3A6BA  
1:46:09 PM: [Interface:OpenChannel] Error: System.IO.IOException: The process cannot access the file ‘C:\Users\AppData\Local\UnrealEngine\4.12\Saved\Swarm\SwarmCache\AgentStagingArea\8487AD2E5DBA413C81373D29B2915895.60728AFB41F824FC708C43B616C1C371.mtrlgz’ because it is being used by another process.  
at.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)  
at NSwarm.FSwarmInterface.OpenChannel(String ChannelName, EChannelFlags ChannelFlags)

![101212-2016-08-03_13-52-19.jpg]()

I have already tried the suggestions/solutions posted on similar question threads -

1. Clearing swarm directory
2. Swarm Cache/ validation
3. Copying the whole level into another empty level (without lights and with lights) - tried both options

As I am sure this error is related to materials, deleting all materials from the scene resolves the issue instantly.

But problem with my scene is that I have 1605 materials applied to 9147 actors and it’s becoming really hard to pin point the problem causing material. Tried deleting few 100 of materials but it didn’t resolves the problem.

I was wondering if there is any way to find the material through swarm ‘ **8487AD2E5DBA413C81373D29B2915895.60728AFB41F824FC708C43B616C1C371.mtrlgz** ’

**It would be very helpful to know any method/procedure to pin point the culprit material without randomly deleting and testing the scene.**

---

<div class="post-metadata">

**Author:** ![Arq.CesarBrito](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Arq.CesarBrito](https://forums.unrealengine.com/u/Arq.CesarBrito)\
**Post date:** [September 29, 2016, 2:25am UTC](https://forums.unrealengine.com/t/swarm-failed-to-kick-off-the-process-cannot-access-the-file/365964/2 "2016-09-29T02:25:11Z")

</div>

Hi , are you the same from rag3dviz ??? i LOVE your work, big fan here. i tried the suggestions/solutions posted on similar questions threads too, and what worked for me was finding duplicate materials in the content browser and delete and replace, use filters and be patient. hope it works.

 ![108900-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/d/0/3d04d93faacb6a1c055e65f4216d1fe867c89ca4.png)

---

<div class="post-metadata">

**Author:** ![Ironbelly](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ironbelly/32/990679_2.png) [@Ironbelly](https://forums.unrealengine.com/u/Ironbelly)\
**Post date:** [June 10, 2017, 7:29pm UTC](https://forums.unrealengine.com/t/swarm-failed-to-kick-off-the-process-cannot-access-the-file/365964/3 "2017-06-10T19:29:11Z")

</div>

As mentioned above this is likely due to a duplicate material. As asinine as it is that lightmass can’t bake without every material having a unique name it is true. Go into your content browser, select the top most folder, filter by materials and then click on view options and switch to columns. Much easier to find the dupes that way

---

<div class="post-metadata">

**Author:** ![IslandPlaya](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/islandplaya/32/1194500_2.png) [@IslandPlaya](https://forums.unrealengine.com/u/IslandPlaya)\
**Post date:** [July 22, 2017, 10:14am UTC](https://forums.unrealengine.com/t/swarm-failed-to-kick-off-the-process-cannot-access-the-file/365964/4 "2017-07-22T10:14:26Z")

</div>

Doing as Brito suggests does actually work… eventually. I just waded thru \>1000 material instances removing duplicates. It was painful but stick at it and your lighting will build again. 🙂

---

<div class="post-metadata">

**Author:** ![IslandPlaya](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/islandplaya/32/1194500_2.png) [@IslandPlaya](https://forums.unrealengine.com/u/IslandPlaya)\
**Post date:** [July 22, 2017, 10:30am UTC](https://forums.unrealengine.com/t/swarm-failed-to-kick-off-the-process-cannot-access-the-file/365964/5 "2017-07-22T10:30:33Z")

</div>

Thanks for your answer. It fixed the problem for me after I removed duplicated materials and crucially for me material instances.

---

<div class="post-metadata">

**Author:** ![miike\_on\_300\_fps](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@miike\_on\_300\_fps](https://forums.unrealengine.com/u/miike_on_300_fps)\
**Post date:** [November 17, 2017, 11:16pm UTC](https://forums.unrealengine.com/t/swarm-failed-to-kick-off-the-process-cannot-access-the-file/365964/6 "2017-11-17T23:16:36Z")

</div>

I had this problem for the last week or so. Thanks for sharing the solution! Deleting duplicated materials did the trick.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_be39174c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_be39174c](https://forums.unrealengine.com/u/anonymous_user_be39174c)\
**Post date:** [November 7, 2018, 11:46pm UTC](https://forums.unrealengine.com/t/swarm-failed-to-kick-off-the-process-cannot-access-the-file/365964/7 "2018-11-07T23:46:42Z")

</div>

Just dropped by to see that this did indeed work for me with UE 4.20.3 as well. Found 2 instances of the engine’s starter content M\_Metal\_Chrome, deleted the other one and it started working as soon as I did so

---

<div class="post-metadata">

**Author:** ![Bean\_Seller](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bean\_Seller](https://forums.unrealengine.com/u/Bean_Seller)\
**Post date:** [January 13, 2019, 2:00am UTC](https://forums.unrealengine.com/t/swarm-failed-to-kick-off-the-process-cannot-access-the-file/365964/8 "2019-01-13T02:00:59Z")

</div>

I had this issue, and to solve it I had to `ungroup` some meshes and brushes.

---

<div class="post-metadata">

**Author:** ![Bean\_Seller](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bean\_Seller](https://forums.unrealengine.com/u/Bean_Seller)\
**Post date:** [January 13, 2019, 2:01am UTC](https://forums.unrealengine.com/t/swarm-failed-to-kick-off-the-process-cannot-access-the-file/365964/9 "2019-01-13T02:01:13Z")

</div>

I had this issue, and to solve it I had to `ungroup` some meshes and brushes.

---

<div class="post-metadata">

**Author:** ![Spherical\_Nun](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Spherical\_Nun](https://forums.unrealengine.com/u/Spherical_Nun)\
**Post date:** [February 12, 2021, 5:59am UTC](https://forums.unrealengine.com/t/swarm-failed-to-kick-off-the-process-cannot-access-the-file/365964/10 "2021-02-12T05:59:07Z")

</div>

To make this process easier you can find which textures and materials are duplicates by looking in your output log when the light build fails. It will list out the materials and textures it cannot open a channel for. You can then just search for those ones.

---

<div class="post-metadata">

**Author:** ![Luna2442](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Luna2442](https://forums.unrealengine.com/u/Luna2442)\
**Post date:** [April 26, 2022, 4:34pm UTC](https://forums.unrealengine.com/t/swarm-failed-to-kick-off-the-process-cannot-access-the-file/365964/11 "2022-04-26T16:34:21Z")

</div>

I can’t believe that; 1. I actually tried this and 2. that it actually worked. Geez…
