Swarm Build Problems


I’ve been having problems for the last 7 hours or so getting Swarm to build lighting:

02:52:21: [Interface:OpenChannel] Error: System.IO.IOException: The process cannot access the file 'C:\Users\xxxx\AppData\Local\UnrealEngine\4.7\Saved\Swarm\SwarmCache\AgentStagingArea\A6640D7233BF47B4BBCF76BB4350A2B5.E11D1F9D4C5181716D0067B9C4B45611.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)

Pretty sure .mtrlgz means it’s erroring on a material. I’ve been through every material in the project making sure that there isn’t a duplicate name anywhere and removing any un-needed materials, but still the problem persists.

Is there anyway to get more information about which material this is failing on? E.g. Anyway to unscramble the filename hash back to a material name or enable some kind of verbose logging?

Anyone have any ideas what might be causing this and how I can diagnose the fault?

Many thanks!

EDIT: Tested on another machine and we still have same problem. Cleared cache folder, etc. as well.

Thought I should report back about how I finally got this working, as it wasn’t duplicate materials (at least as far as naming goes).

My process was:

  1. Delete a whole bunch of materials from my materials folder
  2. Close Swarm
  3. Clear Swarm cache (by hand)
  4. Start UE4
  5. Hit build lighting
  6. See if referenced material hash ID in Swarm error message changed
  7. Close UE4
  8. Repeat as necessary until message goes away/changes. Then keep repeating in reverse (copying materials back in) until you get to the culprit.

Eventually I got it down to three assets that Swarm didn’t seem to like being present - I guess duplicate materials/GUID’s but different names, judging on the code I browsed through for Lightmass. It would be great if Swarm could either generate this hash differently (to handle duplicate GUID’s) or at the very least display back the original material name. If I encounter this again in the future I might write a tool to run through the project assets and warn of duplicate GUIDs - it may be quicker overall.