This question has been flagged
1 Reply
2661 Views

Hello there! 

I have created docker images for postgres and for odoo according for the 10.0 branch of odoo. 

https://hub.docker.com/_/odoo/
However when i try to specify $>odoo -d test -i calendar 

The server for web and postgres is separated to two images, i have tried to get information of how the -d command should be specified without success.

I know that you can install over webinterface / gui but that is not my aim here. 

I will get: 

odoo@c6c24edb3363:/$ odoo -d test -i calendar
Traceback (most recent call last):
  File "/usr/bin/odoo", line 9, in <module>
    odoo.cli.main()
  File "/usr/lib/python2.7/dist-packages/odoo/cli/command.py", line 64, in main
    o.run(args)
  File "/usr/lib/python2.7/dist-packages/odoo/cli/server.py", line 175, in run
    main(args)
  File "/usr/lib/python2.7/dist-packages/odoo/cli/server.py", line 140, in main
    odoo.service.db._create_empty_database(db_name)
  File "/usr/lib/python2.7/dist-packages/odoo/service/db.py", line 79, in _create_empty_database
    with closing(db.cursor()) as cr:
  File "/usr/lib/python2.7/dist-packages/odoo/sql_db.py", line 635, in cursor
    return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
  File "/usr/lib/python2.7/dist-packages/odoo/sql_db.py", line 177, in __init__
    self._cnx = pool.borrow(dsn)
  File "/usr/lib/python2.7/dist-packages/odoo/sql_db.py", line 518, in _locked
    return fun(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/odoo/sql_db.py", line 586, in borrow
    **connection_info)
  File "/usr/lib/python2.7/dist-packages/psycopg2/__init__.py", line 164, in connect
    conn = _connect(dsn, connection_factory=connection_factory, async=async)
psycopg2.OperationalError: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
And from server side:
2018-08-09 08:49:44,406 39 INFO ? odoo.sql_db: Connection to the database failed
2018-08-09 08:49:48,011 44 INFO ? odoo: database: default@default:default
Avatar
Discard
Best Answer

You are facing the error because postgres is not installed in your local and you didn't link Odoo and Postgres instance together.


You can do it by passing "db_host = IP / Domain" parameters in odoo configuration file to connect Odoo instance with Database instance.


If you are not using configuration file then pass "--db-host=IP / Domain" parameter when you run the server manually.

Check another answer on database connection

Avatar
Discard