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

PowerShell DSC resource MSFT_xSQLServerRSConfig failed to execute Set-TargetResource #202

Closed
reicher001 opened this issue Nov 18, 2016 · 14 comments
Labels
bug The issue is a bug.

Comments

@reicher001
Copy link

Here is the config in question.

xSQLServerRSConfig SQLServerRSConfig
{
DependsOn = "[xSqlServerSetup]SQLServerRSSetup", "[xCredSSP]Client", "[xCredSSP]Server"
InstanceName = $Node.InstanceName
RSSQLServer = $Node.RSSQLServer
RSSQLInstanceName = $Node.RSSQLInstanceName
SQLAdminCredential = Get-Credential $Node.SQLAdminCredential
}

This results in the following error.

VERBOSE: [SSRS01]: LCM: [ End Set ] [[xSQLServerRSConfig]SQLServerRSConfig] in 20.7200 seconds.
PowerShell DSC resource MSFT_xSQLServerRSConfig failed to execute Set-TargetResource functionality with error
message: Test-TargetResource returned false after calling set.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : SSRS01

VERBOSE: [SSRS01]: LCM: [ End Set ]
The SendConfigurationApply function did not succeed.
+ CategoryInfo : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : MI RESULT 1
+ PSComputerName : SSRS01

I have looked at the Microsoft --> Windows --> Desired State Configuration --> Operational event logs and see the following.

Job {C475915E-AD3A-11E6-A943-000D3A72D03D} :
Message Test-TargetResource returned false after calling set.
HResult -2146233087
StackTrack at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings)
at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings)
at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
at Microsoft.PowerShell.DesiredStateConfiguration.Internal.ResourceProviderAdapter.ExecuteCommand(PowerShell powerShell, ResourceModuleInfo resInfo, String operationCmd, List1 acceptedProperties, CimInstance nonResourcePropeties, CimInstance resourceConfiguration, LCMDebugMode debugMode, PSInvocationSettings pSInvocationSettings, UInt32& resultStatusHandle, Collection1& result, ErrorRecord& errorRecord, PSModuleInfo localRunSpaceModuleInfo)

Job {C475915E-AD3A-11E6-A943-000D3A72D03D} :
This event indicates that failure happens when LCM is processing the configuration. Error Id is 0x1. Error Detail is The SendConfigurationApply function did not succeed.. Resource Id is [xSQLServerRSConfig]SQLServerRSConfig and Source Info is C:\DSC_BuildDrop\reportingServer.ps1::66::3::xSQLServerRSConfig. Error Message is PowerShell DSC resource MSFT_xSQLServerRSConfig failed to execute Set-TargetResource functionality with error message: Test-TargetResource returned false after calling set. .

Job {C475915E-AD3A-11E6-A943-000D3A72D03D} :
MIResult: 1
Error Message: PowerShell DSC resource MSFT_xSQLServerRSConfig failed to execute Set-TargetResource functionality with error message: Test-TargetResource returned false after calling set.
Message ID: ProviderOperationExecutionFailure
Error Category: 7
Error Code: 1
Error Type: MI

What steps can I take to troubleshoot this further?

@johlju johlju added help wanted The issue is up for grabs for anyone in the community. question The issue is a question. labels Nov 18, 2016
@johlju
Copy link
Member

johlju commented Nov 19, 2016

Sorry that it took so long to get you your issue. The error message 'Test-TargetResource returned false after calling set' is thrown at the end of the Set-method when it calls the Test-mothod to verify that everything was setup correctly. Test-method returns $false here which means something went wrong in the Set-method.

I'm not familiar with this resource yet. So for me to faster test this in my lab it would help immensely if you could provide you configuration file (stripped of any sensitive information of course).
Is the configuration file something you could provide me?
And also, what version of SQL are you installing?

I see the code does not output any verbose information. And there is no error handling until the end (where you get the error).
The error that happens, happens in the code without the code throwing an error. So if you can provide me with your configuration file, I can verify each step and see where it fails and fix the code.

If I look at the code the following is suppose to happen (in order).

  • Configure report server

    • Set virtual directory
    • Reserv URL
  • Configure report manager

    • Set virtual directory
    • Reserv URL
  • Generate database script to local file written to a random temp file

  • Set machine account identity

  • Generate database rights script to local file written to a random temp file

  • Executes database script using sqlcmd.exe

  • Executes database rights script using sqlcmd.exe

  • Run the Test-method to verify success. Success equals if IsInitialized = $true. Abstract of the code below.

    $SQLVersion = 12
    $InstanceName = 'MSSQLSERVER'
    $RSConfig = Get-WmiObject -Class MSReportServer_ConfigurationSetting -Namespace "root\Microsoft\SQLServer\ReportServer\RS_$InstanceName\v$SQLVersion\Admin"
    $IsInitialized = $RSConfig.IsInitialized
    

So with this information, maybe you could find out how far it come. Because I don't think you will find any better information about the error than you submitted above, since the code does not throw any error expect at the end (which is at no use).

@johlju johlju added the bug The issue is a bug. label Nov 19, 2016
@reicher001
Copy link
Author

Here is my redacted config file. You will see values for other DSC resources that can be ignored.
config_redacted.zip

I am working with SQL Server 2016.

Thanks,
Rick

@reicher001
Copy link
Author

The Web Service URL virtual directory was created. Accessing it returns this message "The report server has encountered a configuration error. (rsServerConfigurationError)".

The Web Portal URL shows a message stating the virtual directory has not been configured.

The ReportServer & ReportServerTemp databases are not be created on the remote database engine server

@johlju
Copy link
Member

johlju commented Nov 20, 2016

@reicher001 Thanks for the config file. But I can only see you variables you are using in the file you attached. Not the actual configuration with the resources you are using, which should be at least xSQLServerSetup and xSQLServerRSConfig.
Could you please provide that too? 😄

@reicher001
Copy link
Author

Here is the requested config file.

reportingServer.zip

@claudiospizzi
Copy link
Contributor

claudiospizzi commented Nov 23, 2016

Hi. I'm facing the same issue and I think, it is related to a braking change introduced to SQL 2016:
https://msdn.microsoft.com/en-us/library/ms143380.aspx?f=255&MSPPError=-2147217396

It is used in this lines:
https://github.com/PowerShell/xSQLServer/blob/dev/DSCResources/MSFT_xSQLServerRSConfig/MSFT_xSQLServerRSConfig.psm1#L131

I've created a pull request to solve the issue:
#220

@luigilink
Copy link
Contributor

@claudiospizzi Thanks you for your contribution

@johlju
Copy link
Member

johlju commented Nov 23, 2016

@claudiospizzi Nice find! Thanks for solving this one!

@johlju johlju added the in progress The issue is being actively worked on by someone. label Nov 23, 2016
@claudiospizzi
Copy link
Contributor

Thanks.

But I'm facing the next issue related with this resource and SQL 2016, so the resource is still not usable. More pull requests to come. ;-)

@reicher001
Copy link
Author

reicher001 commented Nov 23, 2016

@claudiospizzi https://github.com/claudiospizzi Thank you for help.

On Wed, Nov 23, 2016 at 10:32 AM, Claudio Spizzi [email protected]
wrote:

Thanks.

But I'm facing the next issue related with this resource and SQL 2016, so
the resource is still not usable. More pull requests to come. ;-)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#202 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AWdGtvnisc_3y4bzhnffTYD1-8YioO4Fks5rBGqCgaJpZM4K2FAk
.

@johlju
Copy link
Member

johlju commented Nov 23, 2016

@claudiospizzi We are happy for any fixes and improvements you can PR in. Keep them coming. 😄

@johlju johlju removed the in progress The issue is being actively worked on by someone. label Dec 19, 2016
@reicher001
Copy link
Author

Any developments on this issue?

Is there any value in me performing more testing?

@johlju
Copy link
Member

johlju commented Dec 27, 2016

@reicher001 we have to wait until the PR #220 is merged. Currently the PR is waiting for @claudiospizzi to resolve review comments.

@johlju johlju added in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels Dec 27, 2016
@johlju johlju removed the question The issue is a question. label Jun 6, 2017
@johlju
Copy link
Member

johlju commented Sep 23, 2017

This was merged in PR #575. Closing this issue. If there is still a problem, then please feel free to reopen this issue.

@johlju johlju closed this as completed Sep 23, 2017
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Sep 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants