Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packer - Elevated privileges required for installation of a local SQL Express database (Install-MockDatabaseServer.ps1) on Windows Server Core (2016/2019) #95

Open
beutepa opened this issue Jan 31, 2019 · 1 comment

Comments

@beutepa
Copy link
Collaborator

beutepa commented Jan 31, 2019

If you want to provision the Vagrant box with a local SQL Server Express database, using Install-MockDatabaseServer.ps1 , you need to run it with elevated privileges.
E.g. by running the provisioner using the elevated_user and elevated_password combination:

...
    {
      "type": "powershell",
      "elevated_user": "vagrant",
      "elevated_password": "vagrant",
      "inline": [
        "$ishBootstrapItem=& C:/Provision/ISHBootstrap/Source/Builders/Database/Install-MockDatabaseServer.ps1 -ISHVersion {{user `ishVersion`}} -MockConnectionString \"{{user `ish_mock_connectionstring`}}\""
      ]
    },
...

Otherwise the installation will fail with the following error (in the installation log (%programfiles%\MicrosoftSQL Server\<server version>\Setup Bootstrap\Log\):

...
Exception type: Microsoft.SqlServer.Chainer.Infrastructure.ChainerInfrastructureException 
Message: There was an error generating the XML document. HResult : 0x84b10001 FacilityCode : 1201 (4b1) ErrorCode : 1 (0001) 
Data: DisableWatson = true Stack: at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.SerializeObject(String rootPath, Object objectToSerialize, Boolean saveToCache) 
...

Sql server installation is failing. #5472

Note: The example Vagrant packer files do not contain this provisioner out-of-the-box.

@beutepa beutepa added the bug label Jan 31, 2019
@beutepa beutepa self-assigned this Jan 31, 2019
@beutepa beutepa changed the title Packer - Issue installing local SQL Express database on Windows Server 2016/2019 for (Hyper-V) Vagrant boxes Packer - Issue installing local SQL Express database on Windows Server Core (2016/2019) for (Hyper-V) Vagrant boxes Jan 31, 2019
@beutepa beutepa changed the title Packer - Issue installing local SQL Express database on Windows Server Core (2016/2019) for (Hyper-V) Vagrant boxes Packer - Elevated privileges required for installation of a local SQL Express database (Install-MockDatabaseServer.ps1) on Windows Server Core (2016/2019) Jan 31, 2019
@beutepa
Copy link
Collaborator Author

beutepa commented Feb 8, 2019

Can this be checked inside the script or just add it to the README, or ...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant