[GH-ISSUE #4452] Postgres collation mismatch after upgrade from 0.55 to 0.56 #9459

Closed
opened 2026-08-05 01:22:11 -04:00 by saavagebueno · 1 comment
Owner

Originally created by @PowershellScripter on GitHub (Sep 6, 2025).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/4452

Image

To Reproduce

  1. Updated docker compose to newest tag version, leaving postgres at 16 (doesnt support 17 for database upgrade)

Expected behavior

No indexing problems

Are you using NetBird Cloud?

Self-Hosted

NetBird version

0.56.0 & dashboard v2.18.0

netbird-db          | 2025-09-06 11:52:27.552 UTC [1348] WARNING:  database "template1" has a collation version mismatch
netbird-db          | 2025-09-06 11:52:27.552 UTC [1348] DETAIL:  The database was created using collation version 2.36, but the operating system provides version 2.41.
netbird-db          | 2025-09-06 11:52:27.552 UTC [1348] HINT:  Rebuild all objects in this database that use the default collation and run ALTER DATABASE template1 REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
netbird-db          | 2025-09-06 11:52:28.867 UTC [1356] WARNING:  database "netbird" has a collation version mismatch
netbird-db          | 2025-09-06 11:52:28.867 UTC [1356] DETAIL:  The database was created using collation version 2.36, but the operating system provides version 2.41.
netbird-db          | 2025-09-06 11:52:28.867 UTC [1356] HINT:  Rebuild all objects in this database that use the default collation and run ALTER DATABASE netbird REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
Originally created by @PowershellScripter on GitHub (Sep 6, 2025). Original GitHub issue: https://github.com/netbirdio/netbird/issues/4452 <img width="1321" height="295" alt="Image" src="https://github.com/user-attachments/assets/5d338a03-7226-4871-bf96-7babbcc93390" /> **To Reproduce** 1. Updated docker compose to newest tag version, leaving postgres at 16 (doesnt support 17 for database upgrade) **Expected behavior** No indexing problems **Are you using NetBird Cloud?** Self-Hosted **NetBird version** 0.56.0 & dashboard v2.18.0 ``` netbird-db | 2025-09-06 11:52:27.552 UTC [1348] WARNING: database "template1" has a collation version mismatch netbird-db | 2025-09-06 11:52:27.552 UTC [1348] DETAIL: The database was created using collation version 2.36, but the operating system provides version 2.41. netbird-db | 2025-09-06 11:52:27.552 UTC [1348] HINT: Rebuild all objects in this database that use the default collation and run ALTER DATABASE template1 REFRESH COLLATION VERSION, or build PostgreSQL with the right library version. netbird-db | 2025-09-06 11:52:28.867 UTC [1356] WARNING: database "netbird" has a collation version mismatch netbird-db | 2025-09-06 11:52:28.867 UTC [1356] DETAIL: The database was created using collation version 2.36, but the operating system provides version 2.41. netbird-db | 2025-09-06 11:52:28.867 UTC [1356] HINT: Rebuild all objects in this database that use the default collation and run ALTER DATABASE netbird REFRESH COLLATION VERSION, or build PostgreSQL with the right library version. ```
saavagebueno added the triage-needed label 2026-08-05 01:22:11 -04:00
Author
Owner

@PowershellScripter commented on GitHub (Sep 6, 2025):

nvm.. chatgpt fixed it for me. simple

 

Step 1. Enter psql

Inside your container:

psql -U postgres

Replace postgres with the DB superuser name if your setup uses something else.

Step 2. Run the SQL/psql commands

Once you see the psql prompt (something like postgres=#), you can run:

\c netbird
REINDEX DATABASE netbird;
ALTER DATABASE netbird REFRESH COLLATION VERSION;
\c template1
REINDEX DATABASE template1;
ALTER DATABASE template1 REFRESH COLLATION VERSION;

Quick one-liner (skip interactive mode)

If you’d rather not go into the interactive shell, you can run commands directly from outside:

docker exec -it netbird-db psql -U postgres -d netbird -c "REINDEX DATABASE netbird; ALTER DATABASE netbird REFRESH COLLATION VERSION;"
docker exec -it netbird-db psql -U postgres -d template1 -c "REINDEX DATABASE template1; ALTER DATABASE template1 REFRESH COLLATION VERSION;"
<!-- gh-comment-id:3261969140 --> @PowershellScripter commented on GitHub (Sep 6, 2025): nvm.. chatgpt fixed it for me. simple   Step 1. Enter psql Inside your container: ``` psql -U postgres ``` Replace postgres with the DB superuser name if your setup uses something else. Step 2. Run the SQL/psql commands Once you see the psql prompt (something like postgres=#), you can run: ``` \c netbird REINDEX DATABASE netbird; ALTER DATABASE netbird REFRESH COLLATION VERSION; ``` ``` \c template1 REINDEX DATABASE template1; ALTER DATABASE template1 REFRESH COLLATION VERSION; ``` Quick one-liner (skip interactive mode) If you’d rather not go into the interactive shell, you can run commands directly from outside: ``` docker exec -it netbird-db psql -U postgres -d netbird -c "REINDEX DATABASE netbird; ALTER DATABASE netbird REFRESH COLLATION VERSION;" docker exec -it netbird-db psql -U postgres -d template1 -c "REINDEX DATABASE template1; ALTER DATABASE template1 REFRESH COLLATION VERSION;" ```
Sign in to join this conversation.
No Label triage-needed
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#9459