原创, 服务器Git, Gitlab
gitlab:backup:restore 恢复数据时报 Error: 14:failed to connect to all addresses 问题解决方法
- by chenxue4076
- 2 years ago
1.现象说明
执行 gitlab-rake gitlab:backup:restore BACKUP=1679013700_2023_03_17_13.1.11
出现以下错误
* embeded/dtu_yd ... Error: 14:failed to connect to all addresses
[Failed] restoring embeded/dtu_yd repository
* embeded/dtu_yd.wiki ... [Failed] restoring embeded/dtu_yd.wiki wiki
Error 14:failed to connect to all addresses
2. 查看log /var/log/gitlab/gitaly# tail -100f current
可以看到有报错,权限问题
time="2023-03-17T01:23:44Z" level=info msg="Starting Gitaly" version="Gitaly, version 13.1.11"
time="2023-03-17T01:23:44Z" level=warning msg="git path not configured. Using default path resolution" resolvedPath=/opt/gitlab/embedded/bin/git
time="2023-03-17T01:23:44Z" level=info msg="clearing disk cache object folder" path=/var/opt/gitlab/git-data/repositories
time="2023-03-17T01:23:44Z" level=fatal msg="load config" config_path=/var/opt/gitlab/gitaly/config.toml error="mkdir /var/opt/gitlab/git-data/repositories/+gitaly/tmp/diskcache385192731: permission denied"
3. 查看文件夹权限是否有异常 # ll /var/opt/gitlab/git-data/repositories
drwxr-sr-x 5 1003 root 4096 Mar 16 04:56 +gitaly/
-rw------- 1 1003 root 64 Apr 7 2020 .gitaly-metadata
drwxr-s--- 119 1003 root 4096 Feb 16 05:34 @hashed/
4. 修改权为git # chown -R git /var/opt/gitlab/git-data/repositories
ll /var/opt/gitlab/git-data/repositories
drwxr-sr-x 3 git root 4096 Mar 17 01:24 +gitaly/
-rw------- 1 git root 64 Apr 7 2020 .gitaly-metadata
drwxr-s--- 119 git root 4096 Feb 16 05:34 @hashed/
5.重新恢复数据
gitlab-rake gitlab:backup:restore BACKUP=1679013700_2023_03_17_13.1.11
这次就能成功恢复数据了。
(289)