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

На сервере 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…

Hello @lx-nsk
If you don’t mind, I will join this thread too.
Please clarify your current connector app version, reproduce the situation and provide us with entire Document server logs folder. We need to take a look at them. It’s located here:
docker - /app/onlyoffice/DocumentServer/logs/documentserver/
packages - /var/log/onlyoffice/documentserver/

By the way, please show us if there’s any pop-up error message in the browser itself

Hi

Today I installed a clean ODOO 16 Community without proxy. I install ODOO using a script similar to this one: GitHub - Yenthe666/InstallScript: Odoo install script , so the ODOO build is always the latest. Of course, I admit that there may be errors in it, and therefore I periodically reinstall the test VM with the new ODOO build and repeat testing modules on it.
OnlyOffice document server now is v.8.1.1.26 without proxy.
For today I have the following:
I tried the onlyoffice_odoo v.2.0.0 module on my new ODOO installation.
The IP address of the document server and the JWT key are normally accepted in the module settings, but when I try to open the file attached to the message, I get error 500.
Here is the link to the screenshot: https://disk .yandex.ru/i/jM0A_5y3qd-vZg
and here is the link to the odoo server log screenshot: odoo16ce_error_connector_2_0_0.png — Яндекс Диск

Ater that I tried with onlyoffice_odoo v.3.0.0 module. I get an validation error “Error when trying to check CommandService” already when setting up document server IP and JWT key. This link to error screenshot: odoo16ce_error_screen_connector_3_0_0.png — Яндекс Диск
and this link to ODOO error log screenshot:odoo16ce_error_connector_3_0_0.png — Яндекс Диск

This link to document server logs archive: documentserver_logs.tar.gz — Яндекс Диск

On old build ODOO 16 Community (december 2023) upgraded to Enterprise OnlyOffice modules works fine (v.2.0.0 & v.3.0.0)

Hello @lx-nsk
Sorry for the late reply.
The provided logs contain such error entries:

[2024-08-05T05:39:46.535] [ERROR] [localhost] [docId] [userId] nodeJS - [AMQP] Error: connect ECONNREFUSED 127.0.0.1:5672
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16)

It seems that something goes wrong with RabbitMQ service. Please check that service is running (service rabbitmq-server status) and double-check that 5672 port isn’t occupied by another app.

P.S. One more thing. Do I understand that you’re using not official method for Odoo installation?

Hi
I don’t think the reason for the error is in RabbitMQ. With another earlier ODOO 16 installation, everything works fine.
RabbitMQ runs as single process. There is a message in RabbitMQ status: “rabbitMQ-server.service: Supervising process 652532 which is not our child. We’ll most likely not notice when it exits”. Process 652532 is a beam.smp.

The script I use to install ODOO is essentially a list of commands used for manual installation. At the same time, the last night build is installed. That’s why I admit that there may have been some changes that are not compatible with Onlyoffice modules or even errors in ODOO. Once a week I try to install a fresh build and check the operation of Onlyoffice modules in it.

When comparing the ODOO code of the old build and the latest one, I did not find any errors that could affect the performance of the Onlyoffice modules.

Hello again @lx-nsk

Let’s do a sum up. On which versions right now you are facing this issue? Please let us know in which environment this issue reproduces - which edition of Odoo, its version, version of Document Server and versions of used modules.

In general, opening any attachment results in error 500 (TypeError: can only concatenate str (not “bytes”) to str)?

Hello
ODOO 16 EE buld 20240602 without proxy
onlyoffice-odoo modules v.2.0.0 & v.3.0.0 too
Document server v.8.1.1.26 without proxy

Yes

Thank you for the info. We are running additional checks to reproduce the issue and analyze it.

Hello again @lx-nsk

Once again thanks for sharing the details. We were able to reproduce the issue when opening attachments. It was registered a bug fro further analysis and resolution.

I will inform you once it is resolved. Sorry for any inconvenience.