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

ERROR SQL Connection (bad user)

By
cere
on 4/19/13, 4:19 AM 5,850 views

Hi, I am starting to use OpenERP in my Linux Ubunutu, everything works fine until when any user is trying to access via web:

victor@victor-VirtualBox:~$ /opt/openerp/server/openerp-server 
2013-04-19 05:55:47,684 2439 INFO ? openerp: OpenERP version 7.0-20130417-232500
2013-04-19 05:55:47,684 2439 INFO ? openerp: addons paths: /opt/openerp/server/openerp/addons
2013-04-19 05:55:47,684 2439 INFO ? openerp: database hostname: localhost
2013-04-19 05:55:47,684 2439 INFO ? openerp: database port: 5432
2013-04-19 05:55:47,684 2439 INFO ? openerp: database user: victor
2013-04-19 05:55:48,083 2439 INFO ? openerp.addons.google_docs.google_docs: GData lib version `%s GData-Python/2.0.17` detected
2013-04-19 05:55:48,406 2439 INFO ? openerp.service.wsgi_server: HTTP service (werkzeug) running on 0.0.0.0:8069
2013-04-19 05:55:48,407 2439 INFO ? openerp: OpenERP server is running, waiting for connections...
2013-04-19 05:56:00,787 2439 ERROR ? openerp.sql_db: Connection to the database failed
Traceback (most recent call last):
  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:  role "victor" does not exist

And the file /etc/openerp-server.config :

; This is the password that allows database operations:
; admin_passwd = admin
db_host = False
db_port = False
db_user = openerp
db_password = demo

So, my question is: the openerp-server.config is configured as user 'openerp', why the openerp-server is tryng to connect the database using the role 'victor'?

Many thanks to take some minutes to read this.

Regards.

1

Naresh Soni (nch)

--Naresh Soni (nch)--
Tiny ERP Pvt Ltd
http://www.odoo.com
1281
| 2 2 4
India
--Naresh Soni (nch)--

Team Lead, Odoo(Formerly OpenERP) Support & OPW

Naresh Soni (nch)
On 4/19/13, 6:58 AM

Hi Cere,

You need to create a postgres user "victor" as the config file that is used by OpenERP doesn't have db_user set, either set the correct config file or create the user 'victor'.

Refer:HOW TO CREATE POSTGRES USER

Thanks,

0

Daniel Reis

--Daniel Reis--
3436
| 6 7 9
Lisbon, Portugal
--Daniel Reis--

Author of the "Odoo Development Essentials" book.

Applications Manager at Securitas Portugal

Github: https://github.com/dreispt

Twitter; @reis_pt


Daniel Reis
On 4/19/13, 5:43 AM

The server is not using that conf file. probably because its name .config instead of .conf. Try:

/opt/openerp/server/openerp-server --config=/etc/openerp-server.config
0
cere
On 4/19/13, 6:17 AM

Daniel, you're right, but I was wrong typing the question, the real path is:

/etc/openerp-server.conf

So, as you know, the problem is still persists......

I do not understant because I cannot find anywhere the line: "db_user = victor" that OpenERP tries to connect with 'victor' role (I was looking with this command: sudo grep -lir "db_user = victor" /etc, and /opt/openerp/server without results)

So, where did OpenERP gets 'victor' role from?


Thanks Naresh, but I want to use 'openerp' user, described in /etc/openerp-server-conf and this user exists in postgres:

postgres=# \du
                             List of roles
 Role name |                   Attributes                   | Member of 
-----------+------------------------------------------------+-----------
 openerp   | Superuser, Create role, Create DB, Replication | {}
 openerp80 | Superuser, Create role, Create DB, Replication | {}
 postgres  | Superuser, Create role, Create DB, Replication | {}

Thanks.

Try one thing. start your server with db_user=openerp and see if it works then there is some problem in finding the correct config file.

Naresh Soni (nch)
on 4/19/13, 8:37 AM

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: 4/19/13, 4:19 AM
Seen: 5850 times
Last updated: 3/16/15, 8:10 AM