My problem

Recently I started doing some more work on Project Server 2013. At them moment I’m working with a customer who has multiple PWA instances running on a Project Server 2013 environment. All instances are slightly different but nothing major, just some different Project templates and custom fields.

All seems to be working in all instances. I can create new projects without any problem. Until…. I tried to create some reports using OData connections.

I have created OData connections to /_api/ProjectData/Tasks, /_api/ProjectData/Projects and /_api/ProjectData/TasksBaselines

This was working in most Project Server Instances however in one instance I’m having some problems.

For the Projects connections things are working well in all environments. For tasks however it’s not. In one of my environments I’m getting:

The content of the data feed is not valid for an Atom feed.

Quite a common error and inn general this means something is wrong!

So the next step I took was to load the following URLs in my browser http://spserver/PWA_instance1/_api/ProjectData/Tasks and http://spserver/PWA_instance2/_api/ProjectData/Tasks. In the failing environment this doesn’t load up as a valid page. In the working environment there is no problem and the page loads fine. Ok so there is something wrong in the data.

I then took a look in the ULS logs. And the clue was there! In the failing instance I added a field called “Project ID” it looks like Project server is messing up here and allows a user to create two fields with the same name.

[bucketHash:7DE3C4C5] SqlException occurred in DAL (ProjectWebApp_Myinstance@SP_SQLSERVER): Class 16, state 1, line 1, number 8156, procedure , error code -2146232060, exception: System.Data.SqlClient.SqlException (0x80131904): The column ‘ProjectID’ was specified multiple times for ‘OdataSelect’. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) at Microsoft.Office.Project.Server.Data.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock) at Microsoft.Office.Project.Server.Data.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior) at Microsoft.Office.Project.Server.DataAccessLayer.DAL.SubDal.<>c__DisplayClass32.b__30(IProjectServerSqlSession session) at Microsoft.Office.Project.Server.Security.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) at Microsoft.Office.Project.Server.DataAccessLayer.DAL.RetryableExecuteHandlerWithSession(IProjectServerSqlSession session, Action`1 actionHandler, Boolean allowRetry) ClientConnectionId:3589eaca-9a4d-49fe-8080-9d0600309eaf System.Data.SqlClient.SqlException (0x80131904): The column ‘ProjectID’ was specified multiple times for ‘OdataSelect’. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) at Microsoft.Office.Project.Server.Data.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock) at Microsoft.Office.Project.Server.Data.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior) at Microsoft.Office.Project.Server.DataAccessLayer.DAL.SubDal.<>c__DisplayClass32.b__30(IProjectServerSqlSession session) at Microsoft.Office.Project.Server.Security.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) at Microsoft.Office.Project.Server.DataAccessLayer.DAL.RetryableExecuteHandlerWithSession(IProjectServerSqlSession session, Action`1 actionHandler, Boolean allowRetry) ClientConnectionId:3589eaca-9a4d-49fe-8080-9d0600309eaf Source: .Net SqlClient Data Provider Server: XXXXXXXXXXXXX,1433 LineNumber: 1 StackTrace: at Microsoft.Office.Project.Server.Native.dll: (sig=435d7b9e-6d66-4296-9702-0defb7d00da1|2|microsoft.office.project.server.native.pdb, offset=3C1E) at Microsoft.Office.Project.Server.Native.dll: (offset=1254D)

My Solution

When I renamed my custom field to Project_ID the problem disappeared.

Advertisements