UnauthorizedAccessException when cooking for Mac on OS X10.11

We’ve been working on compiling our next game for OS X. However, we seem to have hit a deadend when cooking the game (again!). It seems like everytime the cook is running, the file “Name.app/Contents/Info.plist” get created in with readonly permissions. No matter if we try to reset this permissions to allow all users to write, and we believe it’s causing the exception below:

Program.Main: ERROR: AutomationTool terminated with exception: System.UnauthorizedAccessException: Access to the path “/Users/mike/Development//RadRodgers/Rad/UnrealEngine//Intermediate/Staging/.app/Contents/Info.plist” is denied.
at System.IO.FileStream…ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) <0x1a28f00 + 0x00708> in :0
at System.IO.FileStream…ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, System.String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) <0x1a28e30 + 0x0004f> in :0
at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions,string,bool,bool,bool)
at System.IO.StreamWriter.CreateFile (System.String path, Boolean append, Boolean checkHost) <0x186fb30 + 0x000a4> in :0
at System.IO.StreamWriter…ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize, Boolean checkHost) <0x186f7b0 + 0x0006c> in :0
at System.IO.StreamWriter…ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize) <0x186f760 + 0x00042> in :0
at System.IO.StreamWriter…ctor (System.String path, Boolean append, System.Text.Encoding encoding) <0x186f710 + 0x0003b> in :0
at (wrapper remoting-invoke-with-check) System.IO.StreamWriter:.ctor (string,bool,System.Text.Encoding)
at System.IO.File.WriteAllText (System.String path, System.String contents, System.Text.Encoding encoding) <0x1a27160 + 0x0004a> in :0
at System.IO.File.WriteAllText (System.String path, System.String contents) <0x1a27120 + 0x0002d> in :0
at MacPlatform.StageBootstrapExecutable (DeploymentContext SC, System.String ExeName, System.String TargetFile, System.String StagedRelativeTargetPath, System.String StagedArguments) <0x6127498 + 0x0099b> in :0
at MacPlatform.GetFilesToDeployOrStage (AutomationTool.ProjectParams Params, DeploymentContext SC) <0x6123828 + 0x012cf> in :0
at Project.CreateStagingManifest (AutomationTool.ProjectParams Params, DeploymentContext SC) <0x6120130 + 0x00abb> in :0
at Project.CopyBuildToStagingDirectory (AutomationTool.ProjectParams Params) <0x6006fd0 + 0x0013b> in :0
at BuildCookRun.DoBuildCookRun (AutomationTool.ProjectParams Params) <0x5f2d1c8 + 0x00133> in :0
at BuildCookRun.ExecuteBuild () <0x5c1c020 + 0x00083> in :0
at AutomationTool.BuildCommand.Execute () <0x5c1c008 + 0x00010> in :0
at AutomationTool.Automation.Execute (System.Collections.Generic.List1 CommandsToExecute, Tools.DotNETCommon.CaselessDictionary.CaselessDictionary1 Commands) <0x5c1bbc8 + 0x0013b> in :0
at AutomationTool.Automation.Process (System.String CommandLine) <0x5427070 + 0x0048f> in :0
at AutomationTool.Program.MainProc (System.Object Param) <0x5426878 + 0x00047> in :0
at AutomationTool.InternalUtils.RunSingleInstance (System.Func`2 Main, System.Object Param) <0x5426490 + 0x00240> in :0
at AutomationTool.Program.Main () <0x6bdfd8 + 0x0046f> in :0

The game is cooked using the following command:

./RunUAT.command BuildCookRun -project=“.//.uproject” -noP4 -platform=Mac -clientconfig=Development -serverconfig=Development -cook -allmaps -build -stage -pak -archive -archivedirectory=“./SteamGame/content”

Any help would be greatly appreciated.

(please note, I’ve had to “hide” some parts as our game is still unannounced :wink: )

Thanks,
Mike

Hello,

  • Are you using any external plugins?
  • Are you ensuring that XCode and any other related softwares are closed during the process?
  • Have you checked to ensure that no antivirus software is interfering?
  • Does this occur in a clean, blank project?

Hi Sean!

I’ll check out with a blank project.

As for the rest, Xcode is closed down and I don’t run anti virus on the Mac building.

Also, it’s not that the file is locked by any program. The filesystem permissions are set to --r-r-r (read by owner, read by group, read by all). However, it seems like the compiler tries to write to this file after it’s set it as read-only. Changing permissions don’t work as it seems to get reset on every run.

Thanks for the information. Let me know the results after packaging a blank project. If it fails, please provide the full output log from your project’s Saved->Logs folder.

Thanks!

Hi again!

I tried to compile a blank project, but that seems to a lack a whole lot. I think I might have forgotten to mention one important detail, which is that we compile the engine ourselves (fork from github). We recently upgraded to 4.12.

Furthermore, the primary target of development is PC and PS4. My task is simply to test out if everything will compile and cook for Mac, and it seems to compile and cook just fine except for the staging phase. I’ve tried to use -nostage flag as well, but to no avail.

I hope this helps.

I found a few Answerhub posts that contain different suggestions you can try. Some are related to Visual Studio, but there are others just related to generic permissions checks on your files and so on. Take a look at the posts and let me know if any of those suggestions help.

I haven’t seen this issue on our end, so I’m going to look into it further in the meantime.

Hello,

I am marking this topic as resolved for tracking purposes, as we have not heard from you in a few days. If this issue persists, feel free to respond to this thread. For any new issues, please create a new Answerhub topic.

Have a great day