Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR Mail2Bug.Mail2BugEngine [(null)] - Error processing #98

Open
phobbii opened this issue Apr 5, 2019 · 2 comments
Open

ERROR Mail2Bug.Mail2BugEngine [(null)] - Error processing #98

phobbii opened this issue Apr 5, 2019 · 2 comments

Comments

@phobbii
Copy link

phobbii commented Apr 5, 2019

2019-04-05 17:40:08,733 [7] INFO Mail2Bug.WorkItemManagement.TFSWorkItemManager [(null)] - Successfully connected to TFS
2019-04-05 17:40:08,749 [7] INFO Mail2Bug.WorkItemManagement.TFSWorkItemManager [(null)] - Connected to TFS. Getting TFS WorkItemStore
2019-04-05 17:40:09,467 [7] INFO Mail2Bug.WorkItemManagement.TFSWorkItemManager [(null)] - Geting TFS Project
2019-04-05 17:40:09,483 [7] INFO Mail2Bug.WorkItemManagement.TFSWorkItemManager [(null)] - Getting Team Config
2019-04-05 17:40:09,702 [7] ERROR Mail2Bug.Mail2BugEngine [(null)] - Error processing message
System.InvalidOperationException: Sequence contains no elements
at System.Linq.Enumerable.First[TSource](IEnumerable1 source) at Mail2Bug.WorkItemManagement.TFSWorkItemManager..ctor(InstanceConfig config) in D:\download\mail2bug-master\Mail2Bug\WorkItemManagement\TFSWorkItemManager.cs:line 52 at Mail2Bug.Mail2BugEngine.InitProcessingStrategy() in D:\download\mail2bug-master\Mail2Bug\Mail2BugEngine.cs:line 105 at System.Lazy1.CreateValue()
at System.Lazy1.LazyInitValue() at System.Lazy1.get_Value()
at Mail2Bug.Mail2BugEngine.ProcessInboxInternal() in D:\download\mail2bug-master\Mail2Bug\Mail2BugEngine.cs:line 79

@ericvb
Copy link

ericvb commented Apr 18, 2019

That's because of a change in the code to support the current iteration path (CurrentIterationSpecialValue) when creating a workitem from an email.

var teamConfig = _tfsStore.TeamProjectCollection.GetService<Microsoft.TeamFoundation.ProcessConfiguration.Client.TeamSettingsConfigurationService>().GetTeamConfigurationsForUser(new[] { _tfsProject.Uri.ToString() }); if (teamConfig != null) { _teamSettings = teamConfig.First().TeamSettings; }

In case the current user doesn't have the right or there are no default team iterations defined, First() will fail. (the team name is not given, so TFS will take the default team settings)
Better use:
_teamSettings = teamConfig.FirstOrDefault()?.TeamSettings;

_teamSettings will contain the team settings or be null if no team settings.
The code further on using _teamSettings is checking if _teamSettings is different from null before trying to set the current iteration, so no problem.

I had the same problem as you. I'm trying to find why my user doesn't get team settings.
Searching in our DevOps server, but for the moment no luck to find it :-(

@ericvb
Copy link

ericvb commented Feb 11, 2020

A little follow-up, in case somebody is passing by with the same problem.
Other projects did take all my time, so restarted this recently.

In order to get this to work, your account, running Mail2Bug, must be member of the project default team to get the current iteration path. In the calling code, a specific team is not provided, so TFS or DevOps will take the default project team by default.

You can quickly test if the configuration is correct by launching Chrome for example under the account used to run Mail2Bug:
https://YourDevOpsServer/tfs/YourCollection/YourProject/_apis/work/teamsettings?api-version=4.1

This api call should return the wanted information. If you see an exception in the return json message, there is still an issue in the configuration : your Mail2Bug account is still not a member of the default project team...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants