I trying to use Office Online Server to implement a web browser embed word editor solution, on premises, in a custom web application. So, in this case, I'm not using SharePoint, Exchange or something else similar.
I've asked to infra staff on my company to install Office Online Server (Wopi Client) on a clean server machine, and it seems to be working ok - it is retriving me discovery xml on http://servername/hosting/discovery.
I've used this - https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/online/, and this example repo - https://github.com/OfficeDev/PnP-WOPI, to implement a basic WOPI Server, very simple, which was intended only to make something be saw on the screen, but it didn't work.
I've found a Node.js Wopi Server implementation (https://github.com/mikeebowen/node-wopi-server), which sounds exactly which I need, but when I run it, with .env file correctly filled, it returns me that image below (the same returned on Wopi Server developed by myself):
This is a response to a post to http://officeonlineserver/wv/wordviewerframe.aspx?WOPISrc=http%3A%2F%2F172.16.96.143%3A3003%2Fwopi%2Ffiles%2F95701492081637170&access_token=foDzkPGQvfkYIcx|Fabio&access_token_ttl=0
The most strange of all, is that wopi is not reaching my Wopi Server. It's crashing before it. I've inserted breakpoints on my server endpoints and logs to console in order to verifying server activity and it have not been called.
I've asked for a person in the infra staff to ping my IP, which is being used to serve Wopi Host, and it answered. Unfortunelly, I don't have access to where Office Online Server is being hosted and I can't access any log.
Someone can help me with this issue? I suspect that it can be a Office Online Server problem...
UPDATE: I have been allowed to access remotly the IIS server, which is running Office Online Server application. When I request it on my Wopi Host page, I can see a warning in IIS application log - An unhandled exception has occurred.
The Office Online Server is throwing that exception:
Exception type: OfficeServiceException
Exception message: ServiceInstanceFinderAdapter did not return data on first request
at Microsoft.Office.Web.Common.ServiceInstanceFinder.RefreshList(Object state)
at Microsoft.Office.Web.Common.ServiceInstanceFinder..cctor()
I've tried to find out some issue related to this exception on web, but I've found almost nothing related to this.
Anyone has any idea about what is going on?
Here is the full exception log:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 28/09/2023 10:13:23
Event time (UTC): 28/09/2023 13:13:23
Event ID: e3742dfe59fc423eb9b793e653efec03
Event sequence: 2
Event occurrence: 1
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/3/ROOT/wv-1-133403803979207815
Trust level: Full
Application Virtual Path: /wv
Application Path: C:\Program Files\Microsoft Office Web Apps\WebWordViewer\
Machine name: GCI001
Process information:
Process ID: 6688
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
Exception information:
Exception type: OfficeServiceException
Exception message: ServiceInstanceFinderAdapter did not return data on first request
at Microsoft.Office.Web.Common.ServiceInstanceFinder.RefreshList(Object state)
at Microsoft.Office.Web.Common.ServiceInstanceFinder..cctor()
Exception has been thrown by the target of an invocation.
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at Microsoft.Office.ServiceInfrastructure.Runtime.EnvironmentAdapters.HostEnvironment.LoadAdapterInstance(AdapterLoadInformation adapterInfo, Boolean readAppConfigOnly)
at Microsoft.Office.ServiceInfrastructure.Runtime.EnvironmentAdapters.AdapterLoadInformation`1.<>c__DisplayClass5_0.<BuildInstance>b__0()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at Microsoft.Office.Web.Common.ServiceInstanceFinder.RefreshList(Object state)
The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Microsoft.Office.Web.Apps.Environment.WacServer.WSServiceInstanceFinderAdapter..ctor()
Request information:
Request URL: http://gci001.capef.com.br/wv/wordviewerframe.aspx?WOPISrc=http://172.16.96.143:3003/wopi/files/95701492081637170&access_token=AioPVmXEZpKwiqu|Fabio&access_token_ttl=0
Request path: /wv/wordviewerframe.aspx
User host address: 172.16.96.143
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE
Thread information:
Thread ID: 6
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at Microsoft.Office.Web.Common.ServiceInstanceFinder.RefreshList(Object state)
at Microsoft.Office.Web.Common.ServiceInstanceFinder..cctor()
Custom event details:
If the WOPI call is not reaching your server, this may be TLS 1.2 problem. The old on-premise Office Online works on old TLS version.
Enable 1.2 on the WOPI server, or enable 1.1 (or 1.0?) version on your server.
If you are using PnP sample, you need to configure decent resources there for it to fly. Did you do that?
These ones, I mean: https://github.com/OfficeDev/PnP-WOPI/blob/f8303fe0f218697b0cbaac98736fc9d9ce23e1c9/com.microsoft.dx.officewopi/Web.config#L14-L31
I am not sure if you can really run that now, the "Azure Document Db" does not exist anymore (it was replaced with Cosmos Db)