← All tasks
javaalibaba/nacos #15275Not a task: already works

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

envgap__alibaba__nacos-15275

01 / FAILURE SIGNATURE

As reported upstream

3. Container exits with `IllegalStateException: PostgreSQL schema is incompatible`
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
e3ff809d92549be0ce6bd1615c048d9ab688b692
Manifest
plugin-default-impl/nacos-default-plugin-all/pom.xml
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

alibaba/nacos #15275 · read the original issue
**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:

```sql
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.
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]