Concurrent map writes error in embed_i18n.go
Hello, after starting to use Comentario, I began to encounter the following error that ended up killing the nginx process. A "fatal error: concurrent map writes" in the Comentario service that causes the application to crash. The error occurs specifically in internal/api/restapi/handlers/embed_i18n.go:18 when multiple requests try to modify the same map concurrently.
-
OS Ubuntu 22.04.5 LTS
-
psql --version psql (PostgreSQL) 17.6 (Ubuntu 17.6-1.pgdg22.04+1)
-
nginx -v nginx version: nginx/1.28.0
-
Comentario version Comentario server, version 3.14.0, built 2025-06-05T09:38:00Z
-
Config: PostgreSQL with connection string: postgres://****-****:REDACTED@127.0.0.1:5432/Comentario-DB?sslmode=disable SMTP: ***.net:25 (insecure, no authentication) OAuth2 providers: Google, Twitter, Discord configured
Error details
fatal error: concurrent map writes
goroutine 1010 [running]:
internal/runtime/maps.fatal({0x1559198?, 0xc00025eba0?})
/usr/local/go/src/runtime/panic.go:1058 +0x18
gitlab.com/comentario/comentario/internal/api/restapi/handlers.EmbedI18nMessages({0xc00114b040?, {0xc000fcc370?, 0xc000446801?}})
/builds/comentario/comentario/internal/api/restapi/handlers/embed_i18n.go:18 +0x7a
Steps to Reproduce:
- Run Comentario with normal traffic load
- Error occurs after several minutes of operation (approximately 3-4 minutes from startup)
- Multiple WebSocket connections are active when the error occurs
Additional Context:
- The service was restarted automatically by systemd (restart counter at 1)
- The error seems related to internationalization message handling
- 334 stale page views were removed during cleanup just before the error
- Multiple WebSocket connections were active (goroutines 93, 50, 352, etc. show WebSocket handlers) comentario__1_.log