Skip to content

Commit 7504eb4

Browse files
authored
fix: pin postgres image to bookworm in docker_example (#13027)
* fix: pin postgres image to bookworm in docker_example to prevent collation mismatch The postgres:16 tag silently moved its base from Debian Bookworm (glibc 2.36) to Trixie (glibc 2.41), causing a recurring collation version mismatch warning on existing langflow-postgres volumes. Pin to postgres:16-bookworm in both docker-compose files and update the README so existing data volumes keep matching the OS locale data. Refs: #9608 * docs: pin postgres image to bookworm in current docs compose snippets Mirror the docker_example pin in the four current docs that publish copyable Compose snippets pairing postgres:16 with a persistent langflow-postgres volume. Prevents the same Bookworm-to-Trixie collation version mismatch warning when users follow docs instead of docker_example. Versioned historical docs are left as-is. Refs: #9608 * fix: switch postgres pin from bookworm to trixie for OS consistency Aligns the pinned postgres base with the langflow runtime image, which moved to Debian Trixie in #12990. Keeping postgres on bookworm would have diverged the stack and locked the database to an aging glibc that will receive fewer security backports as bookworm ages into oldstable. The pin itself still solves the original bug — postgres:16 cannot silently roll its OS underneath an existing volume. Document the one-time REFRESH COLLATION VERSION step for users upgrading from a bookworm-initialized volume in docker_example/README.md. Refs: #9608
1 parent b707c9a commit 7504eb4

8 files changed

Lines changed: 50 additions & 10 deletions

File tree

.secrets.baseline

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@
237237
"filename": "docker_example/docker-compose.yml",
238238
"hashed_secret": "e80c4f90316c87b6b24d03890493c8d1c7c1c99d",
239239
"is_verified": false,
240-
"line_number": 20,
240+
"line_number": 24,
241241
"is_secret": false
242242
}
243243
],
@@ -247,7 +247,7 @@
247247
"filename": "docker_example/pre.docker-compose.yml",
248248
"hashed_secret": "e80c4f90316c87b6b24d03890493c8d1c7c1c99d",
249249
"is_verified": false,
250-
"line_number": 21,
250+
"line_number": 25,
251251
"is_secret": false
252252
}
253253
],
@@ -8253,5 +8253,5 @@
82538253
}
82548254
]
82558255
},
8256-
"generated_at": "2026-05-05T19:37:49Z"
8256+
"generated_at": "2026-05-07T19:13:33Z"
82578257
}

docker_example/README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Volumes:
4848

4949
### PostgreSQL Service
5050

51-
The `postgres` service uses the `postgres:16` Docker image and exposes port 5432.
51+
The `postgres` service uses the `postgres:16-trixie` Docker image and exposes port 5432. The image is pinned to a specific Debian base (`trixie`, Debian 13) so the `postgres:16` tag cannot silently roll its underlying OS, which would otherwise produce a glibc collation version mismatch warning on existing data volumes.
5252

5353
Environment variables:
5454

@@ -60,6 +60,26 @@ Volumes:
6060

6161
- `langflow-postgres`: This volume is mapped to `/var/lib/postgresql/data` in the container.
6262

63+
### Upgrading from a `bookworm`-initialized volume
64+
65+
Earlier versions of this example used `postgres:16`, which initially shipped on Debian Bookworm (glibc 2.36). The pinned image now uses Trixie (glibc 2.41). On the first start against a volume that was initialized under Bookworm, PostgreSQL logs a one-time warning:
66+
67+
```
68+
WARNING: database "langflow" has a collation version mismatch
69+
DETAIL: The database was created using collation version 2.36, but the operating system provides version 2.41.
70+
```
71+
72+
To clear it, refresh the collation version against the running database (one-off, takes seconds on a typical Langflow database):
73+
74+
```sh
75+
docker compose exec postgres \
76+
psql -U langflow -d langflow \
77+
-c "REINDEX DATABASE langflow;" \
78+
-c "ALTER DATABASE langflow REFRESH COLLATION VERSION;"
79+
```
80+
81+
Fresh installs are unaffected.
82+
6383
## Switching to a Specific LangFlow Version
6484

6585
If you want to use a specific version of LangFlow, you can modify the `image` field under the `langflow` service in the Docker Compose file. For example, to use version 1.0-alpha, change `langflowai/langflow:latest` to `langflowai/langflow:1.0-alpha`.

docker_example/docker-compose.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ services:
1414
- langflow-data:/app/langflow
1515

1616
postgres:
17-
image: postgres:16
17+
# Pinned to a specific Debian base (trixie) so the postgres:16 tag does not
18+
# silently roll its OS underneath us — that roll causes a glibc collation
19+
# version mismatch warning on existing volumes. Matches the langflow image
20+
# base. See https://github.com/langflow-ai/langflow/issues/9608
21+
image: postgres:16-trixie
1822
environment:
1923
POSTGRES_USER: langflow
2024
POSTGRES_PASSWORD: langflow

docker_example/pre.docker-compose.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ services:
1515
- langflow-data:/app/langflow
1616

1717
postgres:
18-
image: postgres:16
18+
# Pinned to a specific Debian base (trixie) so the postgres:16 tag does not
19+
# silently roll its OS underneath us — that roll causes a glibc collation
20+
# version mismatch warning on existing volumes. Matches the langflow image
21+
# base. See https://github.com/langflow-ai/langflow/issues/9608
22+
image: postgres:16-trixie
1923
environment:
2024
POSTGRES_USER: langflow
2125
POSTGRES_PASSWORD: langflow

docs/docs/Deployment/deployment-docker.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,10 @@ For example, this Docker Compose file uses a bind mount for Langflow data (`./la
232232
volumes:
233233
- ./langflow-data:/app/langflow
234234
postgres:
235-
image: postgres:16
235+
# Pinned to a specific Debian base (trixie) so the postgres:16 tag does
236+
# not silently roll its OS, which triggers a glibc collation mismatch
237+
# warning on existing volumes. See https://github.com/langflow-ai/langflow/issues/9608
238+
image: postgres:16-trixie
236239
volumes:
237240
- langflow-postgres:/var/lib/postgresql/data
238241

docs/docs/Develop/configuration-custom-database.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,10 @@ For example:
124124
```yaml
125125
services:
126126
postgres:
127-
image: postgres:16
127+
# Pinned to a specific Debian base (trixie) so the postgres:16 tag does
128+
# not silently roll its OS, which triggers a glibc collation mismatch
129+
# warning on existing volumes. See https://github.com/langflow-ai/langflow/issues/9608
130+
image: postgres:16-trixie
128131
environment:
129132
- POSTGRES_USER=${POSTGRES_USER}
130133
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}

docs/docs/Develop/enterprise-database-guide.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ For more information, see [Configure an external PostgreSQL database](/configura
6767
environment:
6868
- LANGFLOW_DATABASE_URL=postgresql://langflow:langflow@postgres:5432/langflow
6969
postgres:
70-
image: postgres:16
70+
# Pinned to a specific Debian base (trixie) so the postgres:16 tag does
71+
# not silently roll its OS, which triggers a glibc collation mismatch
72+
# warning on existing volumes. See https://github.com/langflow-ai/langflow/issues/9608
73+
image: postgres:16-trixie
7174
ports:
7275
- "5432:5432"
7376
environment:

docs/docs/Develop/integrations-langfuse.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ As an alternative to the previous setup, particularly for self-hosted Langfuse,
107107
- langflow-data:/app/langflow
108108

109109
postgres:
110-
image: postgres:16
110+
# Pinned to a specific Debian base (trixie) so the postgres:16 tag does
111+
# not silently roll its OS, which triggers a glibc collation mismatch
112+
# warning on existing volumes. See https://github.com/langflow-ai/langflow/issues/9608
113+
image: postgres:16-trixie
111114
environment:
112115
POSTGRES_USER: langflow
113116
POSTGRES_PASSWORD: langflow

0 commit comments

Comments
 (0)