[MDEV-20825] Windows installer for v10.3.x+ fails at starting service (works for v10.1.x) Created: 2019-10-14  Updated: 2019-10-29  Resolved: 2019-10-28

Status: Closed
Project: MariaDB Server
Component/s: Platform Windows
Affects Version/s: 10.3.15, 10.4.8
Fix Version/s: 10.2.28, 10.3.19, 10.4.9

Type: Bug Priority: Minor
Reporter: Julian Halliwell Assignee: Vladislav Vaintroub
Resolution: Fixed Votes: 0
Labels: None
Environment:

Windows Server 2012R2 64-bit


Attachments: File mariadb.err    

 Description   

Running the 64bit Windows msi installers for either 10.3.15 or 10.4.8 on a Windows 2012R2 box results in the UI hanging on starting services and then failing with the error:

Error 1920. Service 'MariaDB' (MariaDB) failed to start. Verify that you have sufficient privileges to start system services.

Running the 10.1.x installer on the same box works fine.

I am installing the server binaries in the default Windows location in C:\Program Files but the data directory is on a separate drive D:, which is likely to be the issue as it has restrictive file permissions. However I can't seem to identify what permissions are missing: the installer is running as an admin account which does have full control over the data directory, as does the system account.

During the installation, the MariaDB windows service seems to be created correctly and the Network Service account under which it runs is (automatically) given full access to the data directory, as is the current individual user account. Are there any other permissions that are required before running the installer?

The attached .err log created during the installation contains several:

failed on '.\ibdata1'. Can't determine file permissions

entries.

I've tried running the installer in verbose mode from the CLI and can supply the full log if necessary. It contains both of the above mentioned errors, which also appear in the Windows event logs.

Given that the 10.1.x installer works in the same environment, what could have changed in these more recent versions to cause this failure?

Thanks.



 Comments   
Comment by Vladislav Vaintroub [ 2019-10-28 ]

The "can't determine file permissions" message is bogus, the actual error comes from failing GetDiskFreeSpace() call. Why it is failing, I do not know, it does not fail for me. procmon shows that this call opens the D:\ volume with just a SYNCHRONIZE access, neither read nor write. So there must be something special about ACLs on the D:\ volume on that box. The MSDN documentation says, calling application must have FILE_LIST_DIRECTORY rights on the root directory

Now, why GetDiskFreeSpace() is called is a different matter. This call does not deliver any vital information to Innodb, it calculates the file system block size, and the only place that value it is used is innodb.sys_tablespaces information schema table. I've fixed the code so that Innodb should start ok. A warning will still be written, but only once

Comment by Vladislav Vaintroub [ 2019-10-28 ]

The account which runs the MSI, local system or whatever, is not of any importance. What is important to start the service, is whether account that runs the service , I.e NetworkService has those permissions. The permission in question is mostly likely(at least from reading the docs), is FILE_LIST_DIRECTORY on the root directory of the volume.

Comment by Julian Halliwell [ 2019-10-29 ]

Thank you Vladislav, you are quite right. I gave the Network Service "List folder contents" permissions on the root D:\ and it all worked fine.

Can you just confirm that the fix you've put in removes the need for this permission to be set (it's not completely clear to me from your comment)?

Thanks again.

Comment by Vladislav Vaintroub [ 2019-10-29 ]

Yes, the fix removes the need for that permission. You'll still have 1 warning written into the error log though, but this is a harmless warning.

Generated at Thu Feb 08 09:02:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.