This question has been flagged
5 Replies
57026 Views

Hi u all!

I'm trying to install openerp in a server which is running a mysql DB.

When I'm installing it, it appears a list of errors and i supose it's because of my existing DB. Can i do something to fix it or cannot i use my existing DB?

OpenERP Server Error

Traceback (most recent call last): File "/opt/openerp/v7/web/addons/web/http.py", line 204, in dispatch response["result"] = method(self, **self.params) File "/opt/openerp/v7/web/addons/web/controllers/main.py", line 774, in create params['create_admin_pwd']) File "/opt/openerp/v7/web/addons/web/session.py", line 30, in proxy_method result = self.session.send(self.service_name, method, *args) File "/opt/openerp/v7/web/addons/web/session.py", line 103, in send raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)

Server Traceback (most recent call last): File "/opt/openerp/v7/web/addons/web/session.py", line 89, in send return openerp.netsvc.dispatch_rpc(service_name, method, args) File "/opt/openerp/v7/server/openerp/netsvc.py", line 296, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "/opt/openerp/v7/server/openerp/service/web_services.py", line 122, in dispatch return fn(params) File "/opt/openerp/v7/server/openerp/service/web_services.py", line 167, in exp_create_database self._create_empty_database(db_name) File "/opt/openerp/v7/server/openerp/service/web_services.py", line 136, in _create_empty_database cr.execute("""CREATE DATABASE "%s" ENCODING 'unicode' TEMPLATE "%s" """ % (name, chosen_template)) File "/opt/openerp/v7/server/openerp/sql_db.py", line 161, in wrapper return f(self, *args, *kwargs) File "/opt/openerp/v7/server/openerp/sql_db.py", line 226, in execute res = self._obj.execute(query, params) DataError: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII) HINT: Use the same encoding as in the template database, or use template0 as template.

Thank you very much

Avatar
Discard
Best Answer

I copy-paste solution from Tauras link.

 

In console run psql:

sudo -u postgres psql postgres

then in psql console execute sequence of commands:

 

update pg_database set datallowconn = TRUE where datname = 'template0';
\c template0
update pg_database set datistemplate = FALSE where datname = 'template1';
drop database template1;
create database template1 with template = template0 encoding = 'UTF8';
update pg_database set datistemplate = TRUE where datname = 'template1';
\c template1
update pg_database set datallowconn = FALSE where datname = 'template0';

(press Ctrl-D to quit from psql)

 

 

Avatar
Discard

Thanks it's worked for me.

Best Answer

Check this out. It helped me http://www.openerp.bg/%D0%B1%D0%BB%D0%BE%D0%B3/item/163-%D0%BF%D1%80%D0%BE%D0%BC%D1%8F%D0%BD%D0%B0-%D0%BD%D0%B0-postgresql-default-template0-%D0%BD%D0%B0-utf8-encoding

Avatar
Discard

Above blog worked for me. Thank Tauras.

Best Answer

Check the following PR to documentation for odoo:

https://github.com/odoo/odoo/pull/18145/files

Avatar
Discard
Best Answer

Hi,

Thanks for the post this solution.

But, what's the origin of this problem?

I've reviewed into odoo code and they use postgresql template1 for createdb porpuse.

Then, is it a bug of odoo? or is a misconfiguration introduced by system's locale? or is a postgresql default configuration?

I'll appreciate your response.

-Joaquin

Avatar
Discard