Lighting build failed. Swarm failed to kick off

Hi there,

For weeks I have been adding to my project without being able to build because of this problem. I’ve tried a lot of things:

  • Checking firewall
  • Moving all my assets to a fresh new level
  • Deleting partial sections of my level
  • Making sure only once instance of swarm agent is running

And none of these have fixed my problem. My level just refuses to build lighting. I came across a post on this answerhub to manually open up the Swarm Agent and I got these red errors in the log:

00:50:30: [Interface:TryOpenConnection] Local connection established
00:50:31: [Job] Accepted Job F5541BFD-4B1F2976-E50A209A-B4EE9601
00:50:46: [Interface:OpenChannel] Error: System.IO.IOException: The process cannot access the file ‘C:\Program Files (x86)\Epic Games\4.9\Engine\Binaries\DotNET\SwarmCache\AgentStagingArea\8487AD2E5DBA413C81373D29B2915895.5E644B1040EA0DFAB078F69FB3B2A393.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)
at NSwarm.FSwarmInterface.OpenChannel(String ChannelName, EChannelFlags ChannelFlags) in D:\Perforce\Epic\UE4\Engine\Source\Editor\SwarmInterface\DotNET\SwarmInterface.cs:line 1590

None of this makes sense to me but maybe to someone else it does? Would really love a fix. Thank you :slight_smile:

  1. Delete contents of the SwarmCache
  2. Check if you have more than one asset with the same name
  3. Try removing lighting/reflection volumes and re-adding it one at a time
  4. If you are using source version try rebuilding Swarm

If all those fail, make a new, blank level and check if it builds, if so, move your assets one by one and see which one is the cause.