Running OnlyOffice with Docker-Compose - WOPI - Connection refused while connecting to upstream

How can I verify what happend on the server or if the command was successfull or not.

You can check DEBUG logs on the Document server side to check it out. There will be PutFile request in the logs.
How to enable DEBUG logs:

  1. Open /etc/onlyoffice/documentserver/log4js/production.json (for Docker - all actions performed inside the container);

  2. Change “level”: “WARN” to “level”: “DEBUG

  3. Execute supervisorctl restart all to apply the changes

And also in this environment I expect that the document sever uses the internal POD host names provided by the internal Kubernetes network and not communicate via the official Internet DNS name

Here’s the official guide for Kubernetes:

Please note that we are still testing WOPI for K8s. We are going to add it as variable for pods in the next Helm Docs update.

Hi @Alexandre , I can activate the DEBUG mode. This works fine and I can see now many debug messages.
But my PostMessage did not work and also did not generate any additional debug message.

I analysed the situation in more detail. And maybe we are talking about different things.
Remember, I am in the WOPI Situation, which means my web application generates an iframe element to load the OnlyOffice editor based on the WOPI Discovery URL result. This works fine.
My iframe contains a document with again an iframe containing the OnlyOffice app.

Don’t you think, that my postMessage is going to the WOPI API and not to the command service?
This is the script I am using out from my web app to post the message:

function setOnlyOfficeForcesave() {
	
	console.log('setOnlyOfficeForcesave.....');
	var iframe = document.getElementById('wopi-iframe');
	iframe = iframe.contentWindow || (iframe.contentDocument.document || iframe.contentDocument);
	if (iframe) {
		console.log('post message to localhost...');
		//var result=iframe.postMessage(JSON.stringify({"c": "forcesave","key": "Khirz6zTPdfd7","userdata": "true"}), "*");
		var result=iframe.postMessage(JSON.stringify({"c": "forcesave","key": "Khirz6zTPdfd7","userdata": "imixs-workflow"}), "http://localhost:80/coauthoring/CommandService.ashx");
		console.log('post message completed! result='+result);
	} else {
		console.log('iframe not found!');
	}
}

No errors, but I did not get a result (undefined) and I can’t see anything in the debug log.

Do you expect that in case of a WOPI integration it should be possible to post normal OnlyOffice Command Service in parallel to the WOP PostMessage commands? Even if they have different formats?

https://api.onlyoffice.com/editors/command/

https://api.onlyoffice.com/editors/wopi/postmessage

What I mean is that I fear my JavaScript function has the wrong implementation for that what we want to achieve - setting the forceSave flag?

Could you please reproduce the situation and send us debug logs? You can contact me in PM

Hi @Alexandre, you will find the new logfiles here:
https://manik.imixs.org/documentserver_20220715.tar.gz

Thank you for the logs, we are checking the situation.

Hello @rsoika
Sorry for the late reply. Please accept our apologies for current situation. We are still working to improve WOPI on Document server.
As for forcesave scenario in general. There’s no desired mechanism for forcesave feature in WOPI at the moment. We are working on it.
There are only two ways to achieve desired scenario at the moment:

  1. Switch WOPI to usage API.
  2. Implement your own external Save button (not in the editor frame). This scenario should look like this: your server sends request to CommandService.ashx (ONLYOFFICE Api Documentation - Command service ) for checking file in Document server cache\build it\send to a storage.

Hi @Alexandre
thanks for your reply. No problem at all. If I know you are working on this it is fine. Can I track the issue on Github? Maybe I can also support your dev team with early testing.

For the moment I solved the problem somehow with the property settings for coauthoring:

{
  "services": {
    "CoAuthoring": {
      "autoAssembly": {
        "enable": true,
        "interval": "0m",
        "step": "0m"
      }
    }
  },
  "wopi": {
    "enable": true
  }
}

I can see in the logs that this not not ideal and costs a lot of CPU.

As I mentioned before, I think the doc/faq are not up to date:
https://api.onlyoffice.com/editors/faq/saving

But it is fine if you trigger me via this thread if a new version of the WOPI api is available. I prefer the WOPI API against the ONLYOFFICE API because an open standard protocol fits better in our own Open Source strategy.

Thank you for your testing offer, but I believe that our QA team deal with it. We have a lot of work to do to improve WOPI. I will notify you in this thread when we implement forcesave feature for WOPI.
As for autoAssembly parameter, as I mentioned before, this is not a right way in forcesave scenario (save button), but I understand why you looked at it in your scenario.
I will be in touch and provide you with any news about WOPI.

1 Like

Hi, are there any news about the WOPI Interface in OnlyOffice?

Hello @rsoika
Please clarify what you mean by ‘interface’.
As for WOPI in general, we are constantly improving WOPI and we publish new information when it’s ready.

In this thread I have described the problem.
Maybe its time to open a issue on Github?

Ah, I think I misunderstood your question since we discussed about WOPI features here (but not about ‘interface’, that confused me a little bit).
We are still working to improve WOPI (I remember about Forcesave feature for WOPI).
I will notify you when we have something to share.

Sorry I thought interface is clear in this context:
WOPI = Web Application Open Platform Interface

I now opened a issue on Github in parallel: https://github.com/ONLYOFFICE/DocumentServer/issues/1884

Undrerstood, but please do not post the same question in the different communication channels. We are working to improve WOPI.
Described issue is related to lack of forcesave feature on the WOPI, we discussed it earlier and we are working to improve WOPI it and I mentioned workaround solution (usage API: ONLYOFFICE Api Documentation - Command service).

When we have any news about desired scenario (user can save a file during editing session), I will update this thread.

Hi,
are there any news regarding this issue? From the Change log of the releases 7.2.0, 7.2.1 it does not seem so :-/

Hello @rsoika
Please accept our apologies for the length of situation. There’re a lot of tasks which we want to implement to increase user experience. One of them is mentioned in this thread (internal tracksystem number - 58764, Forcesave feature for WOPI) We are still working on it.
I will notify you when we have any news.

Hello
Command service uses a “key” as identifier of the file. But with WOPI there is only file_id. What key can we use with a command if the file was opened in OnlyOffice by WOPI?
And can we call Command service from WOPI Server?

Hello @Vladimir
There’s no possibility of sending requests to the Command Service through WOPI. You need to use Usage API to achieve it.
These are the different protocols with different logic of work, for example, WOPI doesn’t have ‘key’ parameter.

Hello, @Alexandre
What about a workaround solution with Command service which you mentioned earlier?

  1. The commands work through the API, so in addition to the WOPI, we also have to implement a significant part of the API, namely a callback handler, etc?
  2. Command service uses a “key” as identifier of the file. But with WOPI there is only file_id. What key can we use with a command if the file was opened in OnlyOffice by WOPI? document.key = file_id ?
  3. Instead of a sequence of three requests between the WOPI server and the client (host-> office/command → host/callback → ofiice), is it possible to get by with one request that will immediately receive the contents of the file from the WOPI client (OnlyOffice)?

Hello @Alexandre, answer at least the second question