Integrations problem

Integration questions/issues
Post Reply
michalcharvat
Posts: 9
Joined: Tue Feb 23, 2021 2:23 pm

Integrations problem

Post by michalcharvat » Tue Feb 23, 2021 2:49 pm

Hello,

I am workign on plugin for CRM, which will allow users open files in OO. I am currently facing two problems:
  • When only autosave is enabled, OO stop sending changes to CRM in few minutes. This is strange but no other request is not processed. In CRM is only old file version, OO has cached new version. Is there any problem in configuration?
  • With forceSave everything is works as expected except the problem when user close window without saving document in OO, no changes are tranferred back to CRM
  • When I try open xls, doc, ppt files (which are not supported by default) documents are successfully opened however there is conversion error - Error occured in the document service: Bad document request. At first I though I have problem somewhere in my code but when I used PHP Example you have on github, I get same error.

Code: Select all

[2021-02-23T14:42:32.434] [ERROR] nodeJS - stdout (id=conv_1846565140_xls):
[2021-02-23T14:42:32.434] [ERROR] nodeJS - stderr (id=conv_1846565140_xls):
[2021-02-23T14:42:32.434] [ERROR] nodeJS - ExitCode (code=88;signal=null;error:-88;id=conv_1846565140_xls)
onlyoffice-documentserver version 6.1.1-53 on ubuntu

Carl
Posts: 652
Joined: Thu Apr 12, 2018 10:00 am

Re: Integrations problem

Post by Carl » Wed Feb 24, 2021 8:44 am

Hello Michal,

Please specify the version of the Document Server you are using. Also reproduce the issue, describe your actions step-by-step and send me DS logs /var/log/onlyoffice/documentserver/

As for xls/doc/ppt files, you need to convert legacy format files prior to opening them with ONLYOFFICE editors. See this article:
https://api.onlyoffice.com/editors/conversion

michalcharvat
Posts: 9
Joined: Tue Feb 23, 2021 2:23 pm

Re: Integrations problem

Post by michalcharvat » Wed Feb 24, 2021 12:09 pm

Hello Carl,

I already specified version in previous post: Version: 6.1.1 (build:53)

Code: Select all

[2021-02-23T23:22:08.040] [ERROR] nodeJS - sendServerRequest error: docId = e6eb175a2f02328f;url = http://192.168.1.21/groupoffice/onlyoffice/file/11?token=5ffc57d956d02abb10205e346c52af8faa50044d955b1&type=track;data = {"key":"e6eb175a2f02328f","status":2,"url":"http://192.168.1.19/cache/files/e6eb175a2f02328f_9869/output.xlsx/output.xlsx?md5=NxOAlI13FbF0I6Cl-aXdmw&expires=1614123427&disposition=attachment&filename=output.xlsx","changesurl":"http://192.168.1.19/cache/files/e6eb175a2f02328f_9869/changes.zip/changes.zip?md5=_IEnSF683A-ip1E8FuAkjw&expires=1614123427&disposition=attachment&filename=changes.zip","history":{"serverVersion":"6.1.1","changes":[{"created":"2021-02-23 14:35:23","user":{"id":"1","name":"System Administrator"}}]},"users":["1"],"actions":[{"type":0,"userid":1}],"lastsave":"2021-02-23T14:44:06.187Z","notmodified":false}^M
Error: Error response: statusCode:500; headers:{"date":"Tue, 23 Feb 2021 23:22:06 GMT","server":"Apache/2.4.38 (Debian)","set-cookie":["groupoffice=des2832m7n2t0mmf2e4thhbn3a; path=/; HttpOnly; SameSite=Lax"],"expires":"Mon, 26 Jul 1997 05:00:00 GMT","cache-control":"cache","pragma":"cache","x-robots-tag":"noindex","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","content-security-policy":"default-src 'self' about:;font-src 'self' data: https://*.googleapis.com https://*.gstatic.com;script-src 'unsafe-eval' 'self' 'unsafe-inline' https://*.googleapis.com https://*.gstatic.com;img-src 'self' about: data: http: https:;style-src 'self' 'unsafe-inline' https://*.googleapis.com https://*.gstatic.com;frame-src 'self' https: http: groupoffice: groupoffices:;frame-ancestors 'self';connect-src 'self' ws://192.168.1.21:8080 wss://192.168.1.21:8080;","strict-transport-security":"max-age=31536000","x-xss-protection":"1;mode=block","content-length":"76","connection":"close","content-type":"application/json; charset=UTF-8"}; body:^M
{"message":"Error occurred in the document service: Error document request"}
    at Request._callback (/snapshot/server/build/server/Common/sources/utils.js:0:0)
    at Request.init.self.callback (/snapshot/server/build/server/Common/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.<anonymous> (/snapshot/server/build/server/Common/node_modules/request/request.js:1154:10)
    at Request.emit (events.js:198:13)
    at IncomingMessage.<anonymous> (/snapshot/server/build/server/Common/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:286:20)
    at IncomingMessage.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1143:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
[2021-02-23T23:22:08.041] [WARN] nodeJS - commandSfcCallback backoff limit exceeded: docId = e6eb175a2f02328f
[2021-02-23T23:22:08.043] [WARN] nodeJS - storeForgotten: docId = e6eb175a2f02328f
There is no problem open these documents but there is problem converting ie save these documents.

michalcharvat
Posts: 9
Joined: Tue Feb 23, 2021 2:23 pm

Re: Integrations problem

Post by michalcharvat » Wed Feb 24, 2021 12:11 pm

Hello Carl,

do you have any clue what's the problem regards to my first question - autoSave/forceSave?

Thank you very much for your kind support

michalcharvat
Posts: 9
Joined: Tue Feb 23, 2021 2:23 pm

Re: Integrations problem

Post by michalcharvat » Fri Feb 26, 2021 12:51 am

Could be something wrong with my environment or configuration? The onlyoffice-documentserver is just installed based on your documentation to Ubuntu 20.04. The strange thing is everything works well in demo. When I upload xls file to example instance the file is successfully converted to pdf or xlsx. However when I try download it as pdf via iframe interface, I see an following error in log and editor is masked with downloading message. Only what I changed in default configuration is logging from WARN to DEBUG.

Code: Select all

[2021-02-26T00:24:47.196] [DEBUG] nodeJS - Start Task(id=a3c39694cb6c2c86_5373)
[2021-02-26T00:24:47.198] [DEBUG] nodeJS - downloadFileFromStorage list a3c39694cb6c2c86/Editor.bin (id=a3c39694cb6c2c86)
[2021-02-26T00:24:47.200] [DEBUG] nodeJS - downloadFileFromStorage complete(id=a3c39694cb6c2c86_5373)
[2021-02-26T00:24:47.200] [DEBUG] nodeJS - downloadFileFromStorage list a3c39694cb6c2c86_5373/Editor.bin (id=a3c39694cb6c2c86_5373)
[2021-02-26T00:24:47.223] [DEBUG] nodeJS - stdout (id=a3c39694cb6c2c86_5373):
[2021-02-26T00:24:47.224] [DEBUG] nodeJS - stderr (id=a3c39694cb6c2c86_5373):
[2021-02-26T00:24:47.224] [DEBUG] nodeJS - ExitCode (code=0;signal=null;error:0;id=a3c39694cb6c2c86_5373)
[2021-02-26T00:24:47.225] [DEBUG] nodeJS - processUploadToStorage complete(id=a3c39694cb6c2c86_5373)
[2021-02-26T00:24:47.225] [DEBUG] nodeJS - output (data={"cmd":{"c":"save","id":"a3c39694cb6c2c86","userid":1,"data":null,"title":"Test.pdf","outputformat":513,"outputpath":"output.pdf","savetype":3,"saveindex":1,"status_info":0,"savekey":"a3c39694cb6c2c86_5373","userconnectionid":8,"nobase64":true}};id=a3c39694cb6c2c86_5373)
[2021-02-26T00:24:47.225] [DEBUG] nodeJS - postProcess (id=a3c39694cb6c2c86_5373)
[2021-02-26T00:24:47.225] [DEBUG] nodeJS - deleteFolderRecursive (id=a3c39694cb6c2c86_5373)

Carl
Posts: 652
Joined: Thu Apr 12, 2018 10:00 am

Re: Integrations problem

Post by Carl » Fri Feb 26, 2021 8:15 am

Hello Michal,

There are no errors in the log in your latest reply.

In this scenario
When only autosave is enabled, OO stop sending changes to CRM in few minutes. This is strange but no other request is not processed. In CRM is only old file version, OO has cached new version. Is there any problem in configuration?
With forceSave everything is works as expected except the problem when user close window without saving document in OO, no changes are tranferred back to CRM
there must be saving errors in the Document Server logs. Please check if there are any storeForgotten lines, or better reproduce the scenario once again and send me the whole DS log directory.
"Error occurred in the document service: Error document request"
Does this issue occur with all files or some particular files? Do you perform the conversion from legacy to ooxml format before editing these files? Please attach any example file.

michalcharvat
Posts: 9
Joined: Tue Feb 23, 2021 2:23 pm

Re: Integrations problem

Post by michalcharvat » Fri Feb 26, 2021 10:15 pm

Could be there problem with missing license?

https://en.webshare.cz/#/file/eEneh13Isp

Testing file is for example any file from https://api.onlyoffice.com/editors/demopreview PHP Example.

michalcharvat
Posts: 9
Joined: Tue Feb 23, 2021 2:23 pm

Re: Integrations problem

Post by michalcharvat » Sat Feb 27, 2021 12:57 am

One more thing related to autosave problem. I went trough forum and looks like I am not only one who have problem with autosave.When I checked OO log I see the changes are really processed by OO but there is no callback to GO (CRM). I checked also other OO logs but I dont see any error in error logs. Do you have any hint how to continue? Last received status is 1... so there is no error at all but OO dont send other changed back to CRM. Couldnt be problem in following line?

Code: Select all

saveFromChanges status mismatch: docId = 3479dab03435d0b1; row: 1; 0; expected: 3376930
CRM log

Code: Select all

[Sat Feb 27 01:41:29.614491 2021] [php7:notice] [pid 26207] [client 192.168.1.19:60084] a:4:{s:3:"key";s:16:"9b79cdee94de38f1";s:6:"status";i:1;s:5:"users";a:1:{i:0;s:1:"1";}s:7:"actions";a:1:{i:0;a:2:{s:4:"type";i:1;s:6:"userid";i:1;}}}
OO log

Code: Select all

[2021-02-27T00:41:29.536] [DEBUG] nodeJS - postData request: docId = 9b79cdee94de38f1;url = http://192.168.1.21/groupoffice/onlyoffice/file/141?token=5ffc57d956d02abb10205e346c52af8faa50044d955b1&type=track;data = {"key":"9b79cdee94de38f1","status":1,"users":["1"],"actions":[{"type":1,"userid":1}]}
[2021-02-27T00:41:29.614] [DEBUG] nodeJS - postData response: docId = 9b79cdee94de38f1;data = {"error":0,"status":"success"}
[2021-02-27T00:41:29.617] [DEBUG] nodeJS - sendData: docId = 9b79cdee94de38f1;type = auth
[2021-02-27T00:41:29.618] [DEBUG] nodeJS - Start command: docId = 9b79cdee94de38f1 {"withAuthorization":true,"c":"open","id":"9b79cdee94de38f1","userid":1,"format":"docx","url":"http://192.168.1.21/groupoffice/onlyoffice/file/download/141?token=5ffc57d956d02abb10205e346c52af8faa50044d955b1","title":"demo.docx","lcid":9,"nobase64":true}
[2021-02-27T00:41:29.619] [DEBUG] nodeJS - Response command: docId = 9b79cdee94de38f1 {"type":"open","status":"ok","data":{"Editor.bin":"http://192.168.1.19/cache/files/9b79cdee94de38f1/Editor.bin/Editor.bin?md5=BCArHhnE-3EM8TNyDe_d1w&expires=1616978490&disposition=attachment&filename=Editor.bin"}}
[2021-02-27T00:41:29.620] [DEBUG] nodeJS - sendData: docId = 9b79cdee94de38f1;type = documentOpen
[2021-02-27T00:41:29.620] [DEBUG] nodeJS - End command: docId = 9b79cdee94de38f1
[2021-02-27T00:41:36.463] [INFO] nodeJS - data.type = isSaveLock id = 9b79cdee94de38f1
[2021-02-27T00:41:36.464] [DEBUG] nodeJS - isSaveLock: docId = 9b79cdee94de38f1; lockRes: true
[2021-02-27T00:41:36.465] [DEBUG] nodeJS - sendData: docId = 9b79cdee94de38f1;type = saveLock
[2021-02-27T00:41:36.470] [INFO] nodeJS - data.type = saveChanges id = 9b79cdee94de38f1
[2021-02-27T00:41:36.471] [INFO] nodeJS - Start saveChanges docid: 9b79cdee94de38f1; reSave: undefined
[2021-02-27T00:41:36.473] [INFO] nodeJS - saveChanges docid: 9b79cdee94de38f1 ; deleteIndex: -1 ; startIndex: 0 ; length: 2
[2021-02-27T00:41:36.477] [DEBUG] nodeJS - sendData: docId = 9b79cdee94de38f1;type = unSaveLock
[2021-02-27T00:41:41.366] [INFO] nodeJS - data.type = isSaveLock id = 9b79cdee94de38f1
[2021-02-27T00:41:41.366] [DEBUG] nodeJS - isSaveLock: docId = 9b79cdee94de38f1; lockRes: true
[2021-02-27T00:41:41.367] [DEBUG] nodeJS - sendData: docId = 9b79cdee94de38f1;type = saveLock
[2021-02-27T00:41:41.370] [INFO] nodeJS - data.type = saveChanges id = 9b79cdee94de38f1
[2021-02-27T00:41:41.370] [INFO] nodeJS - Start saveChanges docid: 9b79cdee94de38f1; reSave: undefined
[2021-02-27T00:41:41.373] [INFO] nodeJS - saveChanges docid: 9b79cdee94de38f1 ; deleteIndex: 2 ; startIndex: 2 ; length: 7
[2021-02-27T00:41:41.377] [DEBUG] nodeJS - sendData: docId = 9b79cdee94de38f1;type = unSaveLock
[2021-02-27T00:41:46.580] [INFO] nodeJS - data.type = isSaveLock id = 9b79cdee94de38f1
[2021-02-27T00:41:46.580] [DEBUG] nodeJS - isSaveLock: docId = 9b79cdee94de38f1; lockRes: true
[2021-02-27T00:41:46.580] [DEBUG] nodeJS - sendData: docId = 9b79cdee94de38f1;type = saveLock
[2021-02-27T00:41:46.584] [INFO] nodeJS - data.type = saveChanges id = 9b79cdee94de38f1
[2021-02-27T00:41:46.584] [INFO] nodeJS - Start saveChanges docid: 9b79cdee94de38f1; reSave: undefined
[2021-02-27T00:41:46.585] [INFO] nodeJS - saveChanges docid: 9b79cdee94de38f1 ; deleteIndex: 9 ; startIndex: 9 ; length: 5
[2021-02-27T00:41:46.586] [DEBUG] nodeJS - sendData: docId = 9b79cdee94de38f1;type = unSaveLock
[2021-02-27T00:42:00.007] [DEBUG] nodeJS - expireDoc connections.length = 1
[2021-02-27T00:42:00.011] [DEBUG] nodeJS - checkDocumentExpire start
[2021-02-27T00:42:00.012] [DEBUG] nodeJS - checkDocumentExpire end: startSaveCount = 0, removedCount = 0

michalcharvat
Posts: 9
Joined: Tue Feb 23, 2021 2:23 pm

Re: Integrations problem

Post by michalcharvat » Tue May 11, 2021 3:13 pm

Another developer looked at it and accidentally found the problem - everything was in wrong configuration. OO does not count the logged userId could be an integer but only string. So when you use int value instead of string you dont get any error but OO will start to behave unpredictably... I hope this helps someone else

Carl
Posts: 652
Joined: Thu Apr 12, 2018 10:00 am

Re: Integrations problem

Post by Carl » Wed Jun 02, 2021 8:52 am

Hello michalcharvat,

Sorry for the delayed reply.

In Document Server 6.3 we added automatic conversion of user.id to string to prevent such issues.

Post Reply