Error trying to edit an Alfresco document with OnlyOffice

How do I connect OnlyOffice to Alfresco Community server? Here is my current setup:
Alfresco 7.3 on Debian in QEMU VM, from Bitnami image.
OnlyOffice Docs 7.4 on Ubuntu in QEMU VM, installed by snap.
Both VMs on the same machine. VMs have separate IP addresses, assigned by DHCP.
ALfresco has the plugins installed, and the OnlyOffice configuration page has the Docs server IP address set, and the IP address is also set in the Advanced settings.
Alfresco has a Word doc in it, and the “Edit in OnlyOffice” link is displayed.
When I click on it, I see the following error messages:

  1. “Warning The document could not be saved. Please check connection settings or contact your administrator. When you click the ‘OK’ button you will be prompted to download the document.”
    After a few seconds this is overlaid with:
  2. “Download failed. Press ‘OK’ to return to the document list.”

I was hoping that by using preconfigured installs of the two systems (the Bitnami image of Alfresco and the Snap install of OnlyOffice) I could get around configuration issues but obviously I’ve missed something. Could someone please tell me where to look to find the problem. Bear in mind this is the Snap install, so the directories are non-standard.

Hello, @Iain

Perhaps this topic might be able to help you with something.
Onlyoffice Alfresco connector #4599

  1. Please send the document server logs from
    (snap) /var/snap/onlyoffice-ds/current/ var/log/onlyoffice/documentserver
    Let’s see what’s happening there.

  2. Does the Document Server work in front of a proxy server?

  3. Please attach the contents of /etc/only office/documentserver/local.json and screenshot connector settings. (hide sensitive information)

  4. Is the document server connection on the connector settings page successful?

Hi Nikolas,
0. The only server log that has anything in it is documentservice/out.log and it is huge. Here’s the end of it:
[2023-09-26T16:55:28.464] [WARN] [localhost] [docId] [userId] nodeJS - Express server starting…
[2023-09-26T16:55:28.470] [WARN] [localhost] [docId] [userId] nodeJS - Failed to subscribe to plugin folder updates. When changing the list of plugins, you must restart the server. File system | Node.js v20.7.0 Documentation
[2023-09-26T16:55:28.491] [ERROR] [localhost] [docId] [userId] nodeJS - [AMQP] Error: connect ECONNREFUSED 127.0.0.1:5672
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16)
[2023-09-26T16:55:29.495] [ERROR] [localhost] [docId] [userId] nodeJS - [AMQP] Error: connect ECONNREFUSED 127.0.0.1:5672
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16)
[2023-09-26T16:55:30.498] [ERROR] [localhost] [docId] [userId] nodeJS - [AMQP] Error: connect ECONNREFUSED 127.0.0.1:5672
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16)
[2023-09-26T16:55:31.499] [ERROR] [localhost] [docId] [userId] nodeJS - [AMQP] Error: connect ECONNREFUSED 127.0.0.1:5672
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16)
[2023-09-26T16:55:32.688] [WARN] [localhost] [docId] [userId] nodeJS - Express server listening on port 8000 in production-linux mode. Version: 7.4.1. Build: 36
[2023-09-26T17:16:16.992] [WARN] [localhost] [docId] [userId] nodeJS - checkJwt error: name = JsonWebTokenError message = invalid signature token = eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjIjoidmVyc2lvbiJ9.tKIX3peVPRGjRBuyMvVmYQVFtDQOdrD_pr9U1TsSxhg
[2023-09-26T17:18:27.807] [WARN] [localhost] [a07fd3f1-03f1-48af-8cc8-0b5d12af80f0_1.1] [userId] nodeJS - checkJwt error: name = JsonWebTokenError message = invalid signature token = eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlZGl0b3JDb25maWciOnsibW9kZSI6ImVkaXQiLCJjdXN0b21pemF0aW9uIjp7ImZlZWRiYWNrIjpmYWxzZSwiaGVscCI6dHJ1ZSwiZ29iYWNrIjp7InVybCI6Imh0dHA6Ly9sb2NhbGhvc3Q6ODA4MC9zaGFyZS9wYWdlL3JlcG9zaXRvcnk_ZmlsdGVyPXBhdGglN2MlMmZzaGFyZWQifSwiY29tcGFjdEhlYWRlciI6ZmFsc2UsImNoYXQiOnRydWUsInJldmlldyI6Im9yaWdpbmFsIiwiZm9yY2VzYXZlIjpmYWxzZSwidG9vbGJhck5vVGFicyI6ZmFsc2V9LCJ0ZW1wbGF0ZXMiOltdLCJjcmVhdGVVcmwiOiJodHRwOi8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VkOGI3MTMyZmJhOSIsImZpbGVUeXBlIjoiZG9jeCIsImtleSI6ImEwN2ZkM2YxLTAzZjEtNDhhZi04Y2M4LTBiNWQxMmFmODBmMF8xLjEiLCJpbmZvIjp7ImZhdm9yaXRlIjpmYWxzZX19LCJ3aWR0aCI6IjEwMCUiLCJ0eXBlIjoiZGVza3RvcCIsImhlaWdodCI6IjEwMCUifQ.yuG39vpx9c018mha8sD8djl0T_kuv0R9a3Lwtbe2q8E

  1. I’m not sure what you mean, but there is no proxy server installed that I know of.

  2. Here is the local.json:
    {
    “log”: {
    “filePath”: “/snap/onlyoffice-ds/current/etc/onlyoffice/documentserver/log4js/production.json”
    },
    “storage”: {
    “fs”: {
    “folderPath”: “/var/snap/onlyoffice-ds/common/var/lib/onlyoffice/documentserver/App_Data/cache/files”
    }
    },
    “wopi”: {
    “htmlTemplate” : “/snap/onlyoffice-ds/current/var/www/onlyoffice/documentserver/web-apps/apps/api/wopi”
    },
    “services”: {
    “CoAuthoring”: {
    “server”: {
    “newFileTemplate” : “/snap/onlyoffice-ds/current/var/www/onlyoffice/documentserver/document-templates/new”,
    “static_content”: {
    “/fonts”: {
    “path”: “/snap/onlyoffice-ds/current/var/www/onlyoffice/documentserver/fonts”,
    “options”: {“maxAge”: “7d”}
    },
    “/sdkjs”: {
    “path”: “/snap/onlyoffice-ds/current/var/www/onlyoffice/documentserver/sdkjs”,
    “options”: {“maxAge”: “7d”}
    },
    “/web-apps”: {
    “path”: “/snap/onlyoffice-ds/current/var/www/onlyoffice/documentserver/web-apps”,
    “options”: {“maxAge”: “7d”}
    },
    “/welcome”: {
    “path”: “/snap/onlyoffice-ds/current/var/www/onlyoffice/documentserver/server/welcome”,
    “options”: {“maxAge”: “7d”}
    },
    “/info”: {
    “path”: “/snap/onlyoffice-ds/current/var/www/onlyoffice/documentserver/server/info”,
    “options”: {“maxAge”: “7d”}
    },
    “/sdkjs-plugins”: {
    “path”: “/var/snap/onlyoffice-ds/current/var/www/onlyoffice/documentserver/sdkjs-plugins”,
    “options”: {“maxAge”: “7d”}
    },
    “/dictionaries”: {
    “path”: “/snap/onlyoffice-ds/current/var/www/onlyoffice/documentserver/dictionaries”,
    “options”: {“maxAge”: “7d”}
    }
    }
    },
    “utils”: {
    “utils_common_fontdir”: “/snap/onlyoffice-ds/current/usr/share/fonts”
    },
    “sockjs”: {
    “sockjs_url”: “/snap/onlyoffice-ds/current/var/www/onlyoffice/documentserver/web-apps/vendor/sockjs/sockjs.min.js”
    },
    “sql”: {
    “type”: “mysql”,
    “dbPort”: 3306,
    “dbPass”: “onlyoffice”,
    “charset”: “utf8”
    },
    “secret”: {
    “browser”: {“string”: “secret”, “file”: “”, “tenants”: {}},
    “inbox”: {“string”: “default-jwt-secret”, “file”: “”, “tenants”: {}},
    “outbox”: {“string”: “default-jwt-secret”, “file”: “”},
    “session”: {“string”: “default-jwt-secret”, “file”: “”}
    },
    “token”: {
    “enable”: {
    “browser”: true,
    “request”: {
    “inbox”: true,
    “outbox”: true
    }
    },
    “inbox”: {
    “header”: “Authorization”
    },
    “outbox”: {
    “header”: “Authorization”
    }
    },
    “requestDefaults”: {
    “rejectUnauthorized”: true
    }
    }
    },
    “license”: {
    “license_file”: “/snap/onlyoffice-ds/current/var/www/onlyoffice/Data/license.lic”,
    “warning_limit_percents”: “70”,
    “packageType”: 0
    },
    “FileConverter”: {
    “converter”: {
    “fontDir”: “/snap/onlyoffice-ds/current/usr/share/fonts”,
    “presentationThemesDir”: “/snap/onlyoffice-ds/current/var/www/onlyoffice/documentserver/sdkjs/slide/themes”,
    “x2tPath”: “/snap/onlyoffice-ds/current/var/www/onlyoffice/documentserver/server/FileConverter/bin/x2t”,
    “docbuilderPath”: “/snap/onlyoffice-ds/current/var/www/onlyoffice/documentserver/server/FileConverter/bin/docbuilder”,
    “docbuilderAllFontsPath”: “/snap/onlyoffice-ds/current/var/lib/onlyoffice/documentserver/App_Data/docbuilder/AllFonts.js”,
    “docbuilderCoreFontsPath”: “/snap/onlyoffice-ds/current/var/www/onlyoffice/documentserver/core-fonts”
    }
    },
    “FileStorage”: {
    “directory”: “/var/snap/onlyoffice-ds/common/var/lib/onlyoffice/documentserver/App_Data”
    },
    “SpellChecker”: {
    “server”: {
    “dictDir”: “/snap/onlyoffice-ds/current/var/www/onlyoffice/documentserver/dictionaries”
    }
    }
    }

and the connector settings:

  1. Yes, hitting 192.168.0.154 returns http://192.168.0.154/welcome/

I noticed the JWT Error in the error.log, so I changed the field on the connector settings to match the local.json, but that threw this error:
“The document security token is not correctly formed. Please contact your document server administrator. Press ‘OK’ to return to the document list.”

So now I’m more confused about how the JWT should be configured. Is it just a plain text string in both places?
Thanks,

Ah ha! So running sudo snap get onlyoffice-ds onlyoffice.jwt-secret and pasting the result into the ‘secret key’ field gets me further, but I’m still getting the first two error messages.
out.log now contains this:
[2023-09-26T17:42:07.233] [ERROR] [null] [null] [null] nodeJS - (node:1912) [DEP0118] DeprecationWarning: The provided hostname "" is not a valid hostname, and is supported in the dns module solely for compatibility. (Use node --trace-deprecation … to show where the warning was created) [2023-09-26T17:42:07.673] [ERROR] [localhost] [a07fd3f1-03f1-48af-8cc8-0b5d12af80f0_1.1] [admin] nodeJS - postData error: url = http:///%27192.168.0.135%27;:8080/alfresco/s/parashift/onlyoffice/callback?nodeRef=workspace://SpacesStore/a07fd3f1-03f1-48af-8cc8-0b5d12af80f0&cb_key=7Gd99K8xxYOg5MKxaKahufGJLTl5PLLG-4Y9louLdvs;data = {"key":"a07fd3f1-03f1-48af-8cc8-0b5d12af80f0_1.1","status":1,"users":["admin"],"actions":[{"type":1,"userid":"admin"}],"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiJhMDdmZDNmMS0wM2YxLTQ4YWYtOGNjOC0wYjVkMTJhZjgwZjBfMS4xIiwic3RhdHVzIjoxLCJ1c2VycyI6WyJhZG1pbiJdLCJhY3Rpb25zIjpbeyJ0eXBlIjoxLCJ1c2VyaWQiOiJhZG1pbiJ9XSwiaWF0IjoxNjk1NzUwMTI3LCJleHAiOjE2OTU3NTA0Mjd9.C2Yh3ylgd2EHlKpFJvL-ixJ7q6ueWAUp3EU9fBxdQfo"} Error: Invalid URI "http:///%27192.168.0.135%27;:8080/alfresco/s/parashift/onlyoffice/callback?nodeRef=workspace://SpacesStore/a07fd3f1-03f1-48af-8cc8-0b5d12af80f0&cb_key=7Gd99K8xxYOg5MKxaKahufGJLTl5PLLG-4Y9louLdvs" at Request.init (/snap/onlyoffice-ds/171/var/www/onlyoffice/documentserver/server/Common/node_modules/request/request.js:273:31) at new Request (/snap/onlyoffice-ds/171/var/www/onlyoffice/documentserver/server/Common/node_modules/request/request.js:127:8) at request (/snap/onlyoffice-ds/171/var/www/onlyoffice/documentserver/server/Common/node_modules/request/index.js:53:10) at /snap/onlyoffice-ds/171/var/www/onlyoffice/documentserver/server/Common/node_modules/request/index.js:61:12 at Function.post (/snap/onlyoffice-ds/171/var/www/onlyoffice/documentserver/server/Common/node_modules/request/index.js:100:12) at /snap/onlyoffice-ds/171/var/www/onlyoffice/documentserver/server/Common/sources/utils.js:370:26 at new Promise (<anonymous>) at Object.postRequestPromise (/snap/onlyoffice-ds/171/var/www/onlyoffice/documentserver/server/Common/sources/utils.js:351:10) at sendServerRequest (/snap/onlyoffice-ds/171/var/www/onlyoffice/documentserver/server/DocService/sources/DocsCoServer.js:602:29) at sendServerRequest.next (<anonymous>) at sendStatusDocument (/snap/onlyoffice-ds/171/var/www/onlyoffice/documentserver/server/DocService/sources/DocsCoServer.js:886:24) at sendStatusDocument.next (<anonymous>) at endAuth (/snap/onlyoffice-ds/171/var/www/onlyoffice/documentserver/server/DocService/sources/DocsCoServer.js:2289:29) at endAuth.next (<anonymous>) at auth (/snap/onlyoffice-ds/171/var/www/onlyoffice/documentserver/server/DocService/sources/DocsCoServer.js:2253:35) at auth.next (<anonymous>)

It’s possible that the problem lies here:

  • Document Editing Service address for internal requests from the Alfresco server - specify the address that is used to access Document Editing Service from Alfresco server.
  • Alfresco server address for internal requests from the Document Editing Service - specify the address that is used to access Alfresco server from Document Editing Service.

And you still haven’t sent a screenshot of a successful connection check after pressing the ‘save’ button).

This is strange. I added the URLs to the advanced section, and it seems to be working now, but I still don’t see a ‘Success’ on the configuration page. And there are no more errors in the log file. Does this mean it’s working properly?

Update:
With these settings I see ‘Success’ at the top for about five seconds (It’s just under the Alfresco logo) but I still can’t edit or save and I get the same error messages as originally reported. I set the secret to ‘secret’ on the configuration page and in the local.json file.

@Iain
Please open the ‘advanced server settings’ section and show it to us.

I could be mistaken, but it seems to me that there might be an issue with the network settings of the virtual machines.

Sorry about that.

Please check the availability of both machines to each other using curl command, like this
On your server with alfresco installed execute curl http://ip-ds
On your server with document server installed execute curl http://ip-alfreslo

Okay, curl http://192.168.0.135 (from Alfresco to OnlyOffice) returns:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="http://192.168.0.135/share">here</a>.</p>

And curl http:\\192.168.0.154 (from OnlyOffice to Alfresco) returns:
<html>
<head><title>302 Found</title></head>
<body>
<center><h1>302 Found</h1></center>
<hr><center>nginx</center>
</body>
</html>

This suggests to me that the two machines can talk to each other. Does this help?

This might be useful: when I try to visit the local example (http://192.168.0.154/example) I get a page back with the message “Error 502 Bad Gateway” from nginx.

@Iain

Sorry I haven’t been there for so long, I lost the message…
No, ds-example does not work because it is not enabled. That’s how it should be if you didn’t turn it on). This is an example.

Can I ask you personally to send me alfresco-global.properties and local.json in private messages

Hi Nikolas,
We seem to have it working now. It just seems to take a long time for both systems to load and initialize. The errors appear the first time we test it, but after a few minutes the whole thing works perfectly. Also, allocating the right number of CPUs and RAM to the VMs helps, too.
Thank you for your assistance with this, you certainly put us on the right track.

1 Like