microsoft/mail2bug

Reply email error

Closed this issue · 2 comments

I have been working with the code for about two months now and ran into an issue when trying to process a reply email. I get the following error:

2017-03-29 11:28:09,104 [6] ERROR Mail2Bug.Mail2BugEngine [(null)] - Error processing message
Microsoft.TeamFoundation.WorkItemTracking.Client.UnexpectedErrorException: There is a problem on the server. Contact your Tea
m Foundation Server administrator. ---> System.Web.Services.Protocols.SoapException: Object reference not set to an instance
of an object.
at Microsoft.TeamFoundation.WorkItemTracking.Proxy.RetryHandler.HandleSoapException(SoapException se)
at Microsoft.TeamFoundation.WorkItemTracking.Proxy.WorkItemServer.Update(String requestId, XmlElement package, XmlElement&
result, MetadataTableHaveEntry[] metadataHave, String& dbStamp, IMetadataRowSets& metadata)
at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.SendUpdatePackage(XmlElement package, XmlElement& result
, Boolean bulk)
--- End of inner exception stack trace ---
at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.SendUpdatePackage(XmlElement package, XmlElement& result
, Boolean bulk)
at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.SaveWorkItems(WorkItem[] workitems, Boolean bulk, SaveFl
ags saveFlags)
at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem.Save(SaveFlags saveFlags)
at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem.Save()
at Mail2Bug.WorkItemManagement.TFSWorkItemManager.ValidateAndSaveWorkItem(WorkItem workItem) in C:\Users\kgoodman\Source\R
epos\mail2bug2\Mail2Bug\WorkItemManagement\TFSWorkItemManager.cs:line 390
at Mail2Bug.WorkItemManagement.TFSWorkItemManager.ModifyWorkItem(Int32 workItemId, String comment, Dictionary`2 values) in
C:\Users\kgoodman\Source\Repos\mail2bug2\Mail2Bug\WorkItemManagement\TFSWorkItemManager.cs:line 304
at Mail2Bug.MessageProcessingStrategies.SimpleBugStrategy.UpdateWorkItem(IIncomingEmailMessage message, Int32 workItemId)
in C:\Users\kgoodman\Source\Repos\mail2bug2\Mail2Bug\MessageProcessingStrategies\SimpleBugStrategy.cs:line 150
at Mail2Bug.MessageProcessingStrategies.SimpleBugStrategy.ProcessInboxMessage(IIncomingEmailMessage message) in C:\Users\k
goodman\Source\Repos\mail2bug2\Mail2Bug\MessageProcessingStrategies\SimpleBugStrategy.cs:line 44
at Mail2Bug.Mail2BugEngine.ProcessInboxInternal() in C:\Users\kgoodman\Source\Repos\mail2bug2\Mail2Bug\Mail2BugEngine.cs:l
ine 79

I'm only an intern so I appreciate any help you can offer. Thanks!

Hi,
It's hard to say for sure from the stack trace, but it seems like saving the updates is failing. My guess is that the update includes some non-existent field, and hence the "null reference exception".
Can you please check if the configuration is set to update the "Changed By" field, and if so, try to see if turning that off helps?
Another way to go about this is to put a breakpoint in this part of the code (TFSWorkItemManager.cs line 390), just before we actually send the request to the server to save the updates item:

Mail2Bug.WorkItemManagement.TFSWorkItemManager.ValidateAndSaveWorkItem(WorkItem workItem) in C:\Users\kgoodman\Source\R
epos\mail2bug2\Mail2Bug\WorkItemManagement\TFSWorkItemManager.cs:line 390

And check the list of fields its trying to update, and make sure all exist, and if not, remove any that don't exist.

P.S.
You're not "just an intern" - being relatively new/inexperienced is a common state in many situations in life, and everyone go through it. That doesn't diminish you and it's not something you should feel bad or apologize about. It's great if you want to give context (in the sense of "hey, I'm not very experienced, so might need more help than someone who is more experienced), all I'd say is, you can skip the "just" part :)
Also, when I think of some of the best people I've had the chance to work with and learn from, there are at least a couple that were interns and much less experienced than me. They still had a lot to offer and teach me

Thanks so much, the "Changed By" field was the issue and it seems to be working smoothly now.

Also, thanks for the words of encouragement. It can be intimidating being young and relatively inexperienced in the working world. I really appreciate your help and your kind words. :)