The selected report is not ready for viewing

While rendering the report (from Report Manager), you get the following error:

The selected report is not ready for viewing. The report is still being rendered or a report snapshot is not available. (rsReportNotReady)

In the report server logs, you will find the following:

w3wp!library!1!07/14/2008-18:33:46:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.ReportNotReadyException: The selected report is not ready for viewing. The report is still being rendered or a report snapshot is not available., ;

Info: Microsoft.ReportingServices.Diagnostics.Utilities.ReportNotReadyException: The selected report is not ready for viewing. The report is still being rendered or a report snapshot is not available. w3wp!library!6!7/14/2008-18:33:47:: i INFO: Cleaned 0 batch records,

0 policies, 0 sessions, 0 cache entries, 0 snapshots, 0 chunks, 0 running jobs, 0 persisted streams

This might have if you have recently repaired your .Net Framework. If you look at the Report Server Virtual Directory, you will find that you are able to browse through the reports but from Report Manager, you will get the above mentioned error. Make sure your Report Server database is accessible and there are no problems with IIS. Also, verify if you have the necessary permissions to view the reports. Check aspnet_isapi.dll mapping under Report Server Virtual Directory under inetmgr snap-in.

  1. 1. Open inetmgr snap-in
  2. 2. Browse to the ReportServer website under "Websites"-> "Properties"
  3. 3. Click on "Virtual Directory" tab
  4. 4. Click on "Configuration"
  5. 5. Make sure the Wilcard Application Maps point to the right aspnet_isapi.dll (right .NET Framework version)

 

Restore operation with LiteSpeed fails with VDI error

While performing a backup/restore operation with LiteSpeed you get the following error:
 
SQLVDI: Loc=CVDS::Close. Desc=Abnormal termination state. ErrorCode=(0). Process=11812. Thread=15828. Client. Instance=PROD. VD=Global\VDI_759A94A8-F3A4-4689-AD2F-F1DDED76218B_0_SQLVDIMemoryName_0.
SQLVDI: Loc=SignalAbort. Desc=Client initiates abort. ErrorCode=(0). Process=11812. Thread=15828. Client. Instance=PROD. VD=Global\VDI_759A94A8-F3A4-4689-AD2F-F1DDED76218B_0_SQLVDIMemoryName_0.
 
When you use simple.exe to check if the SQLVDI.DLL is functioning correctly, you find that you can perform a backup and restore without any hassles. Now, you are left with a Catch-22 situation. Is it SQL Server or is it Litespeed? How do I get the backup to restore or the database backed up. If it is the latter, then you have another option, take a SQL Native Backup Wink.
 
So, the first clue is the highlighted portion in the above error message which is pointing to a Client Side VDI call stating that the Client initiated the Abort. Now why the client initiated the Abort depends on the how the code in the application is written to generate the Abort request.
 
If you enable logging on LiteSpeed, you might find something similar to the verbose output below:
 

8/15/2009 7:39:27 AM: RESTORE log [database name] FROM VIRTUAL_DEVICE=’VDI_9860C32A-718B-457A-8FC4-7F470843F99A_0′, VIRTUAL_DEVICE=’VDI_9860C32A-718B-457A-8FC4-7F470843F99A_1′, VIRTUAL_DEVICE=’VDI_9860C32A-718B-457A-8FC4-7F470843F99A_2′, VIRTUAL_DEVICE=’VDI_9860C32A-718B-457A-8FC4-7F470843F99A_3′, VIRTUAL_DEVICE=’VDI_9860C32A-718B-457A-8FC4-7F470843F99A_4′, VIRTUAL_DEVICE=’VDI_9860C32A-718B-457A-8FC4-7F470843F99A_5′, VIRTUAL_DEVICE=’VDI_9860C32A-718B-457A-8FC4-7F470843F99A_6′, VIRTUAL_DEVICE=’VDI_9860C32A-718B-457A-8FC4-7F470843F99A_7′, VIRTUAL_DEVICE=’VDI_9860C32A-718B-457A-8FC4-7F470843F99A_8′, VIRTUAL_DEVICE=’VDI_9860C32A-718B-457A-8FC4-7F470843F99A_9′, VIRTUAL_DEVICE=’VDI_9860C32A-718B-457A-8FC4-7F470843F99A_10′, VIRTUAL_DEVICE=’VDI_9860C32A-718B-457A-8FC4-7F470843F99A_11′, VIRTUAL_DEVICE=’VDI_9860C32A-718B-457A-8FC4-7F470843F99A_12′, VIRTUAL_DEVICE=’VDI_9860C32A-718B-457A-8FC4-7F470843F99A_13′, VIRTUAL_DEVICE=’VDI_9860C32A-718B-457A-8FC4-7F470843F99A_14′ with blocksize=65536, stats=5, maxtransfersize=1048576, buffercount=30, NORECOVERY, NOUNLOAD, STATS = 10
8/15/2009 7:39:27 AM: VDI::ConfigureVDI -> Read registry value for configuration timeout
8/15/2009 7:39:27 AM: VDI::ConfigureVDI -> Waiting 4294967s for backup/restore command to begin
8/15/2009 7:39:27 AM: hr=80004005

8/15/2009 7:39:27 AM: RESTORE LOG is terminating abnormally.
RESTORE cannot process database ‘<database name>’ because it is in use by this session. It is recommended that the master database be used when performing this operation.
8/15/2009 7:39:27 AM: SLS::ExecSQL -> Error: 12309, Msg: SQL Server has returned a failure message to LiteSpeed 2005 which has prevented the operation from succeeding.
The following message is not a LiteSpeed 2005 message. Please refer to SQL Server books online or Microsoft technical support for a solution:
8/15/2009 7:39:27 AM: SLS::ExecSQL -> End Execute Command
8/15/2009 7:39:27 AM: SLS::ExecSQL -> Wait for VDI config thread
8/15/2009 7:39:47 AM: SLS::ExecSQL -> Forced close the VDI config thread
8/15/2009 7:39:47 AM: SLS::ExecSQL -> Original Msg: RESTORE LOG is terminating abnormally.
RESTORE cannot process database ‘<database name>’ because it is in use by this session. It is recommended that the master database be used when performing this operation.
8/15/2009 7:39:47 AM: SLS::ExecSQL -> Error: 12300, Msg: RESTORE LOG is terminating abnormally.
RESTORE cannot process database ‘<database name>’ because it is in use by this session. It is recommended that the master database be used when performing this operation.
8/15/2009 7:39:47 AM: Error: 12300, Msg: SLS::ExecSQL -> user exception
8/15/2009 7:39:47 AM: Error: 12300, Msg: SLS::execSQL -> End execute with unsuccessfull return code

The above set of messages can be misleading at times. This is a known issue with LiteSpeed when they call the client side version GetConfiguration function. This error happens if any login logged into the SQL instance has their default database set to the database that is currently being restored. This problem will manifest even if the SQL Service Account’s default database is the database being restored. The problem doesn’t occur on LiteSpeed version 4.8 to version 5.1. The problem will occur ONLY if the restore is performed from the LiteSpeed GUI or SSMS (by using LiteSpeed XPROCs). This problem will occur for any kind of restore operation (Full, Differential OR Log).

One possible workaround is to extract the backup files from the Litespeed backup set using the LiteSpeed Extractor utility which would extract the backup file into Microsoft SQL native backup format. After that these backups can be restored using T-SQL commands.

A second workaround is to start the restore operation using the command line option of LiteSpeed.

 

Desktop Heap Issues

Over the past year I have seen multiple servers falling prey to the desktop heap issue due to which CSS has received multiple support calls. And where do I fit into all this. Well SQL Server setup works in two phases, the second phase being service startup. When you have a large (don’t ask me what this number is because it varies based on multiple parameters) number of services running on your server, then the SQL service startup might fail due to which the setup would fail. That is when you would either curse the setup and give it another shot(s) or call CSS.

Read about what the Platforms Escalation team’s blog post about what Desktop Heap is all about:

http://blogs.msdn.com/ntdebugging/archive/2007/01/04/desktop-heap-overview.aspx 

This is when we collect DHeapMon output to analyze the current status of the Desktop Heap. Now, since you have a large number of windows services running on your server, you either have an option of shutting down the non-essential services or follow the steps mentioned in the article below (KB126962).

WORD OF CAUTION: The default values shouldn’t be changed unless Microsoft Support has asked you to do so.

If the total desktop heap becomes the system-wide buffer size, the following event is logged:

Event Type: Warning
Event Category: None
Event ID: 244
Date: Date
Time: Time
User: N/A

Description: Failed to create a desktop due to desktop heap exhaustion.

From the system event logs, you would see the following message:

Failed to create a desktop due to desktop heap exhaustion.

Timeout (30000 milliseconds) waiting for the <SQL Server name> service to connect.
The <SQL Server name> service failed to start due to the following error: The service did not respond to the start or control request in a timely fashion.
The Windows Installer service entered the stopped state.

System      07/08/2009 14:07:07 Warning            244    Win32k                   User information unavailable…    Failed to create a desktop due to desktop heap exhaustion.
System      07/08/2009 14:07:07 Error              7009   Service Control Manager  User information unavailable…    Timeout (30000 milliseconds) waiting for the <SQL Server name> service to connect.
System      07/08/2009 14:07:07 Error              7000   Service Control Manager  User information unavailable…    The SQL Server (<instance name>) service failed to start due to the following error: The service did not respond to the start or control request in a timely fashion.

The above messages would be noticed in the Windows Event Logs around the same time when the SQL setup failed if you are not able to install a SQL patch due to a desktop heap exhaustion issue.

Useful Link

"Out of Memory" error message appears when you have a large number of programs running

http://support.microsoft.com/kb/126962/

184802    User32.dll or Kernel32.dll fails to initialize
http://support.microsoft.com/default.aspx?scid=kb;EN-US;184802

Customizing the TokenPerm in Yukon SP3!!

I had written about the TokenPerm cache store in a previous blog post of mine. The trace flags mentioned in the KB Articles helped in throttling the cache to prevent the cache size from growing out-of-proportions. Recently, a new Trace Flag (-T4621) was added SQL Server 2005 Service Pack 3 (KB959823) to customize the size of the Token Perm cache. Instead of hard coding the quota for Token Perm with the earlier trace flags, you can use the formula to specify the Registry value:
 
Quota = 1,024 * 2 * ( <Number of Distinct Logins> + <Total Number of Users in each database> )
 
Remember to turn off the other trace flags for Token Perm issues that you had activated on your systems previously. You cannot enable trace flag 4621 together with trace flag 4618. When trace flag 4621 and trace flag 4618 are enabled together, trace flag 4618 takes precedence. The reason this trace flag was introduced was to prevent detrimental effect to systems where constant flushing of the Token Perm cache would affect the performance rather than helping it.

Cannot modify table column in SQL Server 2008 using Table Designer

There is a new option added in SQL Server 2008 for modifying tables while using the Table Designed in Management Studio which will prevent saving any changes to a table that needs a drop/re-create of the table. The error that you would see in the Management Studio is:

TITLE: Microsoft SQL Server Management Studio
——————————

User canceled out of save dialog
(MS Visual Database Tools)

If you want to modify a table property through the UI which requires a table recreation, then you need to change the following options in Management Studio:

Tools ->Options-> Designers -> Table and Database Designers -> uncheck the option "Prevent saving changes that require table re-creation"