View Revisions: Issue #467

Summary 0000467: Encoding issue with bytea field and PostgreSQL 11
Revision 2019-02-25 09:32 by administrator
Steps To Reproduce Odoo is using binary field to upload files:
https://github.com/odoo/odoo/blob/12.0/addons/base_import/models/base_import.py#L116

and psycopg2 store it in a bytea attribute:
https://github.com/odoo/odoo/blob/12.0/odoo/fields.py#L1768

Any uploaded file is not stored correctly in the database when using PGPool. If I connect Odoo directly to PostgreSQL, all my scenario work.

For example, when importing data from a csv file, the file is encoded and stored in the database.
Then the first lines get displayed for preview and column-to-field matching.
See screenshot attached below.

Another example I have is that the value of a bytea attribute is decoded and I get a "Invalid padding" error:
  File "/usr/lib64/python3.6/base64.py", line 87, in b64decode
    return binascii.a2b_base64(s)
binascii.Error: Incorrect padding
Revision 2019-02-20 14:06 by max3903
Steps To Reproduce Odoo is using binary field to upload files:
https://github.com/odoo/odoo/blob/12.0/addons/base_import/models/base_import.py#L116

and psycopg2 store it in a bytea attribute:
https://github.com/odoo/odoo/blob/12.0/odoo/fields.py#L1768

Any uploaded file is not stored correctly in the database when using PGPool. If I connect Odoo directly to PostgreSQL, all my scenario work.

For example, when importing data from a csv file, the file is encoded and stored in the database.
Then the first lines get displayed for preview and column-to-field matching.
See screenshot attached below.

Another example I have is that the value of a bytea attribute is decoded and I get a "Invalid padding" error:
  File "/usr/lib64/python3.6/base64.py", line 87, in b64decode
    return binascii.a2b_base64(s)
binascii.Error: Incorrect padding