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

SqlRs: The helper function Restart-ReportingServicesService timeouts #1114

Closed
johlju opened this issue Apr 21, 2018 · 3 comments · Fixed by #1115
Closed

SqlRs: The helper function Restart-ReportingServicesService timeouts #1114

johlju opened this issue Apr 21, 2018 · 3 comments · Fixed by #1115
Assignees
Labels
bug The issue is a bug.

Comments

@johlju
Copy link
Member

johlju commented Apr 21, 2018

Details of the scenario you tried and the problem that is occurring

When restarting the Reporting Services service with the helper function Restart-ReportingServicesService is is using Restart-Service. The problem seems that Restart-Service timeouts on the build worker sometimes probably because it takes to long to start the service.

This is show here: https://ci.appveyor.com/project/johlju/sqlserverdsc?fullLog=true#L8294

The DSC configuration that is using the resource (as detailed as possible)

The configuration for the integration test for SqlRs.

Version of the operating system and PowerShell the target node is running

Windows Server 2016, WMF 5.1

SQL Server edition and version the target node is running

SQL Server 2016 SP1

What SQL Server PowerShell modules, and which version, are present on the target node.

n/a

Version of the DSC module you're using, or write 'dev' if you're using current dev branch

Dev

@johlju johlju added bug The issue is a bug. in progress The issue is being actively worked on by someone. labels Apr 21, 2018
johlju added a commit to johlju/SqlServerDsc that referenced this issue Apr 21, 2018
- The helper function Restart-ReportingServicesService should no longer timeout
  when restarting the service (issue dsccommunity#1114).
johlju added a commit to johlju/SqlServerDsc that referenced this issue Apr 21, 2018
- Sometimes the integration tests failed to start services in the AppVeyor
  build worker. Now the value 'ServicesPipeTimeout' is set to the max of two
  minutes (default 30 seconds) in appveyor.yml (issue dsccommunity#1114).
@johlju
Copy link
Member Author

johlju commented Apr 22, 2018

Seems this wasn't what I thought it was. The event log in the AppVeyor build worker is reporting

Log Name:      Application
Source:        Report Server Windows Service (DSCRS2016)
Date:          4/21/2018 11:28:53 PM
Event ID:      121
Task Category: Startup/Shutdown
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      APPVYR-WIN
Description:
The Remote Procedure Call (RPC) service failed to start.
Log Name:      Application
Source:        Report Server Windows Service (DSCRS2016)
Date:          4/21/2018 11:28:53 PM
Event ID:      140
Task Category: Startup/Shutdown
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      APPVYR-WIN
Description:
The application domain WindowsService_0 failed to initialize. Error: The endpoint cannot be created.
Log Name:      Application
Source:        Report Server Windows Service (DSCRS2016)
Date:          4/21/2018 11:29:02 PM
Event ID:      140
Task Category: Startup/Shutdown
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      APPVYR-WIN
Description:
The application domain DefaultDomain failed to initialize. Error: RPC Server failed to start..
Log Name:      Application
Source:        SQL Server Reporting Services (DSCRS2016)
Date:          4/21/2018 11:29:02 PM
Event ID:      0
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      APPVYR-WIN
Description:
Service cannot be started. System.Exception: Default appdomain failed to initialize.
   at Microsoft.ReportingServices.Library.ServiceAppDomainController.Start()
   at Microsoft.ReportingServices.Library.ReportService.OnStart(String[] args)
   at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)

@johlju
Copy link
Member Author

johlju commented Apr 22, 2018

It seems the services is restarted to quickly, so something isn't quite ready to service the startup request. If I add a timeout of 60 seconds the service is started properly. Maybe that time can be shortened.

johlju added a commit to johlju/SqlServerDsc that referenced this issue Apr 22, 2018
- The helper function `Restart-ReportingServicesService` should no longer timeout
  when restarting the service (issue dsccommunity#1114).
johlju added a commit to johlju/SqlServerDsc that referenced this issue Apr 22, 2018
- The helper function `Restart-ReportingServicesService` should no longer timeout
  when restarting the service (issue dsccommunity#1114).
@johlju
Copy link
Member Author

johlju commented Apr 22, 2018

Many hits on a search suggest to add a registry key ServicesPipeTimeout with a higher timeout value. This is one of those articles Reporting Services not starting, the service failed or the service did not start in a timely fashion, and here is another How to Work Around Configuration Service Startup Issues. But setting this registry key didn't seem to have any affect.

Only solution was to wait between stopping the services and starting the service. If anyone knows anything more around this, please enlighten me 😃

I will send in a PR shortly that will wait 30 seconds before starting the service after it has been configured.

@johlju johlju self-assigned this Apr 22, 2018
johlju added a commit that referenced this issue Apr 22, 2018
- Changes to SqlAlwaysOnService
  - Minor code cleanup in integration test, fixed the scope on variable.
- Changes to SqlSetup
  - Updated the integration tests to stop some services after each integration test.
    This is to save memory on the AppVeyor build worker.
  - Updated the integration tests to use a SQL Server 2016 Service Pack 1.
- Changes to SqlRS
  - Updated the integration tests to stop the Reporting Services service after
    the integration test. This is to save memory on the AppVeyor build worker.
  - The helper function `Restart-ReportingServicesService` should no longer timeout
    when restarting the service ([issue #1114](#1114)).
- Changes to SqlServiceAccount
  - Updated the integration tests to stop some services after each integration test.
    This is to save memory on the AppVeyor build worker.
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Apr 22, 2018
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.

1 participant