GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Docker compose deployment: struggling with broken quoting= · Issue #10364 · pgadmin-org/pgadmin4

Docker compose deployment: struggling with broken quoting= #10364

New issue
Copy link
New issue
Copy link
Closed
Closed
Docker compose deployment: struggling with broken quoting=#10364
Copy link
Labels
Bug

Description

@thommierother
thommierother
opened on Aug 31, 2026
Issue body actions

I am looking for a working example to deploy pgadmin4 with docker compose. In my case I see the following errors on startup:

pgadmin4-1  | email config is {'CHECK_EMAIL_DELIVERABILITY': False, 'ALLOW_SPECIAL_EMAIL_DOMAINS': [], 'GLOBALLY_DELIVERABLE': True}  
pgadmin4-1  | Traceback (most recent call last):  
pgadmin4-1  |   File "/pgadmin4/run_pgadmin.py", line 4, in <module>  
pgadmin4-1  |     from pgAdmin4 import app  
pgadmin4-1  |   File "/pgadmin4/pgAdmin4.py", line 38, in <module>  
pgadmin4-1  |     import config  
pgadmin4-1  |   File "/pgadmin4/config.py", line 1126, in <module>  
pgadmin4-1  |     from pgadmin.evaluate_config import evaluate_and_patch_config  
pgadmin4-1  |   File "/pgadmin4/pgadmin/evaluate_config.py", line 64, in <module>  
pgadmin4-1  |     config_distro = import_module_from_path('config_distro',  
pgadmin4-1  |                                             config_distro_path)  
pgadmin4-1  |   File "/pgadmin4/pgadmin/evaluate_config.py", line 38, in import_module_from_path  
pgadmin4-1  |     spec.loader.exec_module(module)  
pgadmin4-1  |     ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^  
pgadmin4-1  |   File "/pgadmin4/config_distro.py", line 13, in <module>  
pgadmin4-1  |     MAIL_SERVER = mail.netzwissen.de  
pgadmin4-1  |                   ^^^^  
pgadmin4-1  | NameError: name 'mail' is not defined

The docker compose file

root@docker6:/etc/docker/pgadmin# less docker-compose.yaml    
# version: "3.8"  
services:  
 pgadmin4:  
   hostname: pgadmin4  
   image: dpage/pgadmin4:latest  
   restart: always  
   environment:  
     PGADMIN_DEFAULT_EMAIL: '[[email protected]]'  
     PGADMIN_DEFAULT_PASSWORD: '[redacted]'  
     PGADMIN_LISTEN_PORT: 5050  
     PGADMIN_CONFIG_ENHANCED_COOKIE_PROTECTION: true  
     PGADMIN_CONFIG_CONSOLE_LOG_LEVEL: 10  
     PGADMIN_SERVER_JSON_FILE: 'servers.json'  
     PGADMIN_PGPASS_FILE: 'pgpass'  
     PGADMIN_DISABLE_POSTFIX: true  
     PGADMIN_CONFIG_MAIL_SERVER: '[mail.example.com]'  
     PGADMIN_CONFIG_MAIL_PORT: 587  
     PGADMIN_CONFIG_MAIL_USE_SSL: false  
     PGADMIN_CONFIG_MAIL_USE_TLS: true  
     PGADMIN_CONFIG_MAIL_USERNAME: '[[email protected]]'  
     PGADMIN_CONFIG_MAIL_PASSWORD: '[redacted]'  
     PGADMIN_CONFIG_MAIL_DEBUG: false  
     PGADMIN_CONFIG_MAIL_SECURITY_EMAIL_SENDER: '[[email protected]]'  
   volumes:  
     - ./servers.json:/pgadmin4/servers.json # servers available  
     - ./pgpass:/pgpass # passwords for the connections in this file  
   networks:  
     - pgadmin  
   ports:  
     - 5050:5050
     - 

There is an older issue at which indicates some problems with quoting env variables. I could not find any information about correct quoting on https://www.pgadmin.org/docs/pgadmin4/latest/container_deployment.html

Activity

  1. thommierother
    added
    Bug
    on Aug 31, 2026
  2. dev-hari-prasad commented on Sep 25, 2026

    @dev-hari-prasad
    dev-hari-prasad
    on Sep 25, 2026
    Contributor
    More actions

    The issue comes down to how YAML handles quotes and how pgAdmin uses PGADMIN_CONFIG_* values.

    When you write something like:

    PGADMIN_CONFIG_MAIL_SERVER: 'mail.example.com'

    YAML removes those outer quotes when it parses the value. So the container actually receives:

    mail.example.com
    

    The pgAdmin entrypoint then writes that value directly into config_distro.py, which effectively becomes:

    MAIL_SERVER = mail.example.com

    At that point Python treats mail.example.com as an expression/attribute lookup instead of a string, which is why you end up with:

    NameError: name 'mail' is not defined
    

    The workaround is to make the quotes part of the actual environment-variable value by nesting them:

    environment:
      # Normal container variables
      PGADMIN_DEFAULT_EMAIL: [email protected]
      PGADMIN_DEFAULT_PASSWORD: "[redacted]"
      PGADMIN_LISTEN_PORT: 5050
      PGADMIN_SERVER_JSON_FILE: servers.json
      PGADMIN_PGPASS_FILE: pgpass
      PGADMIN_DISABLE_POSTFIX: "true"
    
      # Booleans / numbers
      PGADMIN_CONFIG_ENHANCED_COOKIE_PROTECTION: "True"
      PGADMIN_CONFIG_CONSOLE_LOG_LEVEL: 10
      PGADMIN_CONFIG_MAIL_PORT: 587
      PGADMIN_CONFIG_MAIL_USE_SSL: "False"
      PGADMIN_CONFIG_MAIL_USE_TLS: "True"
      PGADMIN_CONFIG_MAIL_DEBUG: "False"
    
      # String values need the quotes to survive into config_distro.py
      PGADMIN_CONFIG_MAIL_SERVER: "'mail.example.com'"
      PGADMIN_CONFIG_MAIL_USERNAME: "'[email protected]'"
      PGADMIN_CONFIG_MAIL_PASSWORD: "'your_password'"
      PGADMIN_CONFIG_MAIL_SECURITY_EMAIL_SENDER: "'[email protected]'"

    One other thing to keep in mind: config_distro.py is only generated when the file doesn't already exist. So if you've already started the container with the broken configuration, you'll need to recreate it so the file gets generated again:

    docker compose down
    docker compose up -d

    That should leave the generated Python config with actual string literals instead of bare

  3. dpage
    added a commit that references this issue on Oct 1, 2026

    Explain Docker Compose quoting for PGADMIN_CONFIG_* values in the con…

    c83e075
  4. dpage commented on Oct 1, 2026

    @dpage
    dpage
    on Oct 1, 2026
    Contributor
    More actions

    Documented in c83e075 (#10465).

  5. dpage
    closed this as completedon Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.