Project Server 2007: Reporting (Project Publish) queue job fails to complete

This is an issue that several of my readers raised in response to the posting about the orphan baseline posting a few weeks ago, and we know that this is something that more and more customers are now hitting.  The problem was introduced with the February 2012 Cumulative Update for Project Server 2007, and was also present in the April CU too – so if you have installed either of these and have started seeing Reporting (Project Publish) queue job fails to complete then read on. The symptoms are that a project will successfully save and publish, but the Reporting (Project Publish) job will fail to complete, and the error will look something like this (truncated – but the ReportingProjectChangeMessageFailed piece will be repeated based on your queue setting for the retry limit. Error summary/areas: Reporting message processor failed ReportingProjectChangeMessageFailed Queue GeneralQueueJobFailed Error details:                                 The issue occurs because we are missing a NULL check when accessing the task baseline cost – so if it is NULL we get the “Object reference not set to an instance of an object” message.  We are working on a hotfix to correct this behavior, but we also have a workaround that can provide some immediate relief.  This is a macro that can be run on affected project and will set a zero (non-NULL) assignment baseline fixed cost in place of the NULL we are tripping up on.  Below is the macro code that will need to be added to Project in the macro editor, and executed against the plan.  DISCLAIMER: As with any macro code you should review and understand exactly what this code is doing and that you are comfortable to run this on your own plans (and read the disclaimer) – and should also execute this in a test environment first.  It would also be good practice to take an Administrative Backup in your production system to ensure you have good backup copies of your plans (in addition to any normal SQL Server backup).  Also worth mentioning at this point that you should really have the number of project administrative backups set to give you several versions of your plan (Project Retention Policy (versions) – under Server Settings, Database Administration, Schedule Backup. 'DISCLAIMER OF WARRANTY ' 'THIS FIX CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. 'MICROSOFT FURTHER DISCLAIMS ALL IMPLIED WARRANTIES INCLUDING WITHOUT 'LIMITATION ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR OF FITNESS 'FOR A PARTICULAR PURPOSE. THE ENTIRE RISK ARISING OUT OF THE USE OR 'PERFORMANCE OF THE CODE REMAINS WITH YOU. ' 'IN NO EVENT SHALL MICROSOFT OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES 'WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF 'BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, 'OR OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE 'THIS MACRO, EVEN IF MICROSOFT HAS BEEN ADVISED OF THE POSSIBILITY OF 'SUCH DAMAGES. BECAUSE SOME STATES DO NOT ALLOW THE EXCLUSION OR 'LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES, THE 'ABOVE LIMITATION MAY NOT APPLY TO YOU.   'This macro attempts to work around the reporting publish failure that occurs when there are tasks 'with baselines and where the BaselineCost contour is NULL. The symptoms that you see in the queue 'for the "Reporting (Project Publish)" job has details similar to: ' ' ' 'This code simply walks through the tasks in the tasks in the project and if there are 'baseline(s) set, then the code sets a time scaled baseline cost = 0 on the day prior to 'where the baseline start is scheduled.  This sets the baseline contour so that the '"Object reference not set to an instance of an object" problem can be overcome during the 'reporting publish job. Sub FixPublish() Dim t As Tasks Dim tsv As TimeScaleValues Dim i As Long Dim bCalc As Boolean On Error Resume Next 'get the current application calculation state bCalc = Application.Calculation 'set calculation to manual (helps with performance while the code runs) Application.Calculation = pjManual Set t = ActiveProject.Tasks 'walk through the tasks in the project. If a task as a baseline(s) then set a timescaled baselinecost = 0 For i = 1 To t.Count     If Not t(i) Is Nothing Then         If t(i).BaselineStart "NA" Then             Set tsv = t(i).TimeScaleData(t(i).BaselineStart - 1, t(i).BaselineStart - 1, pjTaskTimescaledBaselineCost, pjTimescaleDays)             If tsv(1).Value = "" Then                 tsv(1).Value = 0             End If         End If         If t(i).Baseline1Start "NA" Then             Set tsv = t(i).TimeScaleData(t(i).Baseline1Start - 1, t(i).Baseline1Start - 1, pjTaskTimescaledBaseline1Cost, pjTimescaleDays)             If tsv(1).Value = "" Then                 tsv(1).Value = 0             End If         End If         If t(i).Baseline2Start "NA" Then             Set tsv = t(i).TimeScaleData(t(i).Baseline2Start - 1, t(i).Baseline2Start - 1, pjTaskTimescaledBaseline2Cost, pjTimescaleDays)             If tsv(1).Value = "" Then                 tsv(1).Value = 0             End If         End If         If t(i).Baseline3Start "NA" Then             Set tsv = t(i).TimeScaleData(t(i).Baseline3Start - 1, t(i).Baseline3Start - 1, pjTaskTimescaledBaseline3Cost, pjTimescaleDays)             If tsv(1).Value = "" Then                 tsv(1).Value = 0             End If         End If         If t(i).Baseline4Start "NA" Then             Set tsv = t(i).TimeScaleData(t(i).Baseline4Start - 1, t(i).Baseline4Start - 1, pjTaskTimescaledBaseline4Cost, pjTimescaleDays)             If tsv(1).Value = "" Then                 tsv(1).Value = 0             End If         End If         If t(i).Baseline5Start "NA" Then             Set tsv = t(i).TimeScaleData(t(i).Baseline5Start - 1, t(i).Baseline5Start - 1, pjTaskTimescaledBaseline5Cost, pjTimescaleDays)             If tsv(1).Value = "" Then                 tsv(1).Value = 0             End If         End If         If t(i).Baseline6Start "NA" Then             Set tsv = t(i).TimeScaleData(t(i).Baseline6Start - 1, t(i).Baseline6Start - 1, pjTaskTimescaledBaseline6Cost, pjTimescaleDays)             If tsv(1).Value = "" Then                 tsv(1).Value = 0             End If         End If         If t(i).Baseline7Start "NA" Then             Set tsv = t(i).TimeScaleData(t(i).Baseline7Start - 1, t(i).Baseline7Start - 1, pjTaskTimescaledBaseline7Cost, pjTimescaleDays)             If tsv(1).Value = "" Then                 tsv(1).Value = 0             End If         End If         If t(i).Baseline8Start "NA" Then             Set tsv = t(i).TimeScaleData(t(i).Baseline8Start - 1, t(i).Baseline8Start - 1, pjTaskTimescaledBaseline8Cost, pjTimescaleDays)             If tsv(1).Value = "" Then                 tsv(1).Value = 0             End If         End If         If t(i).Baseline9Start "NA" Then             Set tsv = t(i).TimeScaleData(t(i).Baseline9Start - 1, t(i).Baseline9Start - 1, pjTaskTimescaledBaseline9Cost, pjTimescaleDays)             If tsv(1).Value = "" Then                 tsv(1).Value = 0             End If         End If         If t(i).Baseline10Start "NA" Then             Set tsv = t(i).TimeScaleData(t(i).Baseline10Start - 1, t(i).Baseline10Start - 1, pjTaskTimescaledBaseline10Cost, pjTimescaleDays)             If tsv(1).Value = "" Then                 tsv(1).Value = 0             End If         End If     End If Next 'fix the project summary task With Ac
tiveProject.ProjectSummaryTask     If .BaselineStart "NA" Then         Set tsv = .TimeScaleData(.BaselineStart - 1, .BaselineStart - 1, pjTaskTimescaledBaselineCost, pjTimescaleDays)         If tsv(1).Value = "" Then             tsv(1).Value = 0         End If     End If     If .Baseline1Start "NA" Then         Set tsv = .TimeScaleData(.Baseline1Start - 1, .Baseline1Start - 1, pjTaskTimescaledBaseline1Cost, pjTimescaleDays)         If tsv(1).Value = "" Then             tsv(1).Value = 0         End If     End If     If .Baseline2Start "NA" Then         Set tsv = .TimeScaleData(.Baseline2Start - 1, .Baseline2Start - 1, pjTaskTimescaledBaseline2Cost, pjTimescaleDays)         If tsv(1).Value = "" Then             tsv(1).Value = 0         End If     End If     If .Baseline3Start "NA" Then         Set tsv = .TimeScaleData(.Baseline3Start - 1, .Baseline3Start - 1, pjTaskTimescaledBaseline3Cost, pjTimescaleDays)         If tsv(1).Value = "" Then             tsv(1).Value = 0         End If     End If     If .Baseline4Start "NA" Then         Set tsv = .TimeScaleData(.Baseline4Start - 1, .Baseline4Start - 1, pjTaskTimescaledBaseline4Cost, pjTimescaleDays)         If tsv(1).Value = "" Then             tsv(1).Value = 0         End If     End If     If .Baseline5Start "NA" Then         Set tsv = .TimeScaleData(.Baseline5Start - 1, .Baseline5Start - 1, pjTaskTimescaledBaseline5Cost, pjTimescaleDays)         If tsv(1).Value = "" Then             tsv(1).Value = 0         End If     End If     If .Baseline6Start "NA" Then         Set tsv = .TimeScaleData(.Baseline6Start - 1, .Baseline6Start - 1, pjTaskTimescaledBaseline6Cost, pjTimescaleDays)         If tsv(1).Value = "" Then             tsv(1).Value = 0         End If     End If     If .Baseline7Start "NA" Then         Set tsv = .TimeScaleData(.Baseline7Start - 1, .Baseline7Start - 1, pjTaskTimescaledBaseline7Cost, pjTimescaleDays)         If tsv(1).Value = "" Then             tsv(1).Value = 0         End If     End If     If .Baseline8Start "NA" Then         Set tsv = .TimeScaleData(.Baseline8Start - 1, .Baseline8Start - 1, pjTaskTimescaledBaseline8Cost, pjTimescaleDays)         If tsv(1).Value = "" Then             tsv(1).Value = 0         End If     End If     If .Baseline9Start "NA" Then         Set tsv = .TimeScaleData(.Baseline9Start - 1, .Baseline9Start - 1, pjTaskTimescaledBaseline9Cost, pjTimescaleDays)         If tsv(1).Value = "" Then             tsv(1).Value = 0         End If     End If     If .Baseline10Start "NA" Then         Set tsv = .TimeScaleData(.Baseline10Start - 1, .Baseline10Start - 1, pjTaskTimescaledBaseline10Cost, pjTimescaleDays)         If tsv(1).Value = "" Then             tsv(1).Value = 0         End If     End If End With             'set the application calculation state back the way it was Application.Calculation = bCalc             End Sub To use this macro you can follow these steps: 1. Open Project Professional 2007 and connect to your server instance having the problem. 2. Go to Tools > Macro > Security . 3. Note the Security Level . 4. Set Security Level to Low or Medium .  This will allow the macro to run. 5. Go to Tools, Macro, Visual Basic Editor (or alt+F11) 6. Copy the text from the macro above, from the first line of the disclaimer to the End sub line 7. Double click ThisProject in the Visual Basic Editor, and paste in the macro to the window that opens (probably titled Project1 – ThisProject(Code) 8. Save this plan as a file if you need to use again, as FixPublishError.mpp, and return to the normal Microsoft Project view (Alt+F11) 9. Open the plan whose Reporting (Project Publish) job fails. 10. Go to Tools > Macro > Macros… 11. Select the FixPublishError.mpp!FixPublish macro. 12. Click Run . It will take a few seconds to a minute for the macro to run. 13. Save and publish the plan. 14. Monitor the queue by going to PWA > Personal Settings > My queued jobs. 15. Confirm that the jobs related to your plan complete successfully. 16. Reset Security Level to what is was before changing it to Low. There is one condition that currently isn’t resolved by the macro, and that relates to hitting the NULL value for any ghost tasks you might have in your plan (these can exist due to dependencies on tasks from other plans).  It is possible that this will be resolved if the source project has already been fixed up – we are still reviewing this. Thanks to Adrian for the fix up macro, Sriram for helping get this blog post out and for DFS and Christoph for the posts on my blog raising the issue. Sorry for the inconvenience this issue has caused you, and I will update this post as we get more information regarding a more permanent fix. Finally here are some lines from the ULS logs that relate to this problem – just to ensure that the search engines have something to digest and to help those searching on these terms. 05/23/2012 10:38:09.29    Microsoft.Office.Project.Server (0x0AE4)    0x0EE8    Project Server    Project Server Reporting    9e09    High    PWA:https://servername/PWA, SSP:SharedServices1, User: DOMAINUser, PSI:   [RDS] ReportProjectPublishMessage for project 0b9e52ec-6bb6-4ca3-823b-d7561d821d1c failed. Error: System.NullReferenceException: Object reference not set to an instance of an object.     at Microsoft.Office.Project.DataEdit.Reporting.ReportingData.GetTaskBaselineCoreTimephasedDataSet(BaselineEntity[] baselineEntityArray, Int32 nIntervalLengthMinutes)     at Microsoft.Office.Project.Server.DataAccessLayer.ReportingProjectDal.TransferTimephasedData[T](Guid projectUID, TimephasedTransferInfo transferInfo, ReportingData timephasedReportingData, ProcessSourceData`1 processSourceData, GenerateTimephasedDataSet`1 generateTimephasedData, Int32 pageSize, LogStatsMethod logStats)     at Microsoft.Office.Project.Server.DataAccessLayer.ReportingProjectDal.UpdateTasksTimephasedData(Guid projectUID, ReportingProjectData projectData, ReportingData timephasedReportingData, Int32 pageSize, String& transferPhase, LogStatsMethod logProjStats)     at Microsoft.Office.Project.Server.BusinessLayer.ReportingLayer.ProjectPublishMessageProcessor.SaveProjectTimephaseData(String& transferPhase)     at Microsoft.Office.Project.Server.BusinessLayer.ReportingLayer.ProjectPublishMessageProcessor.runRDSTransformation(ReportProjectPublishMessageEx projectChangeMessage). Phase: SetAssignmentBaselineTimephasedFixedCost    3ff34f2c-815e-4f95-9798-7f17dc5737db 05/23/2012 10:38:09.29    Microsoft.Office.Project.Server (0x0AE4)    0x0EE8    Project Server    Project Server Reporting    9e05    Critical    Standard Information:PSI Entry Point:   Project User: DomainUser Correlation Id: 3ff34f2c-815e-4f95-9798-7f17dc5737db  PWA Site URL: https://servername/PWA  SSP Name: SharedServices1  PSError: ReportingProjectChangeMessageFailed (24006) RDS: The request to synchronize change(s) to project Project UID='0b9e52ec-6bb6-4ca3-823b-d7561d821d1c'. PublishType='ProjectPublish' failed.  Message: 'ReportingProjectChangeMessageFailed'  Error:Object reference not set to an instance of an object.    3ff34f2c-815e-4f95-9798-7f17dc5737db 05/23/2012 10:38:10.30    Microsoft.Office.Project.Server (0x0AE4)    0x0D18    Project Server    Project Server Queue    7h5x    Medium    PWA:https://servername/PWA, SSP:SharedServices1, User: DOMAINSSPAdmin, PSI:   [QUEUE] ProjectQ: Group  d4364343-3402-45ef-afd0-f84c8834e5d3 type = ReportingProjectPublish aborted at Message 1    e45e8c63-38fa-49d8-9555-710851b22c90

Follow this link:
Project Server 2007: Reporting (Project Publish) queue job fails to complete


Leave a comment!

You must be logged in to post a comment.