极狐GitLab 正式推出面向 GitLab 老旧版本(12.x、13.x、14.x、15.x 等)免费用户的专业升级服务,点击查看详情

返回列表 发布新帖

使用docker运行,且每日备份操作,现在gitlab的机器崩馈了。想用备份文件恢复,不成功

136 0
发表于 2024-12-12 16:48:06 | 显示全部楼层 阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
我用docker运行,每日做了备份,gitlab-rake gitlab:backup:create,但当时,我不知道需要备份.rb和.json文件。
gitlab的服务器突然挂了,没有进系统了。于是,我重启了一个docker容器进行恢复,版本和之前的一样,使用名称 gitlab-rake gitlab:backup:restore BACKUP=备份包名,但在使用恢复时,报错。一直恢复不了。 有知道原因并指教指教,谢谢。

2024-12-11 11:28:42 +0800 -- Cleaning the database ...
2024-12-11 11:28:46 +0800 -- done
Restoring PostgreSQL database gitlabhq_production ... [DONE]
Source backup for the database ci doesn't exist. Skipping the task
2024-12-11 11:28:46 +0800 -- Restoring database ... done
2024-12-11 11:28:46 +0800 -- Restoring repositories ...
2024-12-11 11:28:46 +0800 -- Deleting tar staging files ...
2024-12-11 11:28:46 +0800 -- Cleaning up /var/opt/gitlab/backups/backup_information.yml
2024-12-11 11:28:46 +0800 -- Cleaning up /var/opt/gitlab/backups/db
2024-12-11 11:28:46 +0800 -- Cleaning up /var/opt/gitlab/backups/repositories
2024-12-11 11:28:46 +0800 -- Cleaning up /var/opt/gitlab/backups/uploads.tar.gz
2024-12-11 11:28:46 +0800 -- Cleaning up /var/opt/gitlab/backups/builds.tar.gz
2024-12-11 11:28:46 +0800 -- Cleaning up /var/opt/gitlab/backups/artifacts.tar.gz
2024-12-11 11:28:46 +0800 -- Cleaning up /var/opt/gitlab/backups/pages.tar.gz
2024-12-11 11:28:46 +0800 -- Cleaning up /var/opt/gitlab/backups/lfs.tar.gz
2024-12-11 11:28:46 +0800 -- Cleaning up /var/opt/gitlab/backups/terraform_state.tar.gz
2024-12-11 11:28:46 +0800 -- Cleaning up /var/opt/gitlab/backups/packages.tar.gz
2024-12-11 11:28:46 +0800 -- Deleting tar staging files ... done
2024-12-11 11:28:46 +0800 -- Deleting backups/tmp ...
2024-12-11 11:28:46 +0800 -- Deleting backups/tmp ... done
2024-12-11 11:28:46 +0800 -- Deleting backup and restore PID file ... done
rake aborted!
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "snippets" does not exist
LINE 5:           WHERE indrelid = '"snippets"'::regclass


/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/schema_cache_with_renamed_table.rb:21:in `primary_keys'
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/repositories.rb:125:in `each'
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/repositories.rb:125:in `cleanup_snippets_without_repositories'
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/repositories.rb:39:in `ensure in restore'
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/repositories.rb:40:in `restore'
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/manager.rb:104:in `run_restore_task'
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/manager.rb:237:in `block in run_all_restore_tasks'
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/manager.rb:235:in `each_key'
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/manager.rb:235:in `run_all_restore_tasks'
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/manager.rb:79:in `restore'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/backup.rake:21:in `block in restore_backup'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/backup.rake:62:in `lock_backup'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/backup.rake:18:in `restore_backup'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/backup.rake:107:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:25:in `load'
/opt/gitlab/embedded/bin/bundle:25:in `<main>'

Caused by:
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "projects" does not exist
LINE 5:           WHERE indrelid = '"projects"'::regclass
                                   ^






回复

使用道具 举报

意见建议

Email:forum@gitlab.cn
  • 关注公众号
  • 添加专业顾问
Copyright © 2001-2024 极狐GitLab论坛 版权所有 All Rights Reserved. 鄂ICP备2021008419号-1|鄂公网安备42018502006137号
关灯 快速发帖
扫一扫添加专业顾问
返回顶部
快速回复 返回顶部 返回列表