コンテンツへスキップ
Odoo メニュー
  • サインイン
  • 無料で15日試す
  • アプリ
    財務
    • 会計
    • 請求
    • 経費
    • スプレッドシート(BI)
    • ドキュメント管理
    • 署名
    販売
    • CRM
    • 販売
    • POS店舗
    • POSレストラン
    • サブスクリプション
    • レンタル
    ウェブサイト
    • ウェブサイトビルダー
    • eコマース
    • ブログ
    • フォーラム
    • ライブチャット
    • eラーニング
    サプライチェーン
    • 在庫
    • 製造
    • 製品ライフサイクル管理 (PLM)
    • 購買
    • 整備
    • 品質
    人事業務
    • 従業員管理
    • 採用
    • 休暇管理
    • 人事評価
    • リファラル
    • フリート
    マーケティング
    • ソーシャルマーケティング
    • メールマーケティング
    • SMSマーケティング
    • イベント
    • マーケティングオートメーション
    • アンケート調査
    サービス
    • プロジェクト管理
    • タイムシート
    • フィールドサービス
    • ヘルプデスク
    • 計画
    • アポイントメント
    生産性向上ツール
    • ディスカッション
    • 承認
    • IoT
    • VoIP
    • ナレッジ
    • WhatsApp
    サードパーティアプリ Odooスタジオ Odooクラウドプラットホーム
  • インダストリー(業種別ソリューション)
    小売
    • 書店
    • アパレルショップ
    • 家具専門店
    • 食料品店
    • 金物店
    • 玩具店
    飲食・ホスピタリティ業界
    • バー・パブ
    • レストラン
    • ファストフード
    • ゲストハウス
    • 飲料販売代理店
    • ホテル
    不動産
    • 不動産会社
    • 建築事務所
    • 建設
    • 不動産管理
    • 造園
    • 住宅所有者組合
    コンサルティング
    • 会計事務所
    • Odooパートナー
    • マーケティングエージェンシー
    • 法律事務所
    • 人材派遣
    • 監査・認証
    製造
    • テキスタイル
    • 金属
    • 家具
    • 飲食
    • 醸造所
    • コーポレートギフト
    ヘルス & フィットネス
    • スポーツクラブ
    • 眼鏡店
    • フィットネスセンター
    • ウェルネス専門家
    • 薬局
    • ヘアサロン
    業種
    • 便利屋
    • IT ハードウェア・サポート
    • 太陽エネルギーシステム
    • 靴メーカー
    • クリーニングサービス
    • 空調設備サービス
    その他
    • 非営利団体
    • 環境機関
    • ビルボードレンタル
    • 写真
    • 自転車リース
    • ソフトウェアリセラー
    すべての業種を見る
  • コミュニティ
    学ぶ
    • チュートリアル
    • ドキュメンテーション
    • 認定
    • トレーニング
    • ブログ
    • ポッドキャスト
    教育サポート
    • 教育プログラム
    • Scale Up! ビジネスゲーム
    • Odooオフィス訪問
    ソフトを入手
    • ダウンロード
    • エディションを比較
    • リリース
    コラボレーション
    • Github
    • フォーラム
    • イベント
    • 翻訳
    • パートナーになる
    • パートナー様向けサービス
    • 会計事務所を登録
    サービス利用
    • パートナー一覧
    • 会計事務所一覧
    • 今すぐ相談する
    • 導入支援サービス
    • お客様一覧
    • サポート
    • アップグレード
    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:

  • CRM
  • e-Commerce
  • 会計
  • 在庫
  • PoS
  • プロジェクト
  • MRP
All apps
コミュニティで交流するには登録する必要があります。
全てのポスト 人々 バッジ
タグ (全て表示)
odoo accounting v14 pos v15
このフォーラムについて
コミュニティで交流するには登録する必要があります。
全てのポスト 人々 バッジ
タグ (全て表示)
odoo accounting v14 pos v15
このフォーラムについて
ヘルプ

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

購読

この投稿に活動があった際に通知を受け取ります

この質問にフラグが付けられました
4 返信
40613 ビュー
アバター
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、eコマース、会計、在庫管理、POS、プロジェクト管理など、企業のさまざまな業務を一つのシステムで管理できる、ベルギー発のオープンソースのERPソフトウェアです。

高機能で使いやすく、完全に統合されたERPとして、ユニークな価値を提供しています。

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