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

  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 ошибок нет.
Подскажите, в чем может быть проблема?

На сервере ODOO попробовал отключить прокси - ничего не изменилось.

Hello @lx-nsk

Please note that official languages of this forum are English and Chinese, consider rewriting your post.


Version of Document Server can be found in the editor interface, for instance, by accessing it via integrated test example from Welcome Page. What is the installation type of Document Server - Docker, DEB/RPM packages, EXE/MSI?

Is there proxy in front of Document Server too? As I can see there is virtual path for Document Server is configured. Please consult with proxy configs that we suggest using if proxy is eventually used:

How can I rewrite post? Editing is not available. Only delete and create new?

Document server 7.2, deb package, without proxy.
ODOO server & Document server - different virtual machines Ubuntu 20.04 on same physical server.
Document server works fine with old release ODOO 16 Enterprise.
But it doesn’t work with ODOO 16 Enterprise build 2024-06-02, ODOO 17 Enterprise build 2023-12-31 and build 2024-06-02.
I’ve tried disabling proxy on ODOO server. Problem doesn’t depend from proxy.
I also tried it on clean installations ODOO specified builds immediately without proxy - the error is present. The connector modules are the latest.

This error on ODOO 16 EE:

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

And this on ODOO 17 EE:

500: Internal Server Error

Traceback (most recent call last):
File “/odoo/odoo-server/odoo/http.py”, line 1764, 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 1791, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File “/odoo/odoo-server/odoo/http.py”, line 1908, in dispatch
return self.request.registry[‘ir.http’]._dispatch(endpoint)
File “/odoo/odoo-server/odoo/addons/base/models/ir_http.py”, line 222, in _dispatch
result = endpoint(**request.params)
File “/odoo/odoo-server/odoo/http.py”, line 741, 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

Proxy doesn’t use.

There are error with Onlyoffice Document server 8.1.1.26 too…