Office Web Apps Not Working

Once when working with a client I had a problem with Office Web Apps. I would not see any previews of documents. When clicking on an Office file you would receive the “Something went wrong Message”. I raised the logging level for office web apps.

 

In the ULS logs I found these entries,

01/23/2014 11:19:24.86 w3wp.exe (0x29D8) 0x44F0 SharePoint Foundation Logging Correlation Data 77a3 Verbose Starting correlation. 9e246d9c-9b0b-20df-3683-332a09549e94
01/23/2014 11:19:24.86 w3wp.exe (0x29D8) 0x44F0 SharePoint Foundation Logging Correlation Data xmnv Medium Name=Request (GET:http://devecm.SharePoint.com:80/sites/Repository/_layouts/15/WopiFrame.aspx?sourcedoc=/sites/Repository/Shared%20Documents/Excel.xlsx&action=default) 9e246d9c-9b0b-20df-3683-332a09549e94
01/23/2014 11:19:24.88 w3wp.exe (0x29D8) 0x44F0 SharePoint Foundation Application Authentication ajezx Verbose SPApplicationAuthenticationModule: Authorization header doesn’t contain Bearer, can’t try to perform application authentication. 9e246d9c-9b0b-20df-3683-332a09549e94
01/23/2014 11:19:24.88 w3wp.exe (0x29D8) 0x44F0 SharePoint Foundation Authentication Authorization agb9s Medium Non-OAuth request. IsAuthenticated=True, UserIdentityName=0#.w|domain\mmeyer, ClaimsCount=28 9e246d9c-9b0b-20df-3683-332a09549e94
01/23/2014 11:19:24.88 w3wp.exe (0x29D8) 0x44F0 SharePoint Foundation Logging Correlation Data xmnv Medium Site=/sites/Repository 9e246d9c-9b0b-20df-3683-332a09549e94
01/23/2014 11:19:24.88 w3wp.exe (0x29D8) 0x44F0 SharePoint Foundation Authentication Authorization aib35 Medium SPShareByLinkHandler.Initialize : Not a ShareByLink request – missing access token 9e246d9c-9b0b-20df-3683-332a09549e94
01/23/2014 11:19:24.88 w3wp.exe (0x29D8) 0x44F0 SharePoint Foundation Logging Correlation Data xmnv Medium User=0#.w|domain\mmeyer 9e246d9c-9b0b-20df-3683-332a09549e94
01/23/2014 11:19:24.90 w3wp.exe (0x29D8) 0x44F0 SharePoint Foundation Authentication Authorization aib35 Medium SPShareByLinkHandler.Initialize : Not a ShareByLink request – missing access token 9e246d9c-9b0b-20df-3683-332a09549e94
01/23/2014 11:19:24.91 w3wp.exe (0x29D8) 0x44F0 SharePoint Foundation Application Authentication ajjya Verbose Issuing loopback token for SPUser for endpoint ‘http://devecm.SharePoint.com/sites/Repository/_vti_bin/wopi.ashx’. 9e246d9c-9b0b-20df-3683-332a09549e94
01/23/2014 11:19:24.91 w3wp.exe (0x29D8) 0x44F0 SharePoint Foundation Application Authentication age6j Verbose Issuing loopback token for SPIdentityContext for endpoint ‘http://devecm.SharePoint.com/sites/Repository/_vti_bin/wopi.ashx’. 9e246d9c-9b0b-20df-3683-332a09549e94
01/23/2014 11:19:24.91 w3wp.exe (0x29D8) 0x44F0 SharePoint Foundation Application Authentication adnh0 Verbose Retrieving

A lot of error messages about the security token not being passed through.

01/23/2014 11:06:52.49   w3wp.exe (0x29D8)           0x2ECC  SharePoint Foundation      WOPI     ajc39      Unexpected                WOPIFrame – Unhandled exception: System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at net.pipe://localhost/SecurityTokenServiceApplication/appsts.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. —> System.IO.PipeException: The pipe endpoint ‘net.pipe://localhost/SecurityTokenServiceApplication/appsts.svc’ could not be found on your local machine.      — End of inner exception stack trace —    Server stack trace:      at System.ServiceModel.Channels.PipeConnectionInitiator.GetPipeName(Uri uri, IPipeTransportFactorySettings transportFactorySettings)     at System.ServiceModel.Channels.NamedPipeConnectionPoolRegistry.NamedPipeConnectionPool.GetPoolKey(EndpointAddress address, Uri via)     at System.ServiceModel.Channels.ConnectionPoolHelper.TakeConnection(TimeSpan timeout)     at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)     at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)     at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)     at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)     at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)     at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)     at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)     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 Microsoft.SharePoint.IdentityServices.IApplicationSecurityTokenServiceContract.Issue(RequestApplicationSecurityToken request)     at Microsoft.SharePoint.IdentityServices.SPApplicationSecurityTokenServiceClient.<>c__DisplayClass2.<RequestSelfIssuedToken>b__0()     at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)     at Microsoft.SharePoint.IdentityServices.SPApplicationSecurityTokenServiceClient.RequestSelfIssuedToken(RequestApplicationSecurityToken rst)     at Microsoft.SharePoint.IdentityModel.OAuth2.SPOAuth2SecurityTokenManager.RequestRawLoopbackToken(OAuth2EndpointIdentity endpointIdentity, JsonWebSecurityToken onBehalfOf, String applicationContext)     at Microsoft.SharePoint.IdentityModel.OAuth2.SPOAuth2SecurityTokenManager.IssueLoopbackTokenString(Uri endpointAddress, SPIdentityContext identityContext, String applicationContext, DateTime& validTo)     at Microsoft.SharePoint.IdentityModel.OAuth2.SPOAuth2SecurityTokenManager.IssueLoopbackTokenString(Uri endpointAddress, SPUser user, String applicationContext, DateTime& validTo)     at Microsoft.SharePoint.Utilities.SPWOPIHost.GetAccessToken(SPWeb web, Guid uniqueId, String proofKeyId, SPUrlZone zone, SPBasePermissions perms, Boolean hasEditLicense, Int64& ttl)     at Microsoft.SharePoint.Utilities.SPWOPIHost.GetAccessToken(SPFile file, String proofKeyId, SPUrlZone zone, Int64& ttl)     at Microsoft.SharePoint.Utilities.SPWOPIHost.GetWOPITargetInternal(HttpContext httpContext, SPWeb web, Object& spPrimeObject, SPWOPIAction& requestedAction, SPRegionalSettings spSettings, String& wopiAppUrl, String& wopiFavIconUrl, String& wopiAccessToken, Int64& wopiAccessTokenTtl, String& errorMessageToDisplay, String& redirectUrl)     at Microsoft.SharePoint.ApplicationPages.WOPIFrameHelper.OnLoadHelper(WOPIFrame frame)     at Microsoft.SharePoint.ApplicationPages.WOPIFrameHelper.OnLoad(WOPIFrame frame) e6236d9c-1b59-20df-3683-3b85e50b7a17

I checked the security token service by going to the web page, http://localhost:32843/SecurityTokenServiceApplication/appsts.svc

 

sts errorWhat I saw indicated an error. The web page should look like this.

 

sts normal

 

Other blogs on the internet hinted that the security token service works through .net pipe and I must have installed another service using .net pipe and if two services are using it then a base address should be put in te web config file. Re-provisioning the service would put things back in order.

I used this powershell to re-provision the security token service.

$h = Get-SPServiceHostconfig
$h.Provision()
$services = Get-SPServiceApplication
foreach ($service in $services) { $service.provision();
write-host $service.name}

This will re-provision all the services for the SharePoint farm. I then did an IIS reset and tested office web apps. Everything was fine after that.

 

 

 

 

 

 

Advertisements

2 thoughts on “Office Web Apps Not Working

  1. I did re-provision all the services but no luck. http://localhost:32843/SecurityTokenServiceApplication/appsts.svc is not throwing error. I ma still geting error SPShareByLinkHandler.Initialize : Not a ShareByLink request – missing access token and couldn’t preview or open the dopcument in the browser. getting error sorry, there was a problem and we can’t open this document. If this happens again, try opening the document in Microsoft word.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s