I have a code that makes a few simple changes to a project using CSOM:
projContext.Load(this.projContext.Projects, pj => pj.Where(p => p.Id == projId));
projContext.ExecuteQuery();
var proj = projContext.Projects.SingleOrDefault(p => p.Id == projId);
var draft = proj.CheckOut();
projContext.Load(draft, p => p.Owner);
projContext.ExecuteQuery();
draft.Owner = managerUser;
var tasks = draft.Tasks;
projContext.Load(tasks, tsk => tsk.IncludeWithDefaultProperties(t => t.Id, t => t.StatusManager));
projContext.ExecuteQuery();
var newTaskId = Guid.NewGuid();
var newTask = new PS.TaskCreationInformation {
Id = Guid.NewGuid(),
Name = "New task",
StatusManager = managerUser,
};
tasks.Add(newTask);
draft.Assignments.Add(new PS.AssignmentCreationInformation {
TaskId = newTaskId,
ResourceId = managerId,
});
var qJob = draft.Update();
var jobState = projContext.WaitForQueue(qJob, TimeoutSeconds);
It works well in development environment, but the Update job in queue fails with internal exception in production environment. This happens only with projects that were created a certain way:
- Fresh enterprise project in PWA;
- Enterprise project created by importing a local project to server using Project Professional.
Here is the queue error:
Your Project Update job failed. Its current state is failed. It was 0 complete. It entered the queue on 12/08/2022 16:24:05 Error ID: 9133 Error ID: 26000
Detailed error below – send it to the administrator for more detailed troubleshooting.
<?xml version="1.0" encoding="utf-16"?> <errinfo><general><class name="Project"><error id="9133" name="ProjectSchedulingEngineException" uid="2d0b12df-fb76-ed11-95ef-005056b6871f" exception="System.ServiceModel.CommunicationObjectAbortedException: The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it has been Aborted. Server stack trace: at System.ServiceModel.Channels.CommunicationObject.ThrowIfDisposedOrNotOpen() at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at Microsoft.Office.Project.Server.BusinessLayer.ProjectEngineUpdate.UpdateProjectWithPCS(IPlatformContext context, ProjectDataSet dataset, Guid projectUid, Guid sessionUid, Boolean inVisibilitySyncMode, Boolean skipEventHandlers, Boolean skipPostSSPUpdate) at Microsoft.Office.Project.Server.BusinessLayer.ProjectMain.HandleProject2(MessageContext mContext, ProjectDataSet dataset, Guid projectUid, Guid sessionUid, Boolean inVisibilitySyncMode)" /></class><class name="Queue"><error id="26000" name="GeneralQueueJobFailed" uid="2e0b12df-fb76-ed11-95ef-005056b6871f" JobUID="c3f6fcdb-fb76-ed11-95ef-005056b6871f" ComputerName="7e53cc63-ebbd-427f-bde0-d1db317abacd" GroupType="ProjectUpdate" MessageType="ProjectUpdate2Message" MessageId="1" Stage="" CorrelationUID="704180a0-0676-40da-abac-d2a039c9acc3" /></class></general> </errinfo>
You can do the following:
- Try troubleshooting using the error IDs, error XML.
- Contact administrator with your jobID (db6df25a-d4c1-4631-b7a1-2e7aae9f5c16) and error XML.
Tried to reproduce the problem on Project Server used for development, no luck yet. Looks like Microsoft is totally responsible for the issue, but maybe someone knows a workaround?