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

Why is is the Source path adding the word source? #175

Closed
joshan1120 opened this issue Nov 3, 2016 · 12 comments
Closed

Why is is the Source path adding the word source? #175

joshan1120 opened this issue Nov 3, 2016 · 12 comments

Comments

@joshan1120
Copy link

I am moving to using and ISO for the install.

I am using net use to map the remote location
I than mount the ISO
I finish by sharing the ISO mount as xSqlServerSetup wants a UNC path

Here is my parameter:
SourcePath = \localhost\sql

This resolved fine and the setup.exe file is in that folder.

I am getting the following error and it seems to be altering the path

Invalid argument: 'Path' with value: '\localhost\sql\Source\setup.exe' File not found in the environment path

Ideas? I didn't have this issue when I was unzipping the ISO, it seems very odd...

@joshan1120
Copy link
Author

I actually figured it out. I still have the parameter for credentials...

@joshan1120
Copy link
Author

joshan1120 commented Nov 3, 2016

Actually that did not resolve it :( still putting \source\ in my path.

Path should just be '\localhost\sql\setup.exe'

I have no idea where Source is coming form

@joshan1120 joshan1120 reopened this Nov 3, 2016
@joshan1120
Copy link
Author

I tried changing it to the Drive Letter. Same result. This is weird...

SourcePath = "G:"

Invalid argument: 'Path' with value: 'G:\Source\setup.exe' File not found in the environment path

@nabrond
Copy link
Contributor

nabrond commented Nov 4, 2016

Looking at the code, xSQLServerSetup uses two parameters to build the path for installation media, $SourcePath and $SourceFolder. The parameter $SourceFolder has a default value of "Source". For your case, I think the right combination of these is:

$SourcePath = '\localhost\'
$SourceFolder = 'sql'

OR

$SourcePath = '\localhost\sql'
$SourceFolder = ''

Hope that helps!

@johlju
Copy link
Member

johlju commented Nov 4, 2016

This is also discussed in #40. The discussion there moved to discussing the removal of the SourceFolder entirely.

To begin with I think we should remove the default value 'Source' from the parameter. I think it is confusing for that parameter to have a default value.
I think it is a old inheritance. I guess the initial contributor used an UNC path and a folder named 'Source' in the share.

If nobody objects I'm happy to do this change in PR #132 that I'm working on. This will be a breaking change though.

@joshan1120
Copy link
Author

It is still causing the test case to fail for some reason.

@johlju
Copy link
Member

johlju commented Nov 4, 2016

Make sure the path is present for the user that runs the resource.

  • If you are using SourceCredential make sure that user has access to the path.
  • If you are using PsDscRunAsCredential make sure that user has access to the path.
  • If you are using neither, then the resource runs under the system account. Then you have to make sure system account can access the path.

Also you have to use two backslashes in the UNC path. If the installation media is in the root of the share, set the SourceFolder parameter to an empty string.

$SourcePath = '\\localhost\sql'
$SourceFolder = ''

I think that should work. But if it still does not work for you. Could you please submit you configuration file (without any sensitive information) and I will test it in my lab.

@johlju
Copy link
Member

johlju commented Nov 4, 2016

You should be able to use a drive letter as well, as long as the account running the resource has permission to it (and can see it).
Note: You can not use SourceCredential when using a drive letter.

$SourcePath = 'G:\'
$SourceFolder = ''

@joshan1120
Copy link
Author

Ya, I removed Sourced Credential as it is no longer required.

Currently it is running as System as it is being called from an Azure template. When I run pointing to the extracted folder and not the ISO and use a source folder it works perfect. When I set it to use the share I create or the drive letter as you specified I get the following error. Trying to figure out why.

I guess I can try running it as PsDscRunAsCredential and see if that helps. Thanks for the tips!

Job {8C553CA2-A29B-11E6-80C7-000D3A24A9E9} :
Message Test-TargetResource returned false after calling set.
HResult -2146233087
StackTrack at System.Management.Automation.Interpreter.ThrowInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)

@johlju
Copy link
Member

johlju commented Nov 4, 2016

The error Test-TargetResource returned false after calling set is typically that the setup.exe did not finish (or couldn't start because of error). At the end of the Set-method it calls the Test-method to verify that all the features are present. If they are not you get that error message.

Example of the error when I was testing other scenarios earlier today.

VERBOSE: [SQLTEST]:                            [[xSQLServerSetup]InstallSql2008Instance] [Set ] Using arguments: /Quiet="True" /IAcceptSQLServerLicenseTerms="True" /Action="Install" /InstanceName="SQL2008" /Features="IS" /BrowserSvcStartupType="Automatic"
VERBOSE: [SQLTEST]:                            [[xSQLServerSetup]InstallSql2008Instance] [Set ] Process matching path 'C:\Windows\TEMP\SQL2008SP4-ENT\setup.exe' started in process ID 1940
VERBOSE: [SQLTEST]:                            [[xSQLServerSetup]InstallSql2008Instance] [Get ] Using path: \\fs.company.local\images\SQL2008SP4-ENT\setup.exe
VERBOSE: [SQLTEST]:                            [[xSQLServerSetup]InstallSql2008Instance] [Test] Features found: ''
VERBOSE: [SQLTEST]:                            [[xSQLServerSetup]InstallSql2008Instance] Test-TargetResource returned false after calling set. | ErrorType: MSFT_xSQLServerSetup.TestFailedAfterSet
VERBOSE: [SQLTEST]: LCM:  [ End    Set      ]  [[xSQLServerSetup]InstallSql2008Instance]  in 146.9890 seconds.
PowerShell DSC resource MSFT_xSQLServerSetup  failed to execute Set-TargetResource functionality with error message: Test-TargetResource returned false after calling set. 
    + CategoryInfo          : InvalidOperation: (:) [], CimException
    + FullyQualifiedErrorId : ProviderOperationExecutionFailure
    + PSComputerName        : sqltest.company.local

Note: The verbose messages are slightly different since I running a PR I'm working on.

@johlju
Copy link
Member

johlju commented Nov 4, 2016

Okay, see if I understand this correctly, so the error always occur when you set SourceFolder parameter to an empty string?

So these two scenarios below does not work for you?

$SourcePath = '\\localhost\sql'
$SourceFolder = ''
$SourcePath = 'G:\'
$SourceFolder = ''

But this scenario does work?

$SourcePath = 'C:\Images'
$SourceFolder = 'MySqlMedia'

@joshan1120
Copy link
Author

thanks you were absolutely right, somehow the setup files got corrupted!!!! ugh :)

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

No branches or pull requests

3 participants