Skip to content

docker-compose-light: Examples DB init fails #38491

@bschreder

Description

@bschreder

Bug description

Execute docker compose -f docker-compose-light.yml up --build

First issue:
During the "Init Step 4/4 [Starting] -- Loading examples"

superset-init-light-1 | 2026-03-07 19:39:39,685:WARNING:superset.commands.database.utils:Error processing catalog 'examples'
superset-init-light-1 | return dialect.connect(*cargs, **cparams)
superset-init-light-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
superset-init-light-1 | File "/app/.venv/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 598, in connect
superset-init-light-1 | return self.dbapi.connect(*cargs, **cparams)
superset-init-light-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
superset-init-light-1 | File "/app/.venv/lib/python3.11/site-packages/psycopg2/init.py", line 122, in connect
superset-init-light-1 | conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
superset-init-light-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
superset-init-light-1 | psycopg2.OperationalError: could not translate host name "db" to address: Name or service not known

fails to load the example database. the issue is the compose file labels the db service as db-light and the environment variable for EXAMPLES_HOST and EXAMPLES_DB isn't set.

The second issue: the examples user isn't created in the meta database.
When trying to login as examples user, the login fails

The fix is to provide the database on the psql command that creates the example user.

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.11

Node version

18 or greater

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    data:databasesRelated to database configurations and connections

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions