The issue is that the service or process and his service account (specified in services.msc) does not have sufficient privileges to the specified files or folders. To resolve these issues, read and write (R&W) permissions need to be granted to the service or process and his service account on the root folder that contains the specified files.
On every restart of a new Windows Server 2012 R2 Essentials or Windows Server 2012 machine, we could get several instances of the following errors in the Application event log:
Log Name: Application Source: ESENT Event ID: 490 Level: Error Description: svchost (3536) An attempt to open the file "C:\Windows\system32\LogFiles\Sum\Api.chk" for read / write access failed with system error 5 (0x00000005): "Access is denied. ". The open file operation will fail with error -1032 (0xfffffbf8).
Log Name: Application Source: ESENT Event ID: 490 Level: Error Description: svchost (3536) An attempt to open the file "C:\Windows\system32\LogFiles\Sum\SystemIdentity.mdb" for read / write access failed with system error 5 (0x00000005): "Access is denied. ". The open file operation will fail with error -1032 (0xfffffbf8).
Using Sysinternals Process Explorer, we learned that this PID is actually hosting the Remote Desktop Gateway service. We confirmed this by stopping and starting that service; the errors repeated.
Workaround
The Remote Desktop Gateway service runs using the Network Service system account. Once we gave that account Modify permissions on:
C:\Windows\system32\LogFiles\Sum
The ESENT 490 errors stopped. Instead, we get, correctly, these messages when starting the Remote Desktop Gateway service:
Log Name: Application Source: ESENT Event ID: 326 Level: Information Description: svchost (7704) The database engine attached a database (1, C:\Windows\system32\LogFiles\Sum\SystemIdentity.mdb). (Time=0 seconds)
Log Name: Application Source: ESENT Event ID: 327 Level: Information Description: svchost (7704) The database engine detached a database (1, C:\Windows\system32\LogFiles\Sum\SystemIdentity.mdb). (Time=0 seconds)