Skip to Content
Odoo เมนู
  • ลงชื่อเข้าใช้
  • ทดลองใช้ฟรี
  • แอป
    การเงิน
    • ระบบบัญชี
    • ระบบการออกใบแจ้งหนี้
    • ระบบบัญชีรายจ่าย
    • ระบบการจัดการข้อมูลผ่านสเปรดชีต (BI)
    • เอกสาร
    • ระบบลงลายเซ็น
    การขาย
    • ลูกค้าสัมพันธ์
    • การขาย
    • POS ร้านค้า
    • POS ร้านอาหาร
    • ระบบสมัครสมาชิก
    • การเช่า
    การจัดการเว็บไซต์
    • เครื่องมือสร้างเว็บไซต์
    • ระบบการขายออนไลน์
    • บล็อก
    • ฟอรั่ม
    • ไลฟ์แชท
    • ระบบการอบรมออนไลน์
    ซัพพลายเชน
    • คลังสินค้า
    • ระบบการผลิต
    • PLM
    • ระบบการจัดซื้อ
    • การซ่อมบำรุง
    • ระบบจัดการคุณภาพ
    ทรัพยากรบุคคล
    • ข้อมูลพนักงาน
    • ระบบสรรหาบุคลากร
    • ระบบการลา
    • การประเมิน
    • ระบบการแนะนำพนักงาน
    • ระบบจัดการยานพาหนะ
    การตลาด
    • โซเชียลมาร์เก็ตติ้ง
    • การตลาดผ่านอีเมล
    • ระบบการตลาดผ่าน SMS
    • ระบบการจัดงานอีเวนต์
    • การตลาดแบบอัตโนมัติ
    • ระบบแบบสำรวจ
    การบริการ
    • โปรเจกต์
    • ระบบบันทึกเวลา
    • ระบบการจัดการบริการภาคสนาม
    • ระบบดูแลช่วยเหลือ
    • การวางแผน
    • การนัดหมาย
    ประสิทธิผล
    • ระบบแสดงความคิดเห็น
    • ระบบการอนุมัติ
    • ไอโอที
    • VoIP
    • คลังข้อมูล
    • WhatsApp
    แอปพลิเคชันของบุคคลที่สาม Odoo สตูดิโอ แพลตฟอร์มคลาวด์ของ Odoo
  • อุตสาหกรรม
    การค้าปลีก
    • ร้านขายหนังสือ
    • ร้านขายเสื้อผ้า
    • ร้านขายเฟอร์นิเจอร์
    • ร้านขายของชำ
    • ร้านขายฮาร์ดแวร์
    • ร้านขายของเล่น
    Food & Hospitality
    • บาร์และผับ
    • ร้านอาหาร
    • อาหารฟาสต์ฟู้ด
    • Guest House
    • ตัวแทนจำหน่ายเครื่องดื่ม
    • Hotel
    อสังหาริมทรัพย์
    • Real Estate Agency
    • บริษัทสถาปัตยกรรม
    • บริษัทรับเหมา
    • การจัดการอสังหาริมทรัพย์
    • การจัดสวน
    • สมาคมเจ้าของอสังหาริมทรัพย์
    ปรึกษา
    • สำนักงานบัญชี
    • Odoo พาร์ทเนอร์
    • เอเจนซี่การตลาด
    • สำนักงานกฎหมาย
    • บริการสรรหาบุคลากร
    • การตรวจสอบและการรับรอง
    ระบบการผลิต
    • Textile
    • เหล็ก
    • เฟอร์นิเจอร์
    • อาหาร
    • Brewery
    • ของขวัญขององค์กร
    สุขภาพ & ฟิตเนส
    • ชมรมกีฬา
    • ร้านขายแว่นตา
    • ฟิตเนส
    • ผู้ประกอบวิชาชีพด้านสุขภาพ
    • ร้านขายยา
    • ร้านทำผม
    Trades
    • ช่างซ่อม
    • ฮาร์ดแวร์และการสนับสนุนด้านไอที
    • ระบบพลังงานแสงอาทิตย์
    • ช่างทำรองเท้า
    • บริการทำความสะอาด
    • HVAC Services
    อื่น ๆ
    • Nonprofit Organization
    • สำนักงานสิ่งแวดล้อม
    • ร้านเช่าป้ายโฆษณา
    • การถ่ายภาพ
    • ร้านเช่าจักรยาน
    • ตัวแทนจำหน่ายซอฟต์แวร์
    Browse all Industries
  • คอมมูนิตี้
    ศึกษา
    • บทเรียน
    • เอกสารกำกับโปรแกรม
    • การรับรอง
    • การฝึกอบรม
    • บล็อก
    • พอดแคสต์
    เพิ่มศักยภาพให้กับการศึกษา
    • โปรแกรมการศึกษา
    • Scale Up! Business Game
    • เยี่ยมชม Odoo
    รับซอฟต์แวร์
    • ดาวน์โหลด
    • เปรียบเทียบรุ่น
    • เผยแพร่
    ทำงานร่วมกัน
    • Github
    • ฟอรั่ม
    • ระบบการจัดงานอีเวนต์
    • การแปล
    • ร่วมเป็นพาร์ทเนอร์
    • Services for Partners
    • ลงทะเบียนเพื่อสร้างบัญชีบริษัทของคุณ
    รับบริการ
    • ค้นหาพาร์ทเนอร์
    • ค้นหานักบัญชี
    • พบกับที่ปรึกษา
    • บริการติดตั้งระบบเพื่อใช้งาน
    • ข้อมูลอ้างอิงลูกค้า
    • การสนับสนุน
    • อัปเกรด
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    รับการสาธิต
  • ราคา
  • ช่วยเหลือ

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

  • ลูกค้าสัมพันธ์
  • e-Commerce
  • ระบบบัญชี
  • สินค้าคงคลัง
  • PoS
  • โปรเจกต์
  • MRP
All apps
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
ช่วยเหลือ

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

ติดตาม

รับการแจ้งเตือนเมื่อมีกิจกรรมในโพสต์นี้

คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
40618 มุมมอง
อวตาร
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
อวตาร
ละทิ้ง
Mathias Colpaert

I think the problem is in => db_password = False

Romuald Garibaldi
ผู้เขียน

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.

อวตาร
Ivan
คำตอบที่ดีที่สุด

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
อวตาร
ละทิ้ง
อวตาร
Kristof Hardy
คำตอบที่ดีที่สุด

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
อวตาร
ละทิ้ง
อวตาร
Hengky Zhang
คำตอบที่ดีที่สุด

check your postgre service is it running or not

 

0
อวตาร
ละทิ้ง
อวตาร
Romuald Garibaldi
ผู้เขียน คำตอบที่ดีที่สุด

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
อวตาร
ละทิ้ง
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!

สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!

ลงชื่อ
คอมมูนิตี้
  • บทเรียน
  • เอกสารกำกับโปรแกรม
  • ฟอรั่ม
โอเพนซอร์ส
  • ดาวน์โหลด
  • Github
  • Runbot
  • การแปล
บริการ
  • โฮสติ้ง odoo.sh เซิร์ฟเวอร์
  • การสนับสนุน
  • อัปเกรด
  • การพัฒนาที่กำหนดเอง
  • การศึกษา
  • ค้นหานักบัญชี
  • ค้นหาพาร์ทเนอร์
  • ร่วมเป็นพาร์ทเนอร์
เกี่ยวกับเรา
  • บริษัทของเรา
  • ทรัพย์สินในรูปของเครื่องหมายการค้า
  • ติดต่อเรา
  • งาน
  • ระบบการจัดงานอีเวนต์
  • พอดแคสต์
  • บล็อก
  • ลูกค้า
  • กฎหมาย • ความเป็นส่วนตัว
  • ความปลอดภัย
الْعَرَبيّة 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 เป็นชุดแอปธุรกิจแบบเปิดที่ครอบคลุมทุกความต้องการของบริษัทของคุณ อาธิ CRM eCommerce ระบบบัญชี ระบบสินค้าคงคลัง ระบบการขายหน้าร้าน โปรเจกต์ และ อีกมากมาย

ความเหนือกว่าอันเป็นเอกลักษณ์ของ 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