OpsMgr Upgrading to SQL Server 2008 R2–issue with scheduled reports


In one of my latest post I addressed to steps required to successfully move to SQL 2008 R2. Remember you need CU5 for SQL 2008 R2 if not you’ll have performance issues.

Now I want to made you aware of a bug you’re going to encounter once you move OpsMgr to SQL 2008 R2. You won’t be able to edit your scheduled reports, you’ll be able to add new scheduled reports, delete existing ones, but not edit them. Simply put the “Edit Schedule” task is greyed out

image

This is a known bug acknowledged by the product team, currently there’s no workaround except to use SSRS directly to edit your scheduled report parameters, or delete and recreate the subscription. Mind if double click the subscription it will open but the schduling parameters will be completely messed up, so you can change other reporet parameters at the price of losing your scheduling. From my analysis it seems to be related to the fact SRS now returns the scheduling information in utf-16 encoding instead of plain old utf-8.

I’m curious to know if anyone is having the same issue, if so and you hit this post please leave a comment.

For my future reference and for all those interested I detail the basic debugging steps.

This the part of the soap response document that details the scheduling information, with SQL 2008 R2 they are returned in utf-16

<MatchData>&lt;?xml version=”1.0″ encoding=”utf-16″ standalone=”yes”?&gt;&lt;ScheduleDefinition xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance“&gt;&lt;StartDateTime xmlns=”http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices“&gt;2010-09-28T08:03:00.000+02:00&lt;/StartDateTime&gt;&lt;WeeklyRecurrence xmlns=”http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices”&gt;&lt;WeeksInterval&gt;1&lt;/WeeksInterval&gt;&lt;DaysOfWeek&

gt;&lt;Monday&gt;true&lt;

/Monday&gt;&lt;Tuesday&gt;true&lt;/Tuesday&gt;&lt;Wednesday&gt;true&lt;/Wednesday&gt;&lt;Thursday&gt;true&lt;/Thursday&gt;&lt;Friday&gt;true&lt;/Friday&gt;&lt;

/DaysOfWeek&gt;&lt;/WeeklyRecurrence&gt;&lt;/ScheduleDefinition&gt;</MatchData>

With Fabrizio help and the precious Tess’ blog (If broken it is, fix it you should) we dug into the code to get the exception description:

0:000> !pe

Exception object: 00000000065db2a0

Exception type: System.InvalidOperationException

Message: There is an error in XML document (0, 0).

InnerException: System.Xml.XmlException, use !PrintException 00000000065da8b8 to see more

StackTrace (generated):

<none>

StackTraceString: <none>

HResult: 80131509

0:000> !PrintException 00000000065da8b8

Exception object: 00000000065da8b8

Exception type: System.Xml.XmlException

Message: There is no Unicode byte order mark. Cannot switch to Unicode.

InnerException: <none>

StackTrace (generated):

    SP               IP               Function

    000000000019B180 000007FEF605A330 System.Xml.XmlTextReaderImpl.Throw(System.Exception)

    000000000019B1C0 000007FEF5DF85AD System.Xml.XmlTextReaderImpl.CheckEncoding(System.String)

    000000000019B230 000007FEF5DDBB9E System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean)

    000000000019B2D0 000007FEF5DDAA57 System.Xml.XmlTextReaderImpl.Read()

    000000000019B320 000007FEF5DF91D7 System.Xml.XmlReader.MoveToContent()

    000000000019B350 000007FF0032E377 Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderScheduleDefinition.Read23_ScheduleDefinition()

StackTraceString: <none>

HResult: 80131940

Reading the stack lead us to the problematic function, if you’re curious you can event take a look to the code where the exception is trapped

0:000> !CLRStack

OS Thread Id: 0x63c (0)

Child-SP         RetAddr          Call Site

00000000001997f0 000007fef658f865 System.Xml.Serialization.XmlSerializer.Deserialize(System.Xml.XmlReader, System.String, System.Xml.Serialization.XmlDeserializationEvents)

000000000019bbe0 000007fef087ae46 System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo, Boolean)

000000000019bd80 000007fef5df4f48 System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)

000000000019bdd0 000007fef5df4731 System.Xml.Serialization.TempAssembly.InvokeReader(System.Xml.Serialization.XmlMapping, System.Xml.XmlReader, System.Xml.Serialization.XmlDeserializationEvents, System.String)

000000000019beb0 000007fef608f10c System.Xml.Serialization.XmlSerializer.Deserialize(System.Xml.XmlReader, System.String, System.Xml.Serialization.XmlDeserializationEvents)

000000000019c070 000007feeeea885e System.Xml.Serialization.XmlSerializer.Deserialize(System.IO.Stream)

000000000019c110 000007feeeecc64e Microsoft.EnterpriseManagement.Mom.Internal.UI.Reporting.ManagementGroupReporting.DeserializeScheduleDefinition(System.String)

000000000019c180 000007feeeecc380 Microsoft.EnterpriseManagement.Mom.Internal.UI.Reporting.ManagementGroupReportSubscription.LoadScheduleDetails(System.String, Microsoft.EnterpriseManagement.Mom.Internal.UI.Reporting.ReportingService.ParameterValue[])

000000000019c230 000007feeeecc070 Microsoft.EnterpriseManagement.Mom.Internal.UI.Reporting.ManagementGroupReportSubscription.LoadScheduleDetails()

000000000019c360 000007fee9fff654 Microsoft.EnterpriseManagement.Mom.Internal.UI.Reporting.ManagementGroupReportSubscription.get_Schedule()

000000000019c390 000007feef32fb03 Microsoft.EnterpriseManagement.Mom.Internal.UI.Reporting.Views.ReportSubscriptionsView.ReportSubscriptionsView+<>c__DisplayClass1.<UpdateScheduleReportCommand>b__0(System.Object, Microsoft.EnterpriseManagement.ConsoleFramework.ConsoleJobEventArgs)

000000000019c3e0 000007feef32f099 Microsoft.EnterpriseManagement.ConsoleFramework.ConsoleJobsService.RunJob(System.ComponentModel.IComponent, System.EventHandler`1<Microsoft.EnterpriseManagement.ConsoleFramework.ConsoleJobEventArgs>, System.EventHandler`1<Microsoft.EnterpriseManagement.ConsoleFramework.ConsoleJobErrorEventArgs>, System.Object[])

000000000019c4b0 000007fee9fff107 Microsoft.EnterpriseManagement.ConsoleFramework.ConsoleJobsService.RunJob(System.EventHandler`1<Microsoft.EnterpriseManagement.ConsoleFramework.ConsoleJobEventArgs>, System.Object[])

000000000019c500 000007feef300a1b Microsoft.EnterpriseManagement.Mom.Internal.UI.Reporting.Views.ReportSubscriptionsView.ReportSubscriptionsView.UpdateScheduleReportCommand(System.Object, Microsoft.EnterpriseManagement.ConsoleFramework.CommandStatusEventArgs)

000000000019c550 000007fee9fff1f9 Microsoft.EnterpriseManagement.ConsoleFramework.RegisteredCommand.UpdateStatus(System.Windows.Forms.Control, System.Object)

000000000019c5e0 000007fee9ffe155 Microsoft.EnterpriseManagement.Mom.Internal.UI.Reporting.Views.ReportSubscriptionsView.ReportSubscriptionsView.UpdateCommandsStatus()

000000000019c630 000007feefedd3a3 Microsoft.EnterpriseManagement.Mom.Internal.UI.Reporting.Views.ReportSubscriptionsView.ReportSubscriptionsView.ReportList_SelectedIndexChanged(System.Object, System.EventArgs)

000000000019c660 000007feefed3564 System.Windows.Forms.ListView.OnSelectedIndexChanged(System.EventArgs)

000000000019c6a0 000007feefed4a69 System.Windows.Forms.ListView.WmReflectNotify(System.Windows.Forms.Message ByRef)

000000000019ca20 000007feef7b3aa6 System.Windows.Forms.ListView.WndProc(System.Windows.Forms.Message ByRef)

000000000019ca90 000007feefe0f0ed System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)

000000000019cae0 000007feef7b2244 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr, Int32, IntPtr, IntPtr)

000000000019cb90 000007fef665170a DomainBoundILStubClass.IL_STUB(Int64, Int32, Int64, Int64)

000000000019cff0 000007feef7c651c DomainBoundILStubClass.IL_STUB(System.Runtime.InteropServices.HandleRef, Int32, IntPtr, IntPtr)

000000000019d0c0 000007feef7c58a6 System.Windows.Forms.Control.SendMessage(Int32, IntPtr, IntPtr)

000000000019d130 000007feef7d6c18 System.Windows.Forms.Control.ReflectMessageInternal(IntPtr, System.Windows.Forms.Message ByRef)

000000000019d170 000007feef7b3dfd System.Windows.Forms.Control.WmNotify(System.Windows.Forms.Message ByRef)

000000000019d200 000007feef7efadc System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)

000000000019d3b0 000007feef7b3aa6 System.Windows.Forms.Application+ParkingWindow.WndProc(System.Windows.Forms.Message ByRef)

000000000019d410 000007feefe0f0ed System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)

000000000019d460 000007feef7b2244 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr, Int32, IntPtr, IntPtr)

000000000019d510 000007fef665170a DomainBoundILStubClass.IL_STUB(Int64, Int32, Int64, Int64)

000000000019e2e0 000007feefed4721 System.Windows.Forms.NativeWindow.DefWndProc(System.Windows.Forms.Message ByRef)

000000000019e3d0 000007feef7b3aa6 System.Windows.Forms.ListView.WndProc(System.Windows.Forms.Message ByRef)

000000000019e440 000007feefe0f0ed System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)

000000000019e490 000007feef7b2244 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr, Int32, IntPtr, IntPtr)

000000000019e540 000007fef665170a DomainBoundILStubClass.IL_STUB(Int64, Int32, Int64, Int64)

000000000019e7f0 000007feef7ce883 DomainBoundILStubClass.IL_STUB(MSG ByRef)

000000000019e970 000007feef7ce0f8 System.Windows.Forms.Application+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32, Int32, Int32)

000000000019ebc0 000007feef7cdb65 System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Int32, System.Windows.Forms.ApplicationContext)

000000000019ed10 000007feef3527f4 System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Int32, System.Windows.Forms.ApplicationContext)

000000000019ed70 000007feef3529ff Microsoft.EnterpriseManagement.ConsoleFramework.WindowManager.WindowThread(System.Object)

000000000019ee10 000007fef4f267ff Microsoft.EnterpriseManagement.ConsoleFramework.WindowManager.OpenWindowInThisThread(System.Type, Microsoft.EnterpriseManagement.ConsoleFramework.IStartupContext)

000000000019ee90 000007fef1b990b1 Microsoft.EnterpriseManagement.Mom.Internal.UI.Console.ConsoleApplication.Run()

000000000019ef70 000007fef6653b92 Microsoft.EnterpriseManagement.Mom.Internal.UI.Console.Program.Main()

and here is the code returned by Reflector

private void LoadScheduleDetails(string subscriptionSchedule, ParameterValue[] parameters)

{

    this.reportParameters = new Dictionary<string, string[]>(StringComparer.InvariantCultureIgnoreCase);

    if ((parameters != null) && (parameters.Length > 0))

    {

        foreach (ParameterValue value2 in parameters)

        {

            if (value2 != null)

            {

                string[] strArray;

                if (this.reportParameters.TryGetValue(value2.Name, out strArray))

                {

                    string[] array = new string[strArray.Length + 1];

                    strArray.CopyTo(array, 0);

                    array[array.Length – 1] = value2.Value;

                    this.reportParameters[value2.Name] = array;

                }

                else

                {

                    this.reportParameters.Add(value2.Name, new string[] { value2.Value });

                }

            }

        }

    }

    this.schedule = null;

    if (string.Compare(this.subscriptionEventType, “SnapshotUpdated”, true) == 0)

    {

        this.schedule = new ManagementGroupReportSubscriptionShapShotSchedule();

    }

    else if ((string.Compare(this.subscriptionEventType, “TimedSubscription”, true) == 0) && (subscriptionSchedule != null))

    {

        try

        {

            Guid scheduleId = new Guid(subscriptionSchedule);

            this.schedule = new ManagementGroupReportSubscriptionSharedSchedule(scheduleId);

        }

        catch (FormatException)

        {

            this.schedule = null;

        }

        if (this.schedule == null)

        {

            try

            {

                ScheduleDefinition scheduleDefinition = ManagementGroupReporting.DeserializeScheduleDefinition(subscriptionSchedule);

                if (scheduleDefinition != null)

                {

                    this.schedule = new ManagementGroupReportSubscriptionCalendarSchedule(scheduleDefinition);

                }

            }

catch (InvalidOperationException)

            {

                this.schedule = null;

}

        }

    }

}

 

- Daniele

This posting is provided “AS IS” with no warranties, and confers no rights.

About these ads
  1. #1 by Adam on November 15, 2011 - 4:23 am

    You can edit it by just double clicking on it.
    My edit is greyed out too, but double clicking allows me to edit it anyway.

    • #2 by Daniele Grandini on November 15, 2011 - 8:31 am

      Hi Adam, yes indeed, but you won’t be able to change your scheduling…

  2. #3 by Alejandro Pelc on June 30, 2011 - 2:25 pm

    Hi Daniele, I’m having this same issue. Do you know if there’s a workaround on it ?

    • #4 by Daniele Grandini on July 1, 2011 - 12:28 pm

      Hi Alejandro,
      currently there’s no workaround except trying to edit the scheduling information directory from SSRS. I heard the issue will be fixed in CU5 and CU5 should be very close.

      – Daniele

  3. #5 by Evelyn on February 23, 2011 - 5:45 am

    Hi Daniele, just to confirm I too am experiencing this issue. Evelyn

    • #6 by Daniele Grandini on February 23, 2011 - 8:17 am

      Hi Evelyn, thanks to let me know, I will pass this and other “thumbs up” to the product group.

      • #7 by Teboho on February 2, 2012 - 9:29 am

        Hi Daniele,
        I am having the same issue too, would be very happy if we can get a resolution.

        Thanks

      • #8 by Daniele Grandini on February 2, 2012 - 3:46 pm

        From what I know a final resolution is scheduled for CU6, but I don’t have any ETA for it. You know, OM2012 needs to be completed.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 349 other followers

%d bloggers like this: