[GOWS] - Production: 500 Internal Server Error on session creation due to PostgreSQL collation version mismatch
An attempt to create a new session for the bot (name: "bot4") failed with a 500 Internal Server Error. The error is caused by a Collation version mismatch in the underlying PostgreSQL database when attempting to create a new database from the template (template1).
Steps to Reproduce Send a POST request to the /api/sessions/ endpoint.
The request body (Payload) is:
{
"name": "bot4",
"config": {
"metadata": {},
"webhooks": []
},
"start": true
}
Error Response
"statusCode": 500,
"timestamp": "2025-10-05T07:42:22.286Z",
"exception": {
"message": "CREATE DATABASE \"waha_gows_bot4\" - template database \"template1\" has a collation version mismatch",
"length": 422,
"name": "error",
"severity": "ERROR",
"code": "XX000",
"detail": "The template database was created using collation version 2.36, but the operating system provides version 2.41.",
"hint": "Rebuild all objects in the template database that use the default collation and run ALTER DATABASE template1 REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.",
"file": "dbcommands.c",
"line": "1247",
"routine": "createdb",
"stack": "error: CREATE DATABASE \"waha_gows_bot4\" - template database \"template1\" has a collation version mismatch\n at Parser.parseErrorMessage (/app/node_modules/pg-protocol/dist/parser.js:285:98)\n at Parser.handlePacket (/app/node_modules/pg-protocol/dist/parser.js:122:29)\n at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:35:38)\n at Socket.<anonymous> (/app/node_modules/pg-protocol/dist/index.js:11:42)\n at Socket.emit (node:events:518:28)\n at addChunk (node:internal/streams/readable:561:12)\n at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)\n at Readable.push (node:internal/streams/readable:392:5)\n at TCP.onStreamRead (node:internal/stream_base_commons:189:23)\n at TCP.callbackTrampoline (node:internal/async_hooks:130:17)"
},
"request": {
"path": "/api/sessions/",
"method": "POST",
"body": {
"name": "bot4",
"config": {
"metadata": {},
"webhooks": []
},
"query": {}
}
},
"version": {
"version": "2025.9.8",
"engine": "GOWS",
"tier": "PLUS",
"browser": null
}
}
@raivat14 Is this still a problem? I can't reproduce this on my machine (classic).
Version: 6.2.1-nightly.41 Server: Ferdium Server Electron: 21.2.2 Chrome: 106.0.5249.168 Node.js: 16.16.0 Platform: macOS Arch: arm64 Build date: Mon Nov 07 2022 02:41:44 GMT+0100 (Central European Standard Time) Git SHA: 4c357d77 Git branch: nightly
If this is working for you feel free to close this issue.
I ran this on the database:
ALTER DATABASE template1 refresh collection version;
and on the other databases too and now it works