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 when saving Onlyoffice settings #74

Closed
Dave-REBL opened this issue May 30, 2017 · 9 comments
Closed

Error when saving Onlyoffice settings #74

Dave-REBL opened this issue May 30, 2017 · 9 comments
Labels

Comments

@Dave-REBL
Copy link

Nextcloud 11.0.3 (stable), running on Ubuntu server 16.04.2
OnlyOffice integration app 1.0.4
OnlyOffice Document Server 4.3.4, running on Ubuntu server 16.04.2

Onlyoffice settings:

Error displayed at top of Nextcloud administrative page when saving settings:

Error when trying to connect (Bad Request or timeout error)

Messages in Nextcloud log when saving settings:
{"reqId":"om5OE3nHeC7HSSttERzM","remoteAddr":"192.168.1.161","app":"onlyoffice","message":"SetDocumentServerUrl: https:\/\/onlyoffice.abc.com\/","level":1,"time":"2017-05-30 18:42:45","method":"PUT","url":"\/index.php\/apps\/onlyoffice\/ajax\/settings","user":"user","version":"11.0.3.2"} {"reqId":"om5OE3nHeC7HSSttERzM","remoteAddr":"192.168.1.161","app":"onlyoffice","message":"SetDocumentServerInternalUrl: http:\/\/192.168.1.179\/","level":1,"time":"2017-05-30 18:42:45","method":"PUT","url":"\/index.php\/apps\/onlyoffice\/ajax\/settings","user":"user","version":"11.0.3.2"} {"reqId":"om5OE3nHeC7HSSttERzM","remoteAddr":"192.168.1.161","app":"onlyoffice","message":"SetStorageUrl: https:\/\/192.168.1.178:12443\/","level":1,"time":"2017-05-30 18:42:45","method":"PUT","url":"\/index.php\/apps\/onlyoffice\/ajax\/settings","user":"user","version":"11.0.3.2"} {"reqId":"om5OE3nHeC7HSSttERzM","remoteAddr":"192.168.1.161","app":"onlyoffice","message":"Clear secret key","level":1,"time":"2017-05-30 18:42:45","method":"PUT","url":"\/index.php\/apps\/onlyoffice\/ajax\/settings","user":"user","version":"11.0.3.2"} {"reqId":"om5OE3nHeC7HSSttERzM","remoteAddr":"192.168.1.161","app":"PHP","message":"file_get_contents(): Peer certificate CN=onlyoffice.abc.com' did not match expected CN=192.168.1.179' at \/var\/www\/nextcloud\/apps\/onlyoffice\/lib\/documentservice.php#305","level":3,"time":"2017-05-30 18:42:45","method":"PUT","url":"\/index.php\/apps\/onlyoffice\/ajax\/settings","user":"user","version":"11.0.3.2"} {"reqId":"om5OE3nHeC7HSSttERzM","remoteAddr":"192.168.1.161","app":"PHP","message":"file_get_contents(): Failed to enable crypto at \/var\/www\/nextcloud\/apps\/onlyoffice\/lib\/documentservice.php#305","level":3,"time":"2017-05-30 18:42:45","method":"PUT","url":"\/index.php\/apps\/onlyoffice\/ajax\/settings","user":"user","version":"11.0.3.2"} {"reqId":"om5OE3nHeC7HSSttERzM","remoteAddr":"192.168.1.161","app":"PHP","message":"file_get_contents(http:\/\/192.168.1.179\/coauthoring\/CommandService.ashx): failed to open stream: operation failed at \/var\/www\/nextcloud\/apps\/onlyoffice\/lib\/documentservice.php#305","level":3,"time":"2017-05-30 18:42:45","method":"PUT","url":"\/index.php\/apps\/onlyoffice\/ajax\/settings","user":"user","version":"11.0.3.2"} {"reqId":"om5OE3nHeC7HSSttERzM","remoteAddr":"192.168.1.161","app":"onlyoffice","message":"CommandRequest on check error: Bad Request or timeout error","level":3,"time":"2017-05-30 18:42:45","method":"PUT","url":"\/index.php\/apps\/onlyoffice\/ajax\/settings","user":"user","version":"11.0.3.2"} {"reqId":"om5OE3nHeC7HSSttERzM","remoteAddr":"192.168.1.161","app":"onlyoffice","message":"Set default formats: {\"docx\":\"true\",\"xlsx\":\"true\",\"pptx\":\"true\",\"ppsx\":\"true\",\"txt\":\"false\"}","level":1,"time":"2017-05-30 18:42:45","method":"PUT","url":"\/index.php\/apps\/onlyoffice\/ajax\/settings","user":"user","version":"11.0.3.2"} {"reqId":"om5OE3nHeC7HSSttERzM","remoteAddr":"192.168.1.161","app":"onlyoffice","message":"Set opening in a same tab: true","level":1,"time":"2017-05-30 18:42:45","method":"PUT","url":"\/index.php\/apps\/onlyoffice\/ajax\/settings","user":"user","version":"11.0.3.2"}

Further and related to this office documents can be created in Nexcloud but not updated.
Messages in Nextcloud log when creating and then attempting to update a document:
{"reqId":"vjyb0kF6AhrKKJfCIHc1","remoteAddr":"185.153.179.5","app":"admin_audit","message":"File created: \"\/Test OO\/test1.xlsx\"","level":1,"time":"2017-05-30 17:36:40","method":"POST","url":"\/index.php\/apps\/onlyoffice\/ajax\/new","user":"user","version":"11.0.3.2"} {"reqId":"vjyb0kF6AhrKKJfCIHc1","remoteAddr":"185.153.179.5","app":"admin_audit","message":"File written to: \"\/Test OO\/test1.xlsx\"","level":1,"time":"2017-05-30 17:36:40","method":"POST","url":"\/index.php\/apps\/onlyoffice\/ajax\/new","user":"user","version":"11.0.3.2"} {"reqId":"MDDK5ARAN3mNuCaNZFcN","remoteAddr":"185.153.179.5","app":"admin_audit","message":"File accessed: \"\/Test OO\/test1.xlsx\"","level":1,"time":"2017-05-30 17:37:06","method":"GET","url":"\/remote.php\/webdav\/Test%20OO\/test1.xlsx","user":"user","version":"11.0.3.2"} {"reqId":"HkQy8b99ph8xrhzQENrI","remoteAddr":"192.168.1.179","app":"PHP","message":"file_get_contents(): Peer certificate CN=onlyoffice.abc.com' did not match expected CN=192.168.1.179' at \/var\/www\/nextcloud\/apps\/onlyoffice\/controller\/callbackcontroller.php#315","level":3,"time":"2017-05-30 17:37:25","method":"POST","url":"\/index.php\/apps\/onlyoffice\/track?doc=NG9wc1VoR1ByOENwQVc1cDVmSU1Nci9YaHdwWHFKNHhoSDJrM3VCbDFsST0\/eyJmaWxlSWQiOjExNTc3LCJvd25lcklkIjoiZGJ1Y2siLCJhY3Rpb24iOiJ0cmFjayJ9","user":"--","version":"11.0.3.2"} {"reqId":"HkQy8b99ph8xrhzQENrI","remoteAddr":"192.168.1.179","app":"PHP","message":"file_get_contents(): Failed to enable crypto at \/var\/www\/nextcloud\/apps\/onlyoffice\/controller\/callbackcontroller.php#315","level":3,"time":"2017-05-30 17:37:25","method":"POST","url":"\/index.php\/apps\/onlyoffice\/track?doc=NG9wc1VoR1ByOENwQVc1cDVmSU1Nci9YaHdwWHFKNHhoSDJrM3VCbDFsST0\/eyJmaWxlSWQiOjExNTc3LCJvd25lcklkIjoiZGJ1Y2siLCJhY3Rpb24iOiJ0cmFjayJ9","user":"--","version":"11.0.3.2"} {"reqId":"HkQy8b99ph8xrhzQENrI","remoteAddr":"192.168.1.179","app":"PHP","message":"file_get_contents(https:\/\/192.168.1.179\/cache\/files\/115771496165800_187\/output.xlsx\/output.xlsx?md5=BlciLZ-1XnMtHmQhydNwiQ==&expires=1498757846&disposition=attachment&ooname=output.xlsx): failed to open stream: operation failed at \/var\/www\/nextcloud\/apps\/onlyoffice\/controller\/callbackcontroller.php#315","level":3,"time":"2017-05-30 17:37:25","method":"POST","url":"\/index.php\/apps\/onlyoffice\/track?doc=NG9wc1VoR1ByOENwQVc1cDVmSU1Nci9YaHdwWHFKNHhoSDJrM3VCbDFsST0\/eyJmaWxlSWQiOjExNTc3LCJvd25lcklkIjoiZGJ1Y2siLCJhY3Rpb24iOiJ0cmFjayJ9","user":"--","version":"11.0.3.2"}

@JohnPerkin
Copy link

JohnPerkin commented Jun 1, 2017

Hello @Dave-REBL!
The issue may occur because PHP does not have a list of trusted certificate authorities. So it does not recognize Document Server certificate.
We can suggest you to use a bundle of CA certificates to validate certificates of Document Server. You may download it at http://curl.haxx.se/ca/cacert.pem
Please tell us if this solution will work.

@Dave-REBL
Copy link
Author

@JohnPerkin
It looks like that the issue is related to PHP peer verification. I have a SSL certificate for the FQDN of the Onlyoffice server (onlyoffice.abc.com) however the SSL connection attempt is to the internal IP address that is specified in the "Document Editing Service address for internal requests from the server" setting (192.168.1.179). This fails the PHP peer validation test:

Peer certificate CN=onlyoffice.abc.com' did not match expected CN=192.168.1.179'

The work-around to this issue, at least in my case, is to set the "Document Editing Service address for internal requests from the server" to be the same as the "Document Editing Service address". This allows the Onlyoffice settings to be saved successfully and also resolves the issue where the updated office document is not saved in Nextcloud. Note that in my case "onlyoffice.abc.com" must resolve locally to the internal address (192.168.1.179).

@alexanderonlyoffice
Copy link

Hello @Dave-REBL

Please do the following to resolve the issue: open the NextCloud config file /nextcloud/config/config.php => and add a section to it:

'onlyoffice' =>
array (
'verify_peer_off' => TRUE,
)

@erezschatz
Copy link

@alexanderonlyoffice - That did the trick for me.

@silver-gw
Copy link

@alexanderonlyoffice Thanks a bunch! In my case, NextCloud was not accepting the onlyoffice URL at all but adding these lines fixed the issue.

@LinneyS
Copy link
Member

LinneyS commented Mar 16, 2018

@Dave-REBL
Is there a change in the file from the editors, if you download it from owncloud

@Dave-REBL
Copy link
Author

@LinneyS
Currently running Onlyoffice app 1.2.0 on Nextcloud 12.0.5 without any significant issues. When files are modified in Onlyoffice the changes are reflected in Nextcloud as expected.
This issue can be closed.

@LinneyS LinneyS closed this as completed Mar 19, 2018
@alejo1521
Copy link

It work for my.

'onlyoffice' =>
array (
'verify_peer_off' => TRUE,
)

@austinsdoe
Copy link

Was facing the same problem. The way It was solve was to use the fully qualify domain name instead of IP address. eg. https://xe.jit.intranet/onlyoffice-documentserver/. The fully qualify domain name can be found in /etc/hosts

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

No branches or pull requests

8 participants