This is the issue faced on my test server and I found something interesting. In this blog, we would learn about one of the reasons why SQL Server Reporting Services (SSRS) couldn’t start after regular maintenance.
I stopped SQL related services without any issue during the maintenance window (let’s call it as a fake maintenance as it as my lab server). Now, while restarting the same all the SQL related servers got started except SSRS service. After restart server, it started.
I checked on the internet to find a way to find the cause. I started checking the SSRS error log file Reporting Services Log Files and Sources
Here is the information I could see.
- servicecontroller!WindowsService_0!f80!10/22/2018-06:14:04:: e ERROR: Error initializing configuration from the database: Microsoft.ReportingServices.Library.ReportServerDatabaseUnavailableException: The report server cannot open a connection to the report server database. A connection to the database is required for all requests and processing. —> System.Data.SqlClient.SqlException: Cannot open database “ReportServer” requested by the login. The login failed.Login failed for user ‘sa’.
- resourceutilities!WindowsService_0!f80!10/22/2018-06:14:05:: i INFO: Reporting Services starting SKU: Enterprise
- library!WindowsService_0!fd0!10/22/2018-06:14:05:: e ERROR: Throwing Microsoft.ReportingServices.Library.ReportServerDatabaseUnavailableException: , Microsoft.ReportingServices.Library.ReportServerDatabaseUnavailableException: The report server cannot open a connection to the report server database. A connection to the database is required for all requests and processing. —> System.Data.SqlClient.SqlException: Cannot open database “ReportServer” requested by the login. The login failed.Login failed for user ‘sa’.
- library!WindowsService_0!fd0!10/22/2018-06:14:05:: e ERROR: ServiceStartThread: Exception caught while starting service. Error: Microsoft.ReportingServices.Library.ReportServerDatabaseUnavailableException: The report server cannot open a connection to the report server database. A connection to the database is required for all requests and processing. —> System.Data.SqlClient.SqlException: Cannot open database “ReportServer” requested by the login. The login failed. Login failed for user ‘sa’.
- library!WindowsService_0!fd0!10/22/2018-06:14:05:: e ERROR: ServiceStartThread: Attempting to start service again…
- library!WindowsService_1!ff4!10/22/2018-06:14:55:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerStorageException: , An error occurred within the report server database. This may be due to a connection failure, timeout or low disk condition within the database.;
- library!WindowsService_1!fa0!10/22/2018-06:14:55:: w WARN: Transaction rollback was not executed connection is invalid
- library!WindowsService_1!17ac!10/22/2018-06:15:52:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerStorageException:, An error occurred within the report server database. This may be due to a connection failure, timeout or low disk condition within the database.;
- schedule!WindowsService_1!17ac!10/22/2018-06:15:52:: Unhandled exception caught in Scheduling maintenance thread: Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerStorageException: An error occurred within the report server database. This may be due to a connection failure, timeout or low disk condition within the database. —> System.Data.SqlClient.SqlException: Database ‘msdb’ is being recovered. Waiting until recovery is finished.
Note that there were no numbers in the log. I have added them to provide more explanation.
WORKAROUND/SOLUTION
If we look at each numbered item, it has some messages. Let me put them below with the interesting piece.
- e ERROR: Error initializing configuration from the database: Microsoft.ReportingServices.Library.ReportServerDatabaseUnavailableException: The report server cannot open a connection to the report server database. A connection to the database is required for all requests and processing. —> System.Data.SqlClient.SqlException: Cannot open database “ReportServer” requested by the login. The login failed. Login failed for user ‘sa’.
- i INFO: Reporting Services starting SKU: Enterprise
- e ERROR: Throwing Microsoft.ReportingServices.Library.ReportServerDatabaseUnavailableException: , Microsoft.ReportingServices.Library.ReportServerDatabaseUnavailableException: The report server cannot open a connection to the report server database. A connection to the database is required for all requests and processing. —> System.Data.SqlClient.SqlException: Cannot open database “ReportServer” requested by the login. The login failed. Login failed for user ‘sa’.
- e ERROR: The report server cannot open a connection to the report server database. A connection to the database is required for all requests and processing. —> System.Data.SqlClient.SqlException: Cannot open database “ReportServer” requested by the login. The login failed. Login failed for user ‘sa’.
- e ERROR:Attempting to start service again…
- e ERROR: An error occurred within the report server database. This may be due to a connection failure, timeout or low disk condition within the database.;
- w WARN: Transaction rollback was not executed connection is invalid
- e ERROR: An error occurred within the report server database. This may be due to a connection failure, timeout or low disk condition within the database.;
- e ERROR: An error occurred within the report server database. This may be due to a connection failure, timeout or low disk condition within the database. —> System.Data.SqlClient.SqlException: Database ‘msdb’ is being recovered. Waiting until recovery is finished.
There are three kinds of tags we can see above, i-INFO, e-ERROR, and w-WARN. If you read them again, it would start making sense. As we can see that there may be a connection failure, timeout or low disk condition within the report server database. Also, the system database ‘msdb’ was being recovered and its recovery was not finished. Due to this SSRS service did not start immediately.
When I checked SQL ERRORLOG, I found that MSDB database recovery has taken time to come online and hence SSRS was not able to connect to it. Now, this explained everything and it was a nice experience to do “detective” work to find the root cause.
Reference: Pinal Dave (https://blog.sqlauthority.com)
First appeared on SQL SERVER – Reporting Services Not Starting After Maintenance Window