如何修复 Gitlab Redis 启动循环:Fatal error loading the DB: Permission denied. Exiting.
问题
启动 dockerized Gitlab 实例时,你看到 Redis 无法启动并显示以下错误消息:
gitlab_redis_boot_loop.txt
==> /var/log/gitlab/redis/current <==
2024-09-18_00:21:51.72811 3025:C 18 Sep 2024 00:21:51.728 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
2024-09-18_00:21:51.72817 3025:C 18 Sep 2024 00:21:51.728 # Redis version=7.0.15, bits=64, commit=f35f36a2, modified=1, pid=3025, just started
2024-09-18_00:21:51.72818 3025:C 18 Sep 2024 00:21:51.728 # Configuration loaded
2024-09-18_00:21:51.72868 3025:M 18 Sep 2024 00:21:51.728 * monotonic clock: POSIX clock_gettime
2024-09-18_00:21:51.72924 _._
2024-09-18_00:21:51.72925 _.-``__ ''-._
2024-09-18_00:21:51.72927 _.-`` `. `_. ''-._ Redis 7.0.15 (f35f36a2/1) 64 bit
2024-09-18_00:21:51.72927 .-`` .-```. ```\/ _.,_ ''-._
2024-09-18_00:21:51.72927 ( ' , .-` | `, ) Running in standalone mode
2024-09-18_00:21:51.72928 |`-._`-...-` __...-.``-._|'` _.-'| Port: 0
2024-09-18_00:21:51.72928 | `-._ `._ / _.-' | PID: 3025
2024-09-18_00:21:51.72928 `-._ `-._ `-./ _.-' _.-'
2024-09-18_00:21:51.72928 |`-._`-._ `-.__.-' _.-'_.-'|
2024-09-18_00:21:51.72929 | `-._`-._ _.-'_.-' | https://redis.io
2024-09-18_00:21:51.72929 `-._ `-._`-.__.-'_.-' _.-'
2024-09-18_00:21:51.72929 |`-._`-._ `-.__.-' _.-'_.-'|
2024-09-18_00:21:51.72929 | `-._`-._ _.-'_.-' |
2024-09-18_00:21:51.72930 `-._ `-._`-.__.-'_.-' _.-'
2024-09-18_00:21:51.72930 `-._ `-.__.-' _.-'
2024-09-18_00:21:51.72930 `-._ _.-'
2024-09-18_00:21:51.72931 `-.__.-'
2024-09-18_00:21:51.72931
2024-09-18_00:21:51.72937 3025:M 18 Sep 2024 00:21:51.729 # Server initialized
2024-09-18_00:21:51.73210 3025:M 18 Sep 2024 00:21:51.731 # Fatal error loading the DB: Permission denied. Exiting.
==> /var/log/gitlab/sidekiq/current <==
{"severity":"INFO","time":"2024-09-18T00:21:51.755Z","message":"A worker terminated, shutting down the cluster"}解决方案
这里的问题是 Redis 数据目录的权限不正确。
通过在 Gitlab 容器中执行内置的 fix-permissions 脚本来修复:
gitlab_fix_permissions.sh
docker-compose run gitlab update-permissionsCheck out similar posts by category:
GitLab
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow