Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Odoo 16.0 Docker - Role "odoo" does not exist

Subscribe

Get notified when there's activity on this post

This question has been flagged
postgresqldocker
2 Replies
4602 Views
Avatar
Thibault van der Straten

Hi all,

I am facing the following issue when trying to set up Odoo on my Debian server.

Log file on de database docker mention the following

2023-11-10 09:17:04.692 UTC [499] DETAIL: Role "odoo" does not exist.

Connection matched file "/var/lib/postgresql/data/pgdata/pg_hba.conf" line 128: "host all all all scram-sha-256"

This is my docker-compose.yml

version: '3.3'
networks:
  internal:
    external: false
# backend:
#   external: false


########################### SECRETS

secrets:
  postgres_sql_password:
      file: ${APP_DATA_DIR}/secrets/postgresql_password


services:
#
#
# 
  # ODOO APP 

  odoo:
    image: odoo:16.0
    container_name: odoo
    restart: unless-stopped
    depends_on:
      - db
    ports:
      - 8069:8069
    volumes:
      - ${APP_DATA_DIR}/odoo/app:/var/lib/odoo
      - ${APP_DATA_DIR}/odoo/addons:/mnt/extra-addons
    environment:
      - TZ=$TZ
      - PASSWORD_FILE=/run/secrets/postgresql_password
      - HOST=db
      - USER=odoo
    secrets:
      - postgresql_password
    networks:
      - internal
    links:
      - db

#
#
# 
  # ODOO APP  TRAEFIK OK

  db:
    image: postgres:latest
    container_name: db
    volumes:
      - ${APP_DATA_DIR}/odoo/db:/var/lib/postgresql/data/pgdata
    restart: unless-stopped
    networks:
      - internal
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_PASSWORD=/run/secrets/postgresql_password
      - POSTGRES_USER=odoo
      - PGDATA=/var/lib/postgresql/data/pgdata
    secrets:
      - postgresql_password






0
Avatar
Discard
Avatar
Jort de Vreeze
Best Answer

This is not typical. The POSTGRES_USER variable is used in conjunction with POSTGRES_PASSWORD to set a user and its password. This variable will create the specified user with superuser power and a database with the same name. If it is not specified, then the default user of postgres will be used (https://hub.docker.com/_/postgres). I suspect that it has to do with how you define your secrets. Your compose deviates from the official Odoo configuration (https://hub.docker.com/_/odoo/). In addition, I would advise to check the logs of your containers as well, besides the 'Role "odoo" does not exist'.


See https://docs.docker.com/engine/swarm/secrets/#use-secrets-in-compose for how to use secrets with docker-compose.


I hope this helps!

0
Avatar
Discard
Thibault van der Straten
Author

Thanks a lot for your response.
I thought of something like that and to test it out, it tried with the simplest user and password, straight in the compose file, not in secrets. But that didn't solve it.
It's really like those variables didn't do their job of creating the user.

Jort de Vreeze

Did you try removing the containers and the volumes including content (assuming that they haven't been used yet; i.e., no production database) and then build again?

Thibault van der Straten
Author

No I haven't

Avatar
Apiuser
Best Answer

Create a user named Odoo with permissions to everything in the project on your machine.

0
Avatar
Discard
Thibault van der Straten
Author

This method I described comes from user guides about how to use the docker images. I simply assumed that it would just work. This is how it's supposed to be working. So I need to exec bash the db container and access the postgres console and create a user, is that the solution to this ?

Apiuser

I guess you are right that the user you need to is the postgres one. I also faced permissions conflicts and that is why I also created an Odoo user on the system. It seems tho what you lack is that postgres user. Please take a look at this part, because you are requesting connection via this user:

environment:
- POSTGRES_DB=postgres
- POSTGRES_PASSWORD=/run/secrets/postgresql_password
- POSTGRES_USER=odoo
- PGDATA=/var/lib/postgresql/data/pgdata

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
PostgreSQL Idle connections and docker Solved
postgresql docker
Avatar
Avatar
4
Feb 22
24730
When Odoo 14 connects to PostgreSQL 15.7, the connection is idle but cannot be released
postgresql
Avatar
0
Feb 25
2798
psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: fe_sendauth: no password supplied
postgresql
Avatar
Avatar
Avatar
2
Jan 25
9906
Odoo backend to Google Data Studio Solved
postgresql
Avatar
Avatar
2
Jan 24
10139
docker-compose resulted in The connection was reset (from firefox) or Empty reply from server (from curl)? Solved
docker
Avatar
Avatar
2
Sep 23
7973
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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