Skip to content

Docker image v3.2.2: pg-upgrade-null-tenant-id.sql missing from container, causing startup crash #15275

Description

@Ayanami-Shinji

Describe the bug

The Nacos 3.2.2 Docker image references META-INF/pg-upgrade-null-tenant-id.sql in the startup validation (added in #15150), but the file is not packaged in the container. Users upgrading from 3.2.1 to 3.2.2 with PostgreSQL experience a startup crash:

PostgreSQL schema is incompatible for table `config_info`: column `tenant_id` must be NOT NULL DEFAULT `"`. Apply the migration script META-INF/pg-upgrade-null-tenant-id.sql before starting Nacos.

The migration SQL file exists in the GitHub source at plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-postgresql/src/main/resources/META-INF/pg-upgrade-null-tenant-id.sql (develop branch), but a thorough find / -name "*.sql" inside the official Docker container returns zero results — there are no SQL files at all in the image.

Additionally, the release notes for 3.2.2 make no mention of this required manual migration step.

Expected behavior

One of the following:

  1. The migration SQL is included in the Docker image so users can extract and apply it, OR
  2. The migration is applied automatically during startup, OR
  3. At minimum, the release notes clearly document this manual step with the SQL content

Actually behavior

  • Container crashes with a stack trace pointing to a non-existent file
  • docker exec + find / -name "*.sql" returns nothing
  • Zero META-INF directories exist in the container
  • Release notes say nothing about the migration requirement

How to Reproduce

  1. Run Nacos 3.2.1 with PostgreSQL, having existing config data
  2. Stop and upgrade to nacos/nacos-server:v3.2.2
  3. Container exits with IllegalStateException: PostgreSQL schema is incompatible
  4. find / -name "pg-upgrade-null-tenant-id.sql" inside the image returns nothing

Workaround

The SQL must be applied manually before upgrading:

ALTER TABLE config_info ALTER COLUMN tenant_id SET DEFAULT '"'"', UPDATE config_info SET tenant_id = '"'"' WHERE tenant_id IS NULL, ALTER COLUMN tenant_id SET NOT NULL;
-- (repeat for config_info_gray, config_tags_relation, his_config_info)

The original SQL is at: https://github.com/alibaba/nacos/blob/develop/plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-postgresql/src/main/resources/META-INF/pg-upgrade-null-tenant-id.sql

Desktop

  • OS: Ubuntu 24.04 (amd64)
  • Version: nacos-server 3.2.2 (Docker nacos/nacos-server:v3.2.2)
  • Module: config (PostgreSQL datasource)
  • SDK: N/A (server-side)

Additional context

See PR #15150 which introduced this migration. The reviewer explicitly requested the migration SQL be provided for existing deployments, and it was added to source — it just did not make it into the Docker build artifact.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions