Onlyoffice_odoo TypeError: can only concatenate str (not "bytes") to str

I try to edit docx file from odoo 16.0-20230705 (Community) by onlyoffice_odoo-16.0.1.0 and … Error

Document Server version: 7.3.3.49
Connector version: 16.0.1.0
DMS (platform) version: odoo 16.0-20230705 (Community)
OS: Debian 11.7 (odoo), Windows Server 2019 Standard (onlyoffice)
Browser version: Microsoft Edge 114.0.1823.58

Attach logs if possible.

500: Internal Server Error

(http://192.168.1.249:8069/onlyoffice/editor/966#error_traceback)

Traceback (most recent call last): File “/usr/lib/python3/dist-packages/odoo/http.py”, line 1584, in _serve_db return service_model.retrying(self._serve_ir_http, self.env) File “/usr/lib/python3/dist-packages/odoo/service/model.py”, line 133, in retrying result = func() File “/usr/lib/python3/dist-packages/odoo/http.py”, line 1611, in _serve_ir_http response = self.dispatcher.dispatch(rule.endpoint, args) File “/usr/lib/python3/dist-packages/odoo/http.py”, line 1725, in dispatch return self.request.registry[‘ir.http’]._dispatch(endpoint) File “/usr/lib/python3/dist-packages/odoo/addons/website/models/ir_http.py”, line 235, in _dispatch response = super()._dispatch(endpoint) File “/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py”, line 154, in _dispatch result = endpoint(**request.params) File “/usr/lib/python3/dist-packages/odoo/http.py”, line 697, in route_wrapper result = endpoint(self, *args, **params_ok) File “/usr/lib/python3/dist-packages/odoo/addons/onlyoffice_odoo/controllers/controllers.py”, line 87, in render_editor return request.render(“onlyoffice_odoo.onlyoffice_editor”, self.prepare_editor_values(attachment, access_token)) File “/usr/lib/python3/dist-packages/odoo/addons/onlyoffice_odoo/controllers/controllers.py”, line 150, in prepare_editor_values path_part = str(data[“id”]) + “?oo_security_token=” + security_token + (“&access_token=” +access_token if access_token else “”) TypeError: can only concatenate str (not “bytes”) to str

Hello @vdkns
Please provide us with additional details. If it’s possible please reproduce the situation (step-by-step usage scenario) and record a video file.
Additionally, please provide us with whole document server logs folder. It’s located here:
docker: /app/onlyoffice/DocumentServer/logs/documentserver/
deb\rpm: /var/log/onlyoffice/documentserver/
Windows: Program Files\ONLYOFFICE\DocumentServer\log

https://drive.google.com/drive/folders/1YvSQOR0cGTbQtnN-7_QLsdRcTMTeXKhk?usp=sharing

Thank you for provided data.
Do you have any proxy-server in front of Document server?
Also, please reproduce the situation (with correct Document server address on the connector page) and send us whole Document server folder.
Additionally, please let us know how exactly you installed the connector app.

  1. Do you have any proxy-server in front of Document server? - no (Document server and odoo in the same local network, both virtual servers on hyper-v server 2019, access from internet by NAT)
  2. Also, please reproduce the situation … - all files in google drive
  3. Connector installation process:
  • downloaded from ONLYOFFICE | Odoo Apps Store
  • unpacked in /usr/lib/python3/dist-packages/odoo/addons/onlyoffice_odoo (as root user)
  • activated developer mode in odoo (Settings - Activate the developer mode)
  • updated Apps list (Settings-Update Apps List)
  • in search field removed filter Apps and typed “onlyoffice”
  • activated connector (connector`s icon did not show, after rebooting server appeared)
  • server rebooted (sudo reboot)

P. S.
Regardless the data in connector settings (correct Document server address or blank page or random address or any security data) - error the same

Thank you for provided data!
Could you please check out mutual availability between servers? You can do it with wget\curl commands, for example, go to Document server and run wget https://Odoo_domain_name. And vice versa, from Odoo server run wget https://DS_domain_name.
One more thing, is it possible to update Document server to the latest version (v.7.4) and double check the situation?

  1. mutual connections between servers is ok

  2. document server updated to v 7.4.0.163

  3. still error
    Processing: connections between servers.pdf…

Hello @vdkns

I’d like to participate in this thread too.
I just noticed that the steps you’ve performed to manually install the connector app differ a bit from the documentation. Please refer to this articles’ installation section and try installing the connector app according to the Option 2 (manual installation):
https://api.onlyoffice.com/editors/odoo#install

Let me know the result afterwards.

  1. i checked all installation steps (according to manual installation instruction), of course the package pyjwt was installed (i forget mention about it )

  2. and make experiment

  • remove connector, delete connector folder from /usr/lib/python3/dist-packages/odoo/addons/onlyoffice_odoo and reboot server
  • add in odoo.conf addons_path = /mnt/extra-addons
  • put connector in /mnt/extra-addons
  • switch Odoo to the developer mode and click Apps → Update Apps List …
  • welcome the same error

There is an issue currently in the connector plugin:
https://github.com/ONLYOFFICE/onlyoffice_odoo/issues/10

As you can see the issue was fixed but the new version of connector plugin is not released yet. However, commit is already available and can be used.
You need to change the code according to the commit lines in the controllers.py config and then restart Odoo.

controllers.py was changed, but error remain

We have just released new version of the connector plugin for Odoo:
https://apps.odoo.com/apps/modules/16.0/onlyoffice_odoo_documents/
Please remove your currently used one and try again with new one. Let me know the result.

  1. Nothing changed (except lines numbers in traceback)
  2. The module ONLYOFFICE Documents cannot be installed, because depends from module “documents”



As it comes from the screenshot with dependency, you need to have both ‘onlyoffice_oddo_documents’ and ‘onlyoffice_odoo’ modules installed. Make sure that they are installed on your server and are up to date.

“As it comes from the screenshot with dependency, you need to have both ‘onlyoffice_oddo_documents’ and ‘onlyoffice_odoo’ modules installed …” - it`s impossible! Because ‘onlyoffice_oddo_documents’ depends from module ‘documents’, and cannot installed without it. Where can i get module ‘documents’ !?

On this screen you have both plugins for Document Server to integrate it. However, Documents module from Odoo itself is missing. It is stated on the integration page that:

This app enables users to edit and collaborate on office documents within Odoo Documents using ONLYOFFICE Docs.

Basically, Document Server requires Documents module from Odoo and plugins for the integration for proper integration.

No Documents module in odoo 16 community edition :frowning:

For Community Edition of Odoo you need only one plugin to integrate Document Server:
https://apps.odoo.com/apps/modules/16.0/onlyoffice_odoo/
Get this one, remove another one and restart Odoo, then try connecting again.

Rest of those are required for Enterprise Edition. I am sorry for missing that point.

У меня подобная проблема, но есть отличия.

ODOO 16 Enterprise (20240602), через NGINX с SSL. Сертификат самоподписанный.
Версию сервера документов Onlyoffice не помню, где можно посмотреть?

Но ранее с этим же сервером документов тестировал ODOO 16 EE (билд не помню, но 2023 года) и всё работало нормально, правда без NGINX.

ОС везде Ubuntu 20.04 server.

WGET с сервера ODOO на сервер Onlyoffice проходит без проблем, обратно ругается на самоподписанный сертификат, но с опцией --no-check-certificate проходит нормально.

Фикс в модуле проверил: fix error when file checksum is null · ONLYOFFICE/onlyoffice_odoo@2a3670a · GitHub

  • в модуле всё уже исправлено.

Описание ошибки сервера ODOO:
https://192.168.1.192/onlyoffice/editor/document/11

500: Internal Server Error

Traceback (most recent call last):
File “/odoo/odoo-server/odoo/http.py”, line 1632, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File “/odoo/odoo-server/odoo/service/model.py”, line 133, in retrying
result = func()
File “/odoo/odoo-server/odoo/http.py”, line 1659, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File “/odoo/odoo-server/odoo/http.py”, line 1773, in dispatch
return self.request.registry[‘ir.http’]._dispatch(endpoint)
File “/odoo/odoo-server/addons/website/models/ir_http.py”, line 237, in _dispatch
response = super()._dispatch(endpoint)
File “/odoo/odoo-server/odoo/addons/base/models/ir_http.py”, line 154, in _dispatch
result = endpoint(**request.params)
File “/odoo/odoo-server/odoo/http.py”, line 716, in route_wrapper
result = endpoint(self, *args, **params_ok)
File “/odoo/custom/addons/onlyoffice_odoo_documents/controllers/controllers.py”, line 50, in render_document_editor
return request.render(“onlyoffice_odoo.onlyoffice_editor”, self.prepare_document_editor(document_id, access_token))
File “/odoo/custom/addons/onlyoffice_odoo_documents/controllers/controllers.py”, line 67, in prepare_document_editor
return self.prepare_editor_values(attachment, access_token, True)
File “/odoo/custom/addons/onlyoffice_odoo/controllers/controllers.py”, line 127, in prepare_editor_values
path_part = str(data[“id”]) + “?oo_security_token=” + security_token + (“&access_token=” + access_token if access_token else “”)
TypeError: can only concatenate str (not “bytes”) to str

На сервере Onlyoffice ошибок нет.
Подскажите, в чем может быть проблема?