Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Discuss
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

[V8] [solved] Why does the connection to the database fail with Ubuntu 14.04?

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
4 Replies
40611 Tampilan
Avatar
Romuald Garibaldi

Hi all.

I use Ubuntu 14.04 amd64, postgresql-9.3.5 (installed from graphical installer) and Odoo8.0 (download from github.com).

There is an "Internal Server Error" when I try to display the webpage http://localhost:8069/ because the "Connection to the database failed".

This is the beginning of the /var/log/odoo/odoo-server.log file:

2015-02-07 17:01:47,208 8032 INFO ? openerp.service.server: Initiating shutdown
2015-02-07 17:01:47,209 8032 INFO ? openerp.service.server: Hit CTRL-C again or send a second signal to force the shutdown.
2015-02-07 17:01:49,725 8147 INFO ? openerp: OpenERP version 8.0
2015-02-07 17:01:49,725 8147 INFO ? openerp: addons paths: ['/opt/odoo/.local/share/Odoo/addons/8.0', u'/opt/odoo/odoo-server/addons', u'/opt/odoo/custom/addons', '/opt/odoo/odoo-server/openerp/addons']
2015-02-07 17:01:49,725 8147 INFO ? openerp: database hostname: localhost
2015-02-07 17:01:49,725 8147 INFO ? openerp: database port: 5432
2015-02-07 17:01:49,725 8147 INFO ? openerp: database user: odoo
2015-02-07 17:01:50,154 8147 INFO ? openerp.service.server: HTTP service (werkzeug) running on 0.0.0.0:8069
2015-02-07 17:01:58,203 8147 INFO ? openerp.addons.bus.bus: Bus.loop listen imbus on db postgres
2015-02-07 17:01:58,207 8147 ERROR ? openerp.sql_db: Connection to the database failed
Traceback (most recent call last):
  File "/opt/odoo/odoo-server/openerp/sql_db.py", line 522, 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: could not connect to server: Aucun fichier ou dossier de ce type
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

The Odoo configuration file (/etc/odoo-server.conf) is:

[options]
; This is the password that allows database operations:
admin_passwd = my_odoo_password
db_host = False
db_port = 5432
db_user = odoo
db_password = False
addons_path = /usr/lib/python2.7/dist-packages/openerp/addons
logfile = /var/log/odoo/odoo-server.log
addons_path=/opt/odoo/odoo-server/addons,/opt/odoo/custom/addons

In order to install and configure the softwares, I used a modified version of the André Schenkels' script:

https://github.com/aschenkels-ictstudio/openerp-install-scripts/blob/master/odoo-v8/ubuntu-14-04/odoo_install.sh

I modified it to use a different version of postgresql (the apt postgresql postgresqlpackages did not work).

Could somebody help me please?

0
Avatar
Buang
Mathias Colpaert

I think the problem is in => db_password = False

Romuald Garibaldi
Penulis

Mathias Colpaert: Hi. I had already tried to change this parameter like this : "db_password = PasswordGivenDuringPostgresqlInstallation", but the result (/var/log/odoo/odoo-server.log) was the same.

Avatar
Ivan
Jawaban Terbai

First thing to check: You specify db_host as False.  That will cause OpenERP/Odoo to connect using UNIX socket (local) procotocol instead of TCP/IP (host).  So check the /etc/postgresql/XX/main/pg_hba.conf what is the authentication rule for local (if any specifically for the database you are connecting to and/or for user odoo, XX is the version of PostgreSQL).  There are a lot of authentication rule possibilities, you can read more about it from PostgreSQL's documentation, but some of the more commonly used one are:

  • peer: this means only Operating System user with matching Database user (so in your case only if the OS user is odoo) are allowed to connect.  ident have the same meaning for TCP/IP connection.
  • md5: password authentication (you need to specify any Database user along with the password to connect)
  • trust: allow any connection (not recommended)

Adjust the setting accordingly, restart PostgreSQL, restart Odoo/OpenERP and try again.

You need a sudo access to change the setting.

 

3
Avatar
Buang
Avatar
Kristof Hardy
Jawaban Terbai

First of all, I suggest using the install script as is, without  modifying it. (then you would not have this problem, you can always install a different version of PostgreSQL later)

A default pg_hba.conf looks like this, you should not need to change this:

local   all             postgres                                peer
local   all             all                                     peer
host    all             all             127.0.0.1/32            md5
host    all             all             ::1/128                 md5

A example of odoo database settings:

; Database settings
db_user = odoo
db_password = odoo_user_password
db_port = 5432
db_host = localhost
db_maxconn = 64
dbfilter = .*

 

1
Avatar
Buang
Avatar
Hengky Zhang
Jawaban Terbai

check your postgre service is it running or not

 

0
Avatar
Buang
Avatar
Romuald Garibaldi
Penulis Jawaban Terbai

I cannot comment your messages because "30 karma is required to perform this action"… Therefore I edit this message for answer to Hengky Zhang and Ivan. Sorry.

Hi Hengky Zhang.
postgres is running. htop displays:

PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
 1156 postgres   20   0  199M 11052 10940 S  0.0  0.4  0:00.04 ├─ /opt/PostgreSQL/9.3/bin/postgres -D /opt/PostgreSQL/9.3/data
 1195 postgres   20   0 60260   400   272 S  0.0  0.0  0:00.06 │  ├─ postgres: stats collector process
 1194 postgres   20   0  200M   880   656 S  0.0  0.0  0:00.09 │  ├─ postgres: autovacuum launcher process
 1193 postgres   20   0  199M   304   248 S  0.0  0.0  0:00.10 │  ├─ postgres: wal writer process
 1192 postgres   20   0  199M  1116  1044 S  0.0  0.0  0:00.10 │  ├─ postgres: writer process
 1191 postgres   20   0  199M   260   192 S  0.0  0.0  0:00.00 │  ├─ postgres: checkpointer process
 1175 postgres   20   0 58168   172   156 S  0.0  0.0  0:00.00 │  └─ postgres: logger process

-------------------------------------------

Hi Ivan. /opt/PostgreSQL/9.3/data/pg_hba.conf contains:

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     md5
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                md5
#host    replication     postgres        127.0.0.1/32            md5
#host    replication     postgres        ::1/128                 md5

I can change the /etc/odoo-server.conf file like this:

[...]

db_password = PasswordGivenToPostgresqlDuringInstallation

[…]

I'm going to read this page carefully: http://www.postgresql.org/docs/9.3/static/auth-pg-hba-conf.html

The solution is near…

-------------------------

I read carefully the auth-pg-hba-conf.html webpage, set pg_hba.conf and restarted postgresql then odoo, but I still have the same server error described in my first message.

As regards pg_hba.conf, I tried this:

local   all             all                             peer

then this:

host    all              all             127.0.0.1/32           ident

… but it failed every time. :(

When I add a password to odoo user like this:

ALTER ROLE odoo WITH PASSWORD odoo_user_password_for_postgresql

… and then I modify /etc/odoo-server.conf consequently:

db_password = odoo_user_password_for_postgresql

… before trying different configurations for pg_hba.conf, it fails again.

-----------------------------

Kristof Hardy:
I changed:
    db_host = False
    db_password = False
… by:
    db_host = localhost
    db_password = odoo_user_password
… in /etc/odoo-server.conf, then I added a odoo password to postgresql from psql like this:
    ALTER ROLE odoo WITH PASSWORD 'odoo_user_password';
At last I set /opt/PostgreSQL/9.3/data/pg_hba.conf as you recommended:
    local   all             postgres                                peer
    local   all             all                                     peer
    host    all             all             127.0.0.1/32            md5
    host    all             all             ::1/128                 md5

It works! :) At last! Great!

Thank everybody to have helped me, especially Kristof Hardy and Ivan.

0
Avatar
Buang
Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now