Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

The server throws an exception instead of displaying "database does not exist"

By
semah
on 10/18/13, 6:32 AM 1,122 views

Hello, I am using OpenERP 7 on ubuntu 12.04. I started the server with "list_db = False". It works fine : the menu list was changed by an input field. But when I write a name of database which does not exit, the server throws an exception instead of displaying a message : "database does not exit" for example. This is the text of the exception:

    Client Traceback (most recent call last): 

  File "/opt/openerp/web/addons/web/http.py", line 204, in dispatch  response["result"] = method(self, **self.params)  

     File "/opt/openerp/web/addons/web/controllers/main.py", line 867, in authenticate req.session.authenticate(db, login, password, env)   

    File "/opt/openerp/web/addons/web/session.py", line 115, in authenticate uid = self.proxy('common').authenticate(db, login, password, env)   

    File "/opt/openerp/web/addons/web/session.py", line 30, in proxy_method result = self.session.send(self.service_name, method, *args)   File "/opt/openerp/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/web/addons/web/session.py", line 89, in send return openerp.netsvc.dispatch_rpc(service_name, method, args)   File "/opt/openerp/server/openerp/netsvc.py", line 292, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) 

      File "/opt/openerp/server/openerp/service/web_services.py", line 433, in dispatch return fn(*params)   File "/opt/openerp/server/openerp/service/web_services.py", line 444, in exp_authenticate  res_users = pooler.get_pool(db).get('res.users')   

    File "/opt/openerp/server/openerp/pooler.py", line 49, in get_pool return get_db_and_pool(db_name, force_demo, status, update_module)[1]  File "/opt/openerp/server/openerp/pooler.py", line 33, in get_db_and_pool  registry = RegistryManager.get(db_name, force_demo, status, update_module)   

    File "/opt/openerp/server/openerp/modules/registry.py", line 192, in get update_module)   File "/opt/openerp/server/openerp/modules/registry.py", line 208, in new
        registry = Registry(db_name)   

    File "/opt/openerp/server/openerp/modules/registry.py", line 76, in __init__  cr = self.db.cursor()   

    File "/opt/openerp/server/openerp/sql_db.py", line 484, in cursor  return Cursor(self._pool, self.dbname, serialized=serialized)   

    File "/opt/openerp/server/openerp/sql_db.py", line 182, in __init__  self._cnx = pool.borrow(dsn(dbname))  

     File "/opt/openerp/server/openerp/sql_db.py", line 377, in _locked   return fun(self, *args, **kwargs)   File "/opt/openerp/server/openerp/sql_db.py", line 440, in borrow result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)   

    File "/usr/lib/python2.7/dist-packages/psycopg2/__init__.py", line 179, in connect connection_factory=connection_factory, async=async)

     OperationalError: FATAL:  database "db1" does not exist

no solution for this embarrassing bug ?????!!!!!!!!!?????!!!!!!!!

semah
on 10/18/13, 12:03 PM

This is normal, you must write a database already created.!!!

Borni DHIFI
on 10/19/13, 10:53 AM

salemou 3alaykom Borni, no no, the server must display a message "database does not exist" when the user enter a inexistent database name. It works fine on OpenERP 6 : see this : http://openerp-team.blogspot.com/2009/11/hiding-database-name-on-login.html

semah
on 10/19/13, 11:03 AM
0
semah
On 10/19/13, 9:31 PM

I have just located the cause of this bug . Please go to "web/addons/web/static/src/js/chrome.js: line 706 : you will see that the on_submit function has one " if " block to verify that the field of the database is not empty. The solution is to add a second " if " block to verify if the name entered is in the list of databases before calling the do_login(db, login, password) function Unfortunately I don't know JavaScript programming :( Someone helps me

always no response in this forum :/

semah
on 10/20/13, 7:58 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 10/18/13, 6:32 AM
Seen: 1122 times
Last updated: 3/16/15, 8:10 AM