dsccommunity / SqlServerDsc

This module contains DSC resources for deployment and configuration of Microsoft SQL Server.
MIT License
359 stars 224 forks source link

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

Closed reicher001 closed 6 years ago

reicher001 commented 7 years ago

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 commented 7 years ago

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).

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).

reicher001 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

@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 commented 7 years ago

Here is the requested config file.

reportingServer.zip

claudiospizzi commented 7 years ago

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: https://github.com/PowerShell/xSQLServer/pull/220

luigilink commented 7 years ago

@claudiospizzi Thanks you for your contribution

johlju commented 7 years ago

@claudiospizzi Nice find! Thanks for solving this one!

claudiospizzi commented 7 years ago

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 commented 7 years ago

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

On Wed, Nov 23, 2016 at 10:32 AM, Claudio Spizzi notifications@github.com 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 https://github.com/PowerShell/xSQLServer/issues/202#issuecomment-262564825, or mute the thread https://github.com/notifications/unsubscribe-auth/AWdGtvnisc_3y4bzhnffTYD1-8YioO4Fks5rBGqCgaJpZM4K2FAk .

johlju commented 7 years ago

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

reicher001 commented 7 years ago

Any developments on this issue?

Is there any value in me performing more testing?

johlju commented 7 years ago

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

johlju commented 6 years ago

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