Error al crear la primera base de datos en odoo

6,432 views
Skip to first unread message

Raúl González

unread,
Aug 6, 2014, 4:09:24 PM8/6/14
to openerp-s...@googlegroups.com
Buenas!!!!

Soy novato en este universo de Odoo y lo acabo de instalar por primera vez.. Al abrir el navegador me sale la ventana para crear la base de datos con la que trabajar. Tengo entendido que la masterpassword por defecto es admin. Relleno el resto de campos para crear la base de datos y al dar a "Create database" me aparece el siguiente error: 
Traceback (most recent call last):
  File "/home/raul/odoo/openerp/http.py", line 476, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/raul/odoo/openerp/http.py", line 495, in dispatch
    result = self._call_function(**self.params)
  File "/home/raul/odoo/openerp/http.py", line 312, in _call_function
    return self.endpoint(*args, **kwargs)
  File "/home/raul/odoo/openerp/http.py", line 685, in __call__
    return self.method(*args, **kw)
  File "/home/raul/odoo/openerp/http.py", line 360, in response_wrap
    response = f(*args, **kw)
  File "/home/raul/odoo/openerp/addons/web/controllers/main.py", line 729, in create
    params['create_admin_pwd'])
  File "/home/raul/odoo/openerp/http.py", line 759, in proxy_method
    result = dispatch_rpc(self.service_name, method, args)
  File "/home/raul/odoo/openerp/http.py", line 93, in dispatch_rpc
    result = dispatch(method, params)
  File "/home/raul/odoo/openerp/service/db.py", line 70, in dispatch
    return fn(*params)
  File "/home/raul/odoo/openerp/service/db.py", line 87, in exp_create_database
    _create_empty_database(db_name)
  File "/home/raul/odoo/openerp/service/db.py", line 82, in _create_empty_database
    cr.execute("""CREATE DATABASE "%s" ENCODING 'unicode' TEMPLATE "%s" """ % (name, chosen_template))
  File "/home/raul/odoo/openerp/sql_db.py", line 155, in wrapper
    return f(self, *args, **kwargs)
  File "/home/raul/odoo/openerp/sql_db.py", line 230, in execute
    res = self._obj.execute(query, params)
ProgrammingError: permission denied to create database

alguien me puede arrojar un poco de luz sobre este error? o algun enlace o manual donde ponga como poder corregirlo?

Muchas gracias por adelantado.

Un saludo

cubells

unread,
Aug 6, 2014, 4:19:49 PM8/6/14
to openerp-s...@googlegroups.com
El 06/08/14 a les 22:09, Raúl González ha escrit:
El usuario con el que intentas crear la base de datos no tiene permisos
en postgres para crear bases de datos.

Comrpueba los datos que pones.



--
Atentament, cubells.
--

Raúl González

unread,
Aug 6, 2014, 5:01:59 PM8/6/14
to openerp-s...@googlegroups.com
Como puedo dar permisos o comprobar el usuario con el que la estoy intentando crear? lo digo porque al hacerlo desde la interfaz de odoo, no en postgres, no puedo elegir el usuario con el que lo creo. Solo me pide la contraseña del superusuario (admin por defecto) y el nombre de la bbdd y la contraseña con la que quiero crearlo.
¿se podria hacer por terminal con comandos?

Un saludo




--
Has recibido este mensaje porque estás suscrito a un tema del grupo "Usuarios OpenERP en España" de Grupos de Google.
Para anular la suscripción a este tema, visita https://groups.google.com/d/topic/openerp-spain-users/eSfg25-zr1k/unsubscribe.
Para anular la suscripción a este grupo y a todos sus temas, envía un correo electrónico a openerp-spain-users+unsub...@googlegroups.com.
Para obtener más opciones, visita https://groups.google.com/d/optout.

cubells

unread,
Aug 7, 2014, 5:17:07 AM8/7/14
to openerp-s...@googlegroups.com
El 06/08/14 a les 23:01, Raúl González ha escrit:
> Como puedo dar permisos o comprobar el usuario con el que la estoy
> intentando crear? lo digo porque al hacerlo desde la interfaz de odoo,
> no en postgres, no puedo elegir el usuario con el que lo creo. Solo me
> pide la contraseña del superusuario (admin por defecto) y el nombre de
> la bbdd y la contraseña con la que quiero crearlo.
> ¿se podria hacer por terminal con comandos?
>


Es que depende de cómo lo tengas configurado.

Yo lo que hago es mirar qué fichero de configuración carga al arrancar
odoo, por ejemplo:

$ ps aux | grep openerp-
vicent 8308 1.4 0.3 38568 27640 pts/3 D+ 11:13 0:00 python
openerp-server -c ../configuracions/openerp-server.conf

Entonces en el fichero ../configuracions/openerp-server.conf en mi caso,
especifica qué usuario y con qué contraseña se accede.

Para crear un usuario en postgres, ejecuto:

$ sudo -u postgres createuser -s nombre_de_usuario

y le asigno permisos sobre la base de datos y su contraseña.

Vamos, lo normal.

--
Atentament, cubells.
--

Raúl González

unread,
Aug 7, 2014, 5:58:12 PM8/7/14
to openerp-s...@googlegroups.com
Buenas Cubells,

He probado con el comando que me has comentado pero con openerp solo me aparecen corriendo:

raul      4197  0.0  1.6 142444 29688 pts/4    Sl+  18:18   0:13 python ./openerp-server
postgres 10484  0.0  0.0   5920   796 pts/0    S+   23:41   0:00 grep --colour=auto openerp

Cuando iintento crear la bbdd en odoo, si meto el master password "admin" es cuando me aparece el error:


 File "/home/raul/odoo/openerp/sql_db.py", line 230, in execute
    res = self._obj.execute(query, params)
ProgrammingError: permission denied to create database

Sin embargo si meto cualquier otro master password, el error es:

 File "/home/raul/odoo/openerp/service/security.py", line 33, in check_super
    raise openerp.exceptions.AccessDenied()
AccessDenied: Access denied.

Por lo que entiendo que el master password es correcto. Me faltaria añadirle los permisos necesarios para poderlo crear.
Tambien he leido por ahi que hay que modificar en postgre el archivo de configuracion pg_hba.conf para poder restablecer la contraseña maestra de la base de datos, pero no termino de conseguirlo. He cambiado la linea donde ponia md5 por "trust", pero sigo sin pasar del error:

local   all         postgres  trust

Igual son preguntas muy obvias, pero no consigo crear la primera base de datos en odoo y con ello acceder a la interfaz web.

Espero que me podais ayudar.
Gracias y un saludo!


Pedro Manuel Baeza Romero

unread,
Aug 8, 2014, 6:00:21 AM8/8/14
to openerp-s...@googlegroups.com
Buenas, Raúl,

Te está ocurriendo que llamas a openerp-server sin ningún archivo de configuración, por lo que coge los valores por defecto para todo, incluido el usuario y contraseña de Postgres. Lo primero, vuelve a poner md5 en la configuración de Postgres (y reinicia servicio). Créate un usuario postgres correctamente con esto:

sudo su postgres
createuser --createdb --no-createrole --no-superuser --pwprompt openerp7

Y cuando te lo pida, ponle una contraseña. Y por último, crea el archivo openerp-server.conf correctamente con este usuario y contraseña, y pásale el parámetro --config=<ruta del conf> al servidor.

Un saludo.





--
Has recibido este mensaje porque estás suscrito al grupo "Usuarios OpenERP en España" de Grupos de Google.
Para anular la suscripción a este grupo y dejar de recibir sus mensajes, envía un correo electrónico a openerp-spain-u...@googlegroups.com.
Para acceder a más opciones, visita https://groups.google.com/d/optout.

Raúl González

unread,
Aug 9, 2014, 6:07:43 AM8/9/14
to openerp-s...@googlegroups.com
Ya que no tengo creado el archivo de configuracion, me podriais pegar el contenido exacto que debería tener ese fichero asi como la ruta donde debe guardarse?
En mi caso tengo el server instalado en mi pc en local. 
Cuando ejecuto la instruccion anterior para crear el usuario (createuser xxxxx) me dice:
createuser: creation of new role failed: ERROR: role "openerp7" already exists...

Un saludo!

Pedro Manuel Baeza Romero

unread,
Aug 9, 2014, 5:13:56 PM8/9/14
to openerp-s...@googlegroups.com
Buenas, Raúl, es que ese archivo depende de tu configuración concreta (usuario BD, rutas, etc), pero aquí tienes un archivo de ejemplo.

Un saludo.


--
odoo-server.conf

Paul Orellana

unread,
Aug 10, 2014, 1:40:50 AM8/10/14
to openerp-s...@googlegroups.com
Raul
Vuelve a empezar de cero siguiendo todos estos pasos para instalar odoo

1) Install Ubuntu 14.04

2) open a terminal

3) sudo apt-get update

4) sudo apt-get install git

5) apt-get install postgresql

6) sudo su - postgres -c "createuser -s openerp" 2> /dev/null || true

7) sudo apt-get install python-dateutil python-feedparser python-gdata python-ldap \ python-libxslt1 python-lxml python-mako python-openid python-psycopg2 \ python-pybabel python-pychart python-pydot python-pyparsing python-reportlab \ python-simplejson python-tz python-vatnumber python-vobject python-webdav \ python-werkzeug python-xlwt python-yaml python-zsi python-docutils \ python-psutil wget python-unittest2 python-mock python-jinja2

8) sudo apt-get install python-dev libpq-dev

9) sudo apt-get install poppler-utils

10) sudo apt-get install python-pdftools

11) sudo apt-get install antiword

12) sudo mkdir /opt/odoo

13) cd /opt/odoo

14) sudo git clone https://github.com/odoo/odoo.git

15) cd ~/

16) wget http://gdata-python-client.googlecode.com/files/gdata-2.0.18.tar.gz

17) tar zxvf gdata-2.0.18.tar.gz

18) cd gdata-2.0.18/

19) sudo python setup.py install

20) cd /opt/odoo

21) sudo apt-get install python-setuptools python-pybabel

22) sudo python setup.py install

23) sudo cp /opt/odoo/install/openerp-server.conf /etc/openerp-server.conf

24) sudo pico -w /etc/openerp-server.conf


delete default settings and add the following:


[options]

; This is the password that allows database operations:

; admin_passwd = admin

; db_host = False

; db_port = False

; db_user = postgres

; db_password = admin


[options]

## Server startup config - Common options

# Admin password for creating, restoring and backing up databases

admin_passwd = admin

# specify additional addons paths (separated by commas)

addons_path = /opt/odoo/addons

## XML-RPC / HTTP - XML-RPC Configuration

# disable the XML-RPC protocol

xmlrpc = True

# Specify the TCP IP address for the XML-RPC protocol. The empty string binds to all interfaces.

xmlrpc_interface = 127.0.0.1

# specify the TCP port for the XML-RPC protocol

xmlrpc_port = 8069

# Enable correct behavior when behind a reverse proxy

proxy_mode = True

## XML-RPC / HTTPS - XML-RPC Secure Configuration

# disable the XML-RPC Secure protocol

xmlrpcs = True

# Specify the TCP IP address for the XML-RPC Secure protocol. The empty string binds to all interfaces.

xmlrpcs_interface =

# specify the TCP port for the XML-RPC Secure protocol

xmlrpcs_port = 8071

# specify the certificate file for the SSL connection

secure_cert_file = server.cert

# specify the private key file for the SSL connection

secure_pkey_file = server.pkey

## NET-RPC - NET-RPC Configuration

# enable the NETRPC protocol

netrpc = False

# specify the TCP IP address for the NETRPC protocol

netrpc_interface = 127.0.0.1

# specify the TCP port for the NETRPC protocol

netrpc_port = 8070

## WEB - Web interface Configuration

# Filter listed database REGEXP

dbfilter = .*

## Static HTTP - Static HTTP service

# enable static HTTP service for serving plain HTML files

static_http_enable = False

# specify the directory containing your static HTML files (e.g '/var/www/')

static_http_document_root = None

# specify the URL root prefix where you want web browsers to access your static HTML files (e.g '/')

static_http_url_prefix = None

## Testing Group - Testing Configuration

# Launch a YML test file.

test_file = False

# If set, will save sample of all reports in this directory.

test_report_directory = False

# Enable YAML and unit tests.

test_disable = False

# Commit database changes performed by YAML or XML tests.

test_commit = False

## Logging Group - Logging Configuration

# file where the server log will be stored (default = None)

logfile = /var/log/openerp/openerp-server.log

# do not rotate the logfile

logrotate = True

# Send the log to the syslog server

syslog = False

# setup a handler at LEVEL for a given PREFIX. An empty PREFIX indicates the root logger. This option can be repeated. Example: "openerp.orm:DEBUG" or "werkzeug:CRITICAL" (default: ":INFO")

log_handler = ["[':INFO']"]

# specify the level of the logging. Accepted values: info, debug_rpc, warn, test, critical, debug_sql, error, debug, debug_rpc_answer, notset

#log_level = debug

log_level = info


25) sudo su postgres -c "createuser -s <your_ubuntu_username_here>"    Please simply insert your own ubuntu username in place of <your_ubuntu_username_here>

26) sudo ufw allow 80

27) sudo ufw allow 8072

28) sudo ufw allow 8069

29) cd /opt/odoo

30) ./openerp-gevent -c /etc/openerp-server.conf

31) Go to your browser and type in 127.0.0.1:8072 (this will run in 'Gevent' mode and allow you to use the live chat functionality)

32) Go back to terminal and type ifconfig to find your ubuntu install's IP address on the local network

33) Go to another computer and open a browser to the following page: http://<your-ubuntu-install's-ip-address-here>:8072



Paul Orellana
Ing. Industrial - Perú

Reply all
Reply to author
Forward
0 new messages