Package build gets stuck

We are having weird issues with our build server. When we make a clean build it works without any issues but it takes a long time (as it should). But when we make a build after a clean build we can sometimes get stuck on the line
LogInit: Display: Loading text-based GConfig…
LogModuleManager: Warning: ModuleManager: Unable to load module ‘OodleDataCompressionFormat’ - 0 instances of that module name found.

The build server don’t crash or anything, I even let it be once for over 100h to see if it could get unstuck but when this happens we have to manually stop the build server and force it to a clean build.

Any help or suggestions are appreciated.