Unreal wrongly tries to write user data to its installation folder

Hi everyone,

I just freshly installed Unreal Engine 5.6 on my Manjaro Linux system. It got to the project browser with no problems, but I can’t create an empty project. Apparently there are some files missing.

I chose “Desktop”, “C++” and “remove VS Code”.

Generating Make project files:
Discovering modules, targets and source code for project...
Unhandled exception: IOException: Permission denied
Wrapped by UnauthorizedAccessException: Access to the path '/opt/unreal-engine/Engine/Intermediate/ProjectFiles/PrimaryProjectName.txt' is denied.
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
   at System.IO.File.OpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at EpicGames.Core.FileReference.WriteAllText(FileReference location, String contents, Encoding encoding) in /mnt/horde/++UE5/Sync/Engine/Source/Programs/Shared/EpicGames.Core/FileReference.cs:line 718
   at UnrealBuildTool.Utils.WriteFileIfChanged(FileItem FileItem, String Contents, StringComparison Comparison, ILogger Logger) in /mnt/horde/++UE5/Sync/Engine/Source/Programs/UnrealBuildTool/System/Utils.cs:line 1883
   at UnrealBuildTool.Utils.WriteFileIfChanged(FileReference Location, String Contents, StringComparison Comparison, ILogger Logger) in /mnt/horde/++UE5/Sync/Engine/Source/Programs/UnrealBuildTool/System/Utils.cs:line 1705
   at UnrealBuildTool.Utils.WriteFileIfChanged(FileReference Location, String Contents, ILogger Logger) in /mnt/horde/++UE5/Sync/Engine/Source/Programs/UnrealBuildTool/System/Utils.cs:line 1693
   at UnrealBuildTool.ProjectFileGenerator.GenerateProjectFiles(PlatformProjectGeneratorCollection PlatformProjectGenerators, String[] Arguments, ILogger Logger) in /mnt/horde/++UE5/Sync/Engine/Source/Programs/UnrealBuildTool/ProjectFiles/ProjectFileGenerator.cs:line 1010
   at UnrealBuildTool.ProjectFileGenerator.GenerateProjectFiles(PlatformProjectGeneratorCollection PlatformProjectGenerators, String[] Arguments, Boolean bCacheDataForEditor, ILogger Logger) in /mnt/horde/++UE5/Sync/Engine/Source/Programs/UnrealBuildTool/ProjectFiles/ProjectFileGenerator.cs:line 903
   at UnrealBuildTool.GenerateProjectFilesMode.ExecuteAsync(CommandLineArguments Arguments, ILogger Logger) in /mnt/horde/++UE5/Sync/Engine/Source/Programs/UnrealBuildTool/Modes/GenerateProjectFilesMode.cs:line 268
   at UnrealBuildTool.UnrealBuildTool.Main(String[] ArgumentsArray) in /mnt/horde/++UE5/Sync/Engine/Source/Programs/UnrealBuildTool/UnrealBuildTool.cs:line 653

The folder “ProjectFiles” was also previously missing. I created it manually, hoping it would help, but apparently Unreal expects some files in there that I simply do not have. I found the “Intermediate” folder in the zip file with the installer that I downloaded from Epic, but there is no “ProjectFiles” in that zip archive.

Please note that this is not a lack of file permissions. The file is simply missing.

What are these files that Unreal is looking for, why are they missing and how do I get them?

Original title was: I can’t create an empty project on Linux, some files are missing from the zip I downloaded

Hello there @KimPossible42!

From your provided log, although you mention this is not a permissions scenario, thefollowing call states otherwise:

Unhandled exception: IOException: Permission denied
Wrapped by UnauthorizedAccessException: Access to the path ‘/opt/unreal-engine/Engine/Intermediate/ProjectFiles/PrimaryProjectName.txt’ is denied.

This means that UE is either trying to access or write on this location, and being prevented by the system to do so. Since your install is located in /opt, the best choice to test here is to move your install to another location, so UE can generate files on startup without clashing with system rights.

Alternatively, you can test the method implemented in the thread below, which encountered and resolved a very similar scenario:

I did notice that the log is about permissions, which is why I checked and noticed that there is no such folder. There are two possible explanations, of which I assumed the better one: Missing files.

The other explanation is that Unreal wants to create that folder and file in a system directory. In this case, it is correct that it does not have permission to do that, as applications are not allowed to write to system directories in general for security reasons. Everything that goes into a system directory should be provided during the installation, not afterwards.

Since Unreal chose that path without asking me, if it still needs to write there after the installation, that’s a bug. Files that are created during runtime should be created in the home directory or a path of my choice, similar to Unity Hub allowing me to determine where new versions and components of the Unity Editor should be installed to.

Sure enough, Unreal wrongly attempts to write to its installation folder, namely /opt/unreal-engine/Engine/Plugins/ and /opt/unreal-engine/Engine/Intermediate/. This is forbidden for good reason.

Some of the data stored there seems to be the last opened project name and path. This is user data and should be stored in user space. So there seem to be some bugs related to where Unreal stores its data, at least on Linux.