Microsoft Project Server 2019 on premise: ServiceModel.CommunicationObjectAbortedException in Project Update queue job created using CSOM - ms-project

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?

Related

ASP.NET Web API cause exceptions while running on raspberry pi 2 (ARM)

I have coded a Web API in Ubuntu using .NET Core recently and I need to use database to store the application data so that I decided to use EF Core. I ran this project on Ubuntu machine and everything worked appropriately.
I've also tried to run it on my raspberry pi 2 but I wasn't lucky enough to make it work properly. I did the instruction on this website and got this output as soon as I tried to access the api/dooz on Firefox while accessing my RP through Remmina Remote Desktop.
If the problem is with the database, how can I include the .db file to the iDooz_1/bin/Release/netcoreapp2.1/linux-arm/publish folder to make it work?
How can I solve it?
c343#RP:~/publish_idooz1$ ./iDooz_1
Hosting environment: Production
Content root path: /home/c343/publish_idooz1
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.
warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3]
Failed to determine the https port for redirect.
fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HLFUSJJ3S54N", Request id "0HLFUSJJ3S54N:00000001": An unhandled exception was thrown by the application.
Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 1: 'no such table: Players'.
at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements(Stopwatch timer)+MoveNext()
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReader(CommandBehavior behavior)
at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)
at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteReader(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.Enumerator.BufferlessMoveNext(DbContext _, Boolean buffer)
at Microsoft.EntityFrameworkCore.Storage.Internal.NoopExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.Enumerator.MoveNext()
at Microsoft.EntityFrameworkCore.Query.QueryMethodProvider.GetResult[TResult](IEnumerable`1 valueBuffers, Boolean throwOnNullResult)
at lambda_method(Closure )
at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider.ResultEnumerable`1.GetEnumerator()
at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext()
at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Boolean& found)
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass15_1`1.<CompileQueryCore>b__0(QueryContext qc)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)
at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression)
at System.Linq.Queryable.Count[TSource](IQueryable`1 source)
at iDooz.Controllers.DoozController..ctor() in /home/c343/Documents/iDooz_1/Controllers/DoozController.cs:line 24
at lambda_method(Closure , IServiceProvider , Object[] )
at Microsoft.AspNetCore.Mvc.Controllers.ControllerActivatorProvider.<>c__DisplayClass4_0.<CreateActivator>b__0(ControllerContext controllerContext)
at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.<CreateControllerFactory>g__CreateController|0(ControllerContext controllerContext)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
^CApplication is shutting down...
However, api/values, the default API in the webapi application worked properly and I got the correct output as in I got earlier on Ubuntu.
NOTE: First, this project is generally made to build a Tic Toc Toe and to learn about REstful APIs using ASP.NET Core Web API. So, I made a database using Entity Framework called Dooz.db and that is in the main directory of the project. Second, I'm doing dotnet publish -c Release -r linux-arm because the .NET Core SDK is not available for ARM-Processors.
Third, this is the part of the code in which the terminal had output an error
at System.Linq.Queryable.Count[TSource](IQueryable`1 source)
at iDooz.Controllers.DoozController..ctor() in /home/c343/Documents/iDooz_1/Controllers/DoozController.cs:line 24
Here is the code:
public class DoozController : ControllerBase
{
public DoozController()
{
if(db.Players.Count() == 0)
{
db.Players.Add(new Player { PlayerID = 1, Username = "Alex123", Password = "1234", ProfilePic = "ProfilePics/Alex123.jpg" });
db.Players.Add(new Player { PlayerID = 2, Username = "Ashkan_007", Password = "12345", ProfilePic = "ProfilePics/Ashkan_007.jpg" });
.
.
.
db.SaveChanges();
}
}
.
.
.
You need to copy the database file into publish folder.

The Security Support Provider Interface (SSPI) negotiation failed

I have error for my custom asp.net
my code asp code:
IServiceConfiguration<IOrganizationService> orgConfigInfo =
ServiceConfigurationFactory.CreateConfiguration<IOrganizationService>(new Uri("http://crm.tadbirgaranbm.com/TadbirgaranMellat/XRMServices/2011/Organization.svc"));
var creds = new ClientCredentials();
creds.UserName.UserName = "user";
creds.UserName.Password = "pass";
using (_serviceProxy = new OrganizationServiceProxy(orgConfigInfo, creds))
{
// This statement is required to enable early-bound type support.
_serviceProxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior());
_service = (IOrganizationService)_serviceProxy;
using (context srv = new context(_service))
{
Account acc = new Account();
acc.thr_FirstName = firstname.Text;
acc.thr_LastName = lastname.Text;
acc.thr_NationalCode = nationalcode.Text;
acc.EMailAddress1 = email.Text;
acc.thr_Mobile = cellphone.Text;
acc.Telephone1 = tel.Text;
srv.AddObject(acc);
srv.SaveChanges();
alert.ForeColor = System.Drawing.Color.Green;
alert.Text = "با موفقیت ثبت شد";
}
}
and then when i run this code in my visual studio work correctly but when i run in iis i get this error
The Security Support Provider Interface (SSPI) negotiation failed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ComponentModel.Win32Exception: The Security Support Provider Interface (SSPI) negotiation failed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[Win32Exception (0x80004005): The Security Support Provider Interface (SSPI) negotiation failed.]
System.ServiceModel.Security.WindowsSspiNegotiation.GetOutgoingBlob(Byte[] incomingBlob, ChannelBinding channelbinding, ExtendedProtectionPolicy protectionPolicy) +6115112
System.ServiceModel.Security.SspiNegotiationTokenProvider.GetNextOutgoingMessageBody(Message incomingMessage, SspiNegotiationTokenProviderState sspiState) +1325
System.ServiceModel.Security.IssuanceTokenProviderBase1.GetNextOutgoingMessage(Message incomingMessage, T negotiationState) +91
System.ServiceModel.Security.IssuanceTokenProviderBase1.DoNegotiation(TimeSpan timeout) +586
[SecurityNegotiationException: SOAP security negotiation with 'http://crm.tadbirgaranbm.com/TadbirgaranMellat/XRMServices/2011/Organization.svc' for target 'http://crm.tadbirgaranbm.com/TadbirgaranMellat/XRMServices/2011/Organization.svc' failed. See inner exception for more details.]
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +14489026
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +622
Microsoft.Xrm.Sdk.IOrganizationService.Execute(OrganizationRequest request) +0
Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.ExecuteCore(OrganizationRequest request) +892
Microsoft.Xrm.Sdk.Client.OrganizationServiceContext.Execute(OrganizationRequest request) +254
Microsoft.Xrm.Sdk.Client.OrganizationServiceContext.SaveChange(OrganizationRequest request, IList`1 results) +43
[SaveChangesException: An error occured while processing this request.]
Microsoft.Xrm.Sdk.Client.OrganizationServiceContext.SaveChanges(SaveChangesOptions options) +1791
crm.Reg.submit_Click(Object sender, EventArgs e) +790
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +155
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804
this error occurs due to the time zone as the server is hosted on some other region which has a different time zone then the local timezone where the web application is running.
to solve this problem server have to manage the offset of every timezone and the simplest way to do it tom manage the time in UTC format. to learn more about UTC click here

Unhandled exception at 0x ... in w3wp.exe: 0x ... : A heap has been corrupted

I'm building a project in Visual Studio 2012. When I press F5 to run the app, it works just fine, however when I load it up in IIS7 on my Windows Pro box, the first time I make a call to a specific code base, I get the following error.
The thread 'Win32 Thread' (0x4d8) has exited with code 0 (0x0).
Unhandled exception at 0x7797e6c3 in w3wp.exe: 0xC0000374: A heap has been corrupted.
First-chance exception at 0x778e32a0 in w3wp.exe: 0xC0000005: Access violation reading location 0x2039a9f2.
Unhandled exception at 0x778e32a0 in w3wp.exe: 0xC0000005: Access violation reading location 0x2039a9f2.
Now I've attached the w3wp.exe to the VS2012 debugger, but to be honest, I'm not sure how to debug this type of crash.
For reference, the code base that's being called in a WebAPI controller that makes a call to the ActiveHome SDK to control some automation bits.
// GET api/<controller>/5
public StatusModel Post(CommandModel command)
{
var activeHome = new ActiveHomeClass();
// execute command
var info = activeHome.SendAction(command.SendAction, String.Format("{0} {1}", command.Device, command.Command));
// return results
var status = new StatusModel { Device = command.Device, Status = info };
activeHome = null;
return status;
}
Note: I am compiling everything to use x86

Delete the object through tridion core service

I am not able to delete the object through core service.
I am getting object reference not found error. I am able to create and get the object but delete functionality fails.
I am using this code:
var client = new CoreService2010Client();
client.ClientCredentials.Windows.ClientCredential.UserName = Settings.UserID;
client.ClientCredentials.Windows.ClientCredential.Password = Settings.Password;
client.Open();
client.Delete(TCMURI);
here's the error:
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
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 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Tridion.ContentManager.CoreService.Client.ICoreService.Delete(String id)
at Tridion.ContentManager.CoreService.Client.CoreServiceClient.Delete(String id)
at TridionCoreService.Program.testing() in C:\WORK\My Work\TridionCoreService\TridionCoreService\Program.cs:line 125
at TridionCoreService.Program.Main(String[] args) in C:\WORK\My Work\TridionCoreService\TridionCoreService\Program.cs:line 25
I am using above code only and pass the tcm URI
Error Code : {System.ServiceModel.FaultCode}
I had the same error and it was related to UGC.
I disabled UGC (commented out the model and editor in the config and the eventsystem.dll from ugc), restarted the server and everything worked.
Check the 'Tridion' Windows Event Log on the Content Manager Server. There is probably an error related to UGC. I think you need to contact CS to fix this, since the error is in the Eventsystem dll from UGC

Com Exception: Word was unable to read this document. It may be corrupt

I have a web app that takes some client info and produces a letter for each client. Everything works good in my test environment, but on the production server I get an error that says the file is corrupt. I can open the .dotx file in word just fine on the server but not via code. Please help. Here is my code:
Object oMissing = System.Reflection.Missing.Value;
Object oTrue = true;
Object oFalse = false;
Word.Application oWord = new Word.Application();
Word.Document oWordDoc = new Word.Document();
oWord.Visible = false;
Object oTemplatePath = Request.PhysicalApplicationPath + "letters\\" + letter.letter_data; //samplehollisletter.dotx";
oWordDoc = oWord.Documents.Add(ref oTemplatePath, ref oMissing, ref oMissing, ref oMissing);
foreach (Word.Field myMergeField in oWordDoc.Fields)
{
iTotalFields++;
Word.Range rngFieldCode = myMergeField.Code;
String fieldText = rngFieldCode.Text;
if (fieldText.StartsWith(" MERGEFIELD"))
{
Int32 endMerge = fieldText.IndexOf("\\");
Int32 fieldNameLength = fieldText.Length - endMerge;
String fieldName = fieldText.Substring(11, endMerge - 11);
fieldName = fieldName.Trim();
if (fieldName == "letter_title")
{
myMergeField.Select();
oWord.Selection.TypeText(acct.letter_title);
}
if (fieldName == "account_id")
{
myMergeField.Select();
oWord.Selection.TypeText(acct.account_id);
}
if (fieldName == "address")
{
myMergeField.Select();
oWord.Selection.TypeText(acct.PEOPLE.home_address + "\r\n" + acct.PEOPLE.home_city + ", " + acct.PEOPLE.home_state + " " + acct.PEOPLE.home_zip);
}
if (fieldName == "greeting_title")
{
myMergeField.Select();
oWord.Selection.TypeText(acct.greeting_title);
}
if (fieldName == "service_name")
{
myMergeField.Select();
oWord.Selection.TypeText((acct.SERVICEs.FirstOrDefault()).service_name);
}
if (fieldName == "service_date")
{
myMergeField.Select();
oWord.Selection.TypeText((acct.SERVICEs.FirstOrDefault()).service_date.ToString());
}
}
}
oWordDoc.PrintOut();
oWordDoc.Close(Microsoft.Office.Interop.Word.WdSaveOptions.wdDoNotSaveChanges);
Thread.Sleep(2000);
oWord.Quit();
The Error is:
Server Error in '/Tracker2' Application.
Word was unable to read this document. It may be corrupt.
Try one or more of the following:
* Open and Repair the file.
* Open the file with the Text Recovery converter.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Word was unable to read this document. It may be corrupt.
Try one or more of the following:
* Open and Repair the file.
* Open the file with the Text Recovery converter.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[COMException (0x800a141f): Word was unable to read this document. It may be corrupt.
Try one or more of the following:
* Open and Repair the file.
* Open the file with the Text Recovery converter.]
Microsoft.Office.Interop.Word.Documents.Add(Object& Template, Object& NewTemplate, Object& DocumentType, Object& Visible) +0
Tracker.RunLetter2.Button1_Click(Object sender, EventArgs e) in C:\Users\Ethan\Documents\Visual Studio 2010\Projects\EstateTracker\Tracker\RunLetter2.aspx.cs:52
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3691
I know it is time that this item has been opened, but as I had not found the answer anywhere, following solution for those who need it.
1 - In IIS, the application pool used by the application, change the Identity attribute to LocalSystem
2 - Create a folder called Desktop within the following directories on the server:
C:\Windows\System32\config\systemprofile
and
C:\Windows\SysWOW64\config\systemprofile
After that, give full permission for these two folders to the user group IIS: IIS_IUSRS
This will cause this user to have a "desktop" to work, thereby achieving the IIS Word use the library.
I rough it helps someone.
I have discovered that the issue stems from permissions of a WCF call using BasicHTTPBinding endpoints. When a call is made using this type of endpoint, the service assumes the use of an IIS account which does not have a desktop to open word. This is a requirement of the account to automate word. Even when you have a service, that launches a windows application, that launches word, the entire set of events will be given the privilage of the original WCF call and will result in this error.
My solution, while not great, nor what I really want, does work for the time being. I created a Queue table in the database. I then have the web app insert a request for a task to be completed. then on the server I have a standalone application that checks the queue for requests every 60 seconds and processes the request. Its not the best method boe like I said, it does work.

Resources