-
Notifications
You must be signed in to change notification settings - Fork 225
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
SQLSetup - InstallSQLDataDir fails if set to the root of a drive #1254
Comments
This is strange one. So something is parsing the single backslash wrongly? 🤔 Labeled it as a bug and help wanted. |
In SQL Server configuration.ini files, ini have escape characters, so the \ is to cancel the escape character. if ($InstallSQLDataDir.Length -lt 3 -and $InstallSQLDataDir[-1] -ne '') { |
@dmcafe Could you please try with no \ at all in the config ?
If it works the resource could be updated to remove any extra \ . |
Same error when I use this: Here's the relevant blocks from the Summary.txt log file showing that the InstallSQLDataDir isn't properly parsed.
|
This block is removing the slash... and adding it. This was added in PR #404 to handle bugs using cluster, and then updated in various other PR's (after looking at the blame history). But looking at the code it seem to contradict it self. 🤔 Are we removing trailing backslashes, and then adding them back... This seems strange. |
Aha, is it that this code is suppose to remove backslashes from I see this property is not used in the integration tests. We should add that to the integration tests to test this. |
@johlju So there are couple of ways to fix this bug
Change the above logic to make sure if root directory is specified an additional \ is added so that config file will not treat it as an escape character. or change the logic below to make sure that any argument with root directory specified does not get quotes around it i.e. INSTANCEDIR=D:\ rather than "INSTANCEDIR=D:\" I feel approach one is simpler and cleaner, thoughts ?
|
I will go ahead and fix it based on approach 1 and make a pull request. we can discuss if that's not the best way to fix it. @johlju |
@johlju Approach 1 doesn't work well, it still had issues with escape characters, I've gone with approach 2 and it now works well in my test environment. I will make a pull request with this. |
Details of the scenario you tried and the problem that is occurring
When using a drive root (D:\) for the InstallSQLDataDir parameter, the script is inserting an extra double quote that causes errors
Verbose logs showing the problem
From Detail.txt:
(01) 2018-11-15 09:07:30 Slp: Setting: INSTALLSQLDATADIR
(01) 2018-11-15 09:07:30 Slp: Value specified: D:" /UPDATEENABLED=False /ACTION=Install
(01) 2018-11-15 09:07:30 Slp: New setting source: CommandLine; previous setting source: Default
...
(01) 2018-11-15 09:07:55 Slp: The input setting "INSTALLSQLDATADIR" has invalid character " " ". Retry setup with valid value for "INSTALLSQLDATADIR".
From the console:
Suggested solution to the issue
My current workaround is to escape the trailing slash escape
The DSC configuration that is used to reproduce the issue (as detailed as possible)
SQL Server edition and version the target node is running
Microsoft SQL Server 2016 (SP1) (KB3182545) - 13.0.4001.0 (X64)
SQL Server PowerShell modules present on the target node
SQLPS 1.0 C:\Program Files (x86)\Microsoft SQL Server\130\Tools\PowerShell\Modules\SQLPS\SQLPS.psd1
The operating system the target node is running
Microsoft Windows Server 2016 Standard
Version and build of PowerShell the target node is running
5.1.14393.2485
Version of the DSC module that was used ('dev' if using current dev branch)
SqlServerDsc 12.1.0.0 C:\Program Files\WindowsPowerShell\Modules\SqlServerDsc\SqlServerDsc.psd1
The text was updated successfully, but these errors were encountered: