Friday, August 16, 2013

Project Server - Unable to open the project

You may believe that data of your projects stored in MS Project Server are safe and stored for good. But, sometimes, it may happen that you click on your project name and you get this message:

"Unable to open the project. The workflow associated with the project has been terminated unexpectedly. Please contact your system administrator."


And you might see this happening on many projects. Why is that and how to stop it?

Well, this is default behavior of Project Server. This happens on projects that have been closed for over two months.

Let's say that you close your project (it is approved or rejected and this action closes the workflow). After 60 days, Auto Cleanup job is executed which erases all workflow instances that are closed and over 60 days old. It does that to clean (unnecessary) data from database for better server performance.

This is very bad solution, because users usually want to keep their project data for a longer time then just 60 days.

The good news is that your project data isn't lost, they are just not accessible at this time. The bad news is that your workflow history data is lost for that project and this is the only thing that got erased.

First, you need to prevent this situation happening on other projects.

So, if you want to keep your project data for more than 60 days, you need to disable this automatic Auto Cleanup job in central Administration by following these steps:

1. Go to the Central Administration.
2. On the Quick Launch, click Monitoring.
3. On the Monitoring page, in the Timer Jobs section, click Review job definitions.
4. On the Job Definitions page, in the Title column, click the Workflow Auto Cleanup link that is associated with the Web application for which you want to disable automatic workflow cleanup.
5. On the Edit Timer Job page, click Disable to disable the Workflow Auto Cleanup feature.

With these steps, you've just prevent from this situation repeating on other projects, but, projects which are already affected by this Auto Cleanup job are still blocked, you cannot open them.

How can you get to projects which are already corrupted?

There are couple of solutions, but none of them is optimal solution and probably none of them will satisfy you. Here are some of them:

You can restart workflow for that corrupted project. This is the easiest way, and after this, you can open your project. BUT, it will set your project to the beginning of the workflow and this might confuse users because they might think that this project wasn't already closed and it should have been.

You can change Enterprise Project Type (EPT) for your corrupted project to a EPT that has no workflow associated. BUT, problem with this approach are the same as are for SOLUTION No 1.

You can insert a row to a certain table in SQL database of Project Server. This is my solution, but I would not recommend it because Microsoft strictly prohibits querying Project Server databases directly. I will not write detailed instructions for this (since inserting rows directly to database is not recommended), but if anyone is interested, just leave a comment, and I will send you a SQL queries.
With this solution, you can open your project and see its data and still have the same workflow associated and it will be in closed state.

Restoring data from database backup. This is maybe the cleanest solution, but it can be executed in a very few cases because you might erase some new data with the backup. You can perform this only in specific situations and need to be extremely careful with it, because it can (and probably will) erase some of newer data or newer projects.

Again, there are no good solutions for this problem, but (for me) the least painful is the 3th solution.

No comments:

Post a Comment