Windows Server Essentials Email Service Won't Start SharedServiceHost.exe Unhandled exception from operation

Gday Everyone,

Two weeks ago we installed a new Server 2012 R2 with the Essentials Experience role. It was fully patched at time of deployment. We enabled O365 integration and password sync was working fine last week. This morning I went to the Dash Board to add a new user and after clicking the O365 tab all fields show "Not available".

The system event log shows

"The Windows Server Essentials Email Service service terminated unexpectedly.  It has done this 3 time(s)."

The application event log shows the following.

System.InvalidOperationException: Nullable object must have a value.
   at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.<GetSubscriptions>b__37(Subscription sub)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.<>c__DisplayClass32.<GetCompanyInfo>b__30(AccountSkuDetails s)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Microsoft.WindowsServerSolutions.O365Integration.BecWebServiceAdapter.GetCompanyInfo()
   at Microsoft.WindowsServerSolutions.O365Integration.O365ManagementCore.QueryO365Information()
   at Microsoft.WindowsServerSolutions.Common.ProviderFramework.ProviderBase`1.InvokeOperation[TResult](String operationName, Func`1 func)
   at Microsoft.WindowsServerSolutions.O365Integration.O365ManagementProvider.InvokeOperationWrapperAsyncWithLocalAdminPrivilege[TResult](String operationName, Func`1 func)
   at SyncInvokeQueryO365Information(Object , Object[] , Object[] )
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
   at Microsoft.WindowsServerSolutions.Common.ProviderFramework.Internal.ExceptionScreener._ScreenForExceptions(GeneralInvoker invokeMe, Object instance, Object[] inputs, Object[]& outputs)
Stack:
   at System.Environment.FailFast(System.String, System.Exception)
   at Microsoft.WindowsServerSolutions.Common.ProviderFramework.Internal.ExceptionScreener._ScreenForExceptions(GeneralInvoker, System.Object, System.Object[], System.Object[] ByRef)
   at Microsoft.WindowsServerSolutions.Common.ProviderFramework.Internal.ExceptionScreener.Invoke(System.Object, System.Object[], System.Object[] ByRef)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(System.ServiceModel.Dispatcher.MessageRpc ByRef)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(System.ServiceModel.Dispatcher.MessageRpc ByRef)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(System.ServiceModel.Dispatcher.MessageRpc ByRef)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean)
   at System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(System.ServiceModel.Channels.RequestContext, Boolean, System.ServiceModel.OperationContext)
   at System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(System.ServiceModel.Channels.RequestContext, System.ServiceModel.OperationContext)
   at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(System.IAsyncResult)
   at System.Runtime.Fx+AsyncThunk.UnhandledExceptionFrame(System.IAsyncResult)
   at Microsoft.WindowsServerSolutions.Common.ProviderFramework.Internal.AsyncResult`1[[Microsoft.WindowsServerSolutions.Common.ProviderFramework.Internal.InputChannelRequeuer`1+TryReceiveResult[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], Sku, Version=6.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].Complete(Boolean, System.Func`1<TryReceiveResult<System.__Canon>>)
   at Microsoft.WindowsServerSolutions.Common.ProviderFramework.Internal.CoalescingAsyncResult`1[[Microsoft.WindowsServerSolutions.Common.ProviderFramework.Internal.InputChannelRequeuer`1+TryReceiveResult[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], Sku, Version=6.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]._MyCallback(System.IAsyncResult)
   at System.Runtime.AsyncResult.Complete(Boolean)
   at System.ServiceModel.Channels.TransportDuplexSessionChannel+TryReceiveAsyncResult.OnReceive(System.IAsyncResult)
   at System.Runtime.Fx+AsyncThunk.UnhandledExceptionFrame(System.IAsyncResult)
   at System.Runtime.AsyncResult.Complete(Boolean)
   at System.ServiceModel.Channels.SynchronizedMessageSource+ReceiveAsyncResult.OnReceiveComplete(System.Object)
   at System.ServiceModel.Channels.SessionConnectionReader.OnAsyncReadComplete(System.Object)
   at System.Runtime.Fx+AsyncThunk.UnhandledExceptionFrame(System.IAsyncResult)
   at System.Net.LazyAsyncResult.Complete(IntPtr)
   at System.Net.Security.NegotiateStream.ProcessFrameBody(Int32, Byte[], Int32, Int32, System.Net.AsyncProtocolRequest)
   at System.Net.Security.NegotiateStream.ReadCallback(System.Net.AsyncProtocolRequest)
   at System.Net.FixedSizeReader.CheckCompletionBeforeNextRead(Int32)
   at System.Net.FixedSizeReader.ReadCallback(System.IAsyncResult)
   at System.Runtime.AsyncResult.Complete(Boolean)
   at System.ServiceModel.Channels.ConnectionStream+IOAsyncResult.OnAsyncIOComplete(System.Object)
   at System.ServiceModel.Channels.SocketConnection.OnReceiveAsync(System.Object, System.Net.Sockets.SocketAsyncEventArgs)
   at System.Net.Sockets.SocketAsyncEventArgs.FinishOperationSuccess(System.Net.Sockets.SocketError, Int32, System.Net.Sockets.SocketFlags)
   at System.Net.Sockets.SocketAsyncEventArgs.CompletionPortCallback(UInt32, UInt32, System.Threading.NativeOverlapped*)
   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32, UInt32, System.Threading.NativeOverlapped*)

The only thing we did a few days ago was enable the Azure Backup integration. I am not sure if this broke the O365 integration as I didn't go back to the O365 tab in the dashboard after installing the Azure backup.

I have spent a considerable amount of time on google, however, majority of the posts talk about Update 1 which disables the password sync service. I have checked and all services are started with exception of Windows Server Essentials Email Service (WseEmailSvc).

The Azure Backup module is working fine and the registry location HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Server\Productivity seems to hold the correct configuration information throughout the various keys.

I am at a loss as to how to proceed with this issue? I have checked but there are no pending updates and I have attempted a server reboot numerous times.

Would appreciate external input if you have seen this issue before or know where we can look to further establish what is going on.

Cheers,

Chiper

April 2nd, 2015 12:24am

Hi Chiper,

In general, if you integrate O365, the WseEmailSvc Startup Type will be changed to Automatic. Please check it in the Services, if the startup type is not automatic, please change it to automatic and make sure that all the dependent services are running.

Besides, if you have installed DirSync, please make sure that you have installed the correct version.

Best regards,

Susie

Free Windows Admin Tool Kit Click here and download it now
April 3rd, 2015 8:31am

Hi Susie,

As per my original post I have already checked to ensure the service Windows Server Essentials Email Service (WseEmailSvc) is set to start automatically. I haven't installed DirSync, I know this can break the essentials experience o365 integration but that is not the case in this instance. 

We installed the server essentials experience role, then enabled O365 integration. This worked fine for two weeks and all of a sudden the service terminates unexpectedly whenever it is started. See event log errors above. 

The only thing that has changed is Azure backup integration via the essentials experience dashboard was enabled. I am not sure if this caused the issue as I didnt go back into the O365 Dashboard after installing to test it but it is the most likely culprit as its the only thing that has changed. 

It looks to me like the Azure Backup integration has modified a .net setting that the Windows Server Essentials Email Service (WseEmailSvc) depends on and now it cant start because something is missing hence the error System.InvalidOperationException: Nullable object must have a value.

My only thoughts are to use the Disable Office 365 Integration using the essentials experience dashboard and then attempt to re-enable it. I am doubtful this will work as none of the options work when the service isnt running. I could, however, delete the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Server\Productivity which should delete the config and hopefully allow the service to start again.

Before I do that a few questions.

  1. What will be the impact to disabling the office 365 integration? Will this break anything and will I be able to integrate it again without issues? The last time we enabled office 365 integration all users had to change their password which is highly annoying for remote users but not a show stopper.
  2. If we delete the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Server\Productivity will this clear the azure backup config as well?
  3. Why did enabling Azure Backup break the O365 integration? If I do it the other way around i.e. enable azure backup first and then o365 integration will his break the azure backup?

As stated in my original post I am really stumped as to how to move forward in troubleshooting this error so would appreciate some assistance.

Kind Regards,

Chiper

April 3rd, 2015 11:24pm

Hi Chiper,

Have you enabled Right Management Services for O365? BTW, I am 100% sure this issue is not caused by Azure Backup Integration.

Thanks,

Pan

Free Windows Admin Tool Kit Click here and download it now
April 7th, 2015 8:01am

Morning Pan,

We haven't enabled Right Management Services for O365. Any other ideas? This has now become a major problem as we have a new user starting today and no account provisioned for them.

Kind Regards,

Chiper

April 7th, 2015 10:50pm

Have you ever enabled RMS in portal? As the below image shown:
Free Windows Admin Tool Kit Click here and download it now
April 8th, 2015 5:30am

Hi Pan,

As per my previous post we HAVE NOT ENABLED RIGHTS MANAGEMENT!

See screen shot below.

Kind Regards,

Chiper

April 8th, 2015 5:35am

I want to confirm with you because we find an issue that related to RMS with Essentials that with the same crash call stack like yours. We have a fix for that and the update should be published recently.
Free Windows Admin Tool Kit Click here and download it now
April 8th, 2015 5:56am

I want to confirm with you because we find an issue that related to RMS with Essentials that with the same crash call stack like yours. We have a fix for that and the update should be published recently.
April 8th, 2015 5:56am

Hi Pan,

I already confirmed that this morning. Moving on, any further advice?

Not sure if this is relevant or not but I did click on Azure AD under the "Admin" tab last week. This redirected me to our Azure portal and lists all services.

One of the services is Default Directory. When I click on this none of our O365 users are listed (not sure if they are suppose to be or not)? My name is listed in there and under domains it lists myname.onmicrosoft.com.

This is the only other thing I can think of that I have explored in O365 admin portal in the past couple of weeks.

Kind Regards,

Chiper


  • Edited by Chiper Wednesday, April 08, 2015 6:17 AM Images didnt upload.
Free Windows Admin Tool Kit Click here and download it now
April 8th, 2015 6:08am

Hi Pan,

I already confirmed that this morning. Moving on, any further advice?

Not sure if this is relevant or not but I did click on Azure AD under the "Admin" tab last week. This redirected me to our Azure portal and lists all services.

One of the services is Default Directory. When I click on this none of our O365 users are listed (not sure if they are suppose to be or not)? My name is listed in there and under domains it lists myname.onmicrosoft.com.

This is the only other thing I can think of that I have explored in O365 admin portal in the past couple of weeks.

Kind Regards,

Chiper


  • Edited by Chiper Wednesday, April 08, 2015 6:17 AM Images didnt upload.
April 8th, 2015 6:08am

Hi Chiper,

I've just discovered this issue this morning for a client of ours. New install, was working 2-4 weeks ago, now the email service keeps stopping. It looks to be a .net issue possibly. 

Well let you know if I find anything. No updates have been installed since 13/03/2015. It was a big patch on the 13th so I'm sure if it was one of those.

Free Windows Admin Tool Kit Click here and download it now
April 9th, 2015 11:54pm

Hi Louds,

Likewise I will keep you posted if you we resolve this issue but to be honest im at a loss as to what to do next and am still waiting on Pan from Microsoft to provide us with an update. 

Kind Regards,

Chiper

April 11th, 2015 12:16am

Morning Pam,

Following up on this case, could you please provide us with an update? 

Kind Regards,

Chiper

Free Windows Admin Tool Kit Click here and download it now
April 17th, 2015 12:38am

Was this written for you

http://blogs.technet.com/b/sbs/archive/2015/04/17/subscribing-to-microsoft-power-bi-breaks-through-the-official-office-365-integration-in-windows-server-essentials.aspx

April 17th, 2015 7:59pm

Am I the only one that gets post not found for that link?
Free Windows Admin Tool Kit Click here and download it now
April 18th, 2015 3:13am

Well they must have pulled the post.  Copy and paste that link in Google, then click the down arrow at the end for cached.  Anyway, no fix is listed yet, but it means they are working on it

We have recently come across an issue where Office 365 Integration breaks on Windows Server Essentials. After investigating the issue, we determined that the Windows Server Essentials Email Service does not start and crashes if we attempt to start it manually.

In the Windows Server Essentials Dashboard, the state of Microsoft Azure Active Directory Integration appears as N/A

April 18th, 2015 12:18pm

Thanks,

I've looked at the article and my client doesn't have PowerBI but I'm wondering if it's because there's a strange 500,000 licenses of Office 365 education for faculty. 

Hmm....What to do what to do...Got to figure out what these licenses are first.

Free Windows Admin Tool Kit Click here and download it now
April 19th, 2015 9:39pm

Um, it's quite possible the team did not code a buffer big enough for 500K emails addys in Essentials
April 19th, 2015 10:09pm

Well we never had 500,000 licenses...They've just appeared. Somehow we have 4 of them assigned to users. We don't have 500,000 assigned licenses. I've opened a ticket with MS to ask why we have theses licenses. If they can reduce the count and it fixes the problem, then problem solved.
Free Windows Admin Tool Kit Click here and download it now
April 19th, 2015 10:14pm

Ok, be sure and check your credit card bill next month :)
April 19th, 2015 10:23pm

Morning All,

Indeed the post has been pulled as I too can no longer access it. I am 100% sure this issue is caused by subscriptions that either have millions of licenses and/or no subscription information. Unfortunately short of removing these subscriptions from our O365 account its impossible for us to fix it. 

We are at the will of MS... 

It would be nice if MS confirmed this was an issue and advised ETA for resolution (im looking at you Pan Chen and Susie Long).... 

Thanks Grey for information, I am awarding you all points. 

Kind Regards,

Chiper

Free Windows Admin Tool Kit Click here and download it now
April 20th, 2015 3:35am

I have a similar if not identical situation - I'm currently migrating from WS2012 Essentials to WS2012 R2 Standard w/Essentials role installed. The 'wseemailsvc' service continues to fail over and over, and I am unable to manage O365 accounts from within the Essentials dashboard on the R2 server. 

System Event Log:

Error 7031 - The Windows Server Essentials Email Service service terminated unexpectedly ... [repeats twice]

Error 7034 - The Windows Server Essentials Email Service service terminated unexpectedly. It has done this 3 time(s)

Application Event Log:

Source:        .NET Runtime
Date:          2015-04-20 08:27:28
Event ID:      1026
Task Category: None
Level:         Error

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name=".NET Runtime" />
    <EventID Qualifiers="0">1026</EventID>
    <Level>2</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2015-04-20T14:27:28.000000000Z" />
    <EventRecordID>21137</EventRecordID>
    <Channel>Application</Channel>
    <Computer>redacted</Computer>
    <Security />
  </System>
  <EventData>
    <Data>Application: SharedServiceHost.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.UnauthorizedAccessException
Stack:
   at System.DirectoryServices.Interop.UnsafeNativeMethods+IAds.SetInfo()
   at System.DirectoryServices.DirectoryEntry.CommitChanges()
   at Microsoft.WindowsServerSolutions.MailService.ActiveDirectoryHelper+&lt;&gt;c__DisplayClass3.&lt;SetLocalUserPrincipleName&gt;b__1()
   at Microsoft.WindowsServerSolutions.MailService.ActiveDirectoryHelper.InvokeOperationImpersonateWrapper(System.Action)
   at Microsoft.WindowsServerSolutions.O365Integration.UpdateO365IntegrationDataTask.CleanUpMappingData(Microsoft.WindowsServerSolutions.O365Integration.O365User[])
   at Microsoft.WindowsServerSolutions.O365Integration.UpdateO365IntegrationDataTask.Run()
   at Microsoft.WindowsServerSolutions.O365Integration.BackgroundTask.TimerCallback(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.TimerQueueTimer.CallCallback()
   at System.Threading.TimerQueueTimer.Fire()
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
</Data>
  </EventData>
</Event>

This error is followed immediately by:

Source:        Application Error
Date:          2015-04-20 08:27:28
Event ID:      1000
Task Category: (100)
Level:         Error
Keywords:      Classic

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Application Error" />
    <EventID Qualifiers="0">1000</EventID>
    <Level>2</Level>
    <Task>100</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2015-04-20T14:27:28.000000000Z" />
    <EventRecordID>21138</EventRecordID>
    <Channel>Application</Channel>
    <Computer>redacted</Computer>
    <Security />
  </System>
  <EventData>
    <Data>SharedServiceHost.exe</Data>
    <Data>6.3.9600.16384</Data>
    <Data>5215ca62</Data>
    <Data>KERNELBASE.dll</Data>
    <Data>6.3.9600.17415</Data>
    <Data>54505737</Data>
    <Data>e0434352</Data>
    <Data>0000000000008b9c</Data>
    <Data>20e4</Data>
    <Data>01d07b761ad593b2</Data>
    <Data>C:\Windows\System32\Essentials\SharedServiceHost.exe</Data>
    <Data>C:\Windows\system32\KERNELBASE.dll</Data>
    <Data>5f028783-e769-11e4-80c4-00155d10040b</Data>
    <Data>
    </Data>
    <Data>
    </Data>
  </EventData>
</Event>

Any assistance with this would be greatly appreciated!

mcbundus


April 20th, 2015 5:04pm

Should one of us officially report this as a bug or has someone from MS already done this? Now I've had to enforce users to not be able to change their password as it creates a whole lot of issues with Outlook and passwords not updating. 
Free Windows Admin Tool Kit Click here and download it now
May 4th, 2015 10:12pm

The post is live and says they are working on a fix, so not sure you can do anything to motivate them more
May 4th, 2015 10:37pm

You would think Susie Long and Pan Cheng whom originally responded to this thread would be providing us with constant updates instead of ignoring it. However, I would imagine that MS know about it and will release a fix eventually. 

I do share your frustration, however, especially if you need to comply with HIPPA! Training users to change passwords in both O365 and AD is painful and provides a terrible user experience which users then attribute to O365. Doesn't help your adoption rates I can tell you :( 

Come on Microsoft, this is a right poor show from your end! Pick up your GAME!

Free Windows Admin Tool Kit Click here and download it now
May 4th, 2015 11:37pm

Hi Chiper,

The hot fix is released. Please try whether it can fix your issue. https://support.microsoft.com/en-us/kb/3055778/

Thanks,

Pan

May 18th, 2015 3:22am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics