升级失败。将数据迁移到哈希存储后重试升级

发布于 2025-01-09 14:55:13 字数 508 浏览 2 评论 0原文

我有以下 docker image gitlab/gitlab-ce 来制作本地 Gitlab 服务器 我有以下 docker-compose 文件:

  git:
    container_name: git-server
    image: 'gitlab/gitlab-ce:latest'
    hostname: 'gitlab.example.com'
    ports:
      - '8090:80'
    volumes:
      - '/srv/gitlab/config:/etc/gitlab'
      - '/srv/gitlab/logs:/var/log/gitlab'
      - '/srv/gitlab/data:/var/opt/gitlab'
    networks:
      - net

当我在一分钟后执行 docker-compose up 时,我收到此错误升级失败。将数据迁移到哈希存储后重试升级。 并且容器退出。 如何解决这个问题?

i have the following docker imgage gitlab/gitlab-ce to make a local Gitlab server
and i have the following docker-compose file:

  git:
    container_name: git-server
    image: 'gitlab/gitlab-ce:latest'
    hostname: 'gitlab.example.com'
    ports:
      - '8090:80'
    volumes:
      - '/srv/gitlab/config:/etc/gitlab'
      - '/srv/gitlab/logs:/var/log/gitlab'
      - '/srv/gitlab/data:/var/opt/gitlab'
    networks:
      - net

when i do docker-compose up after a minute i get this error Upgrade failed. Retry the upgrade after migrating your data to hashed storage. and the container exited.
how to solve this problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

澉约 2025-01-16 14:55:13

解决方案是在创建 Gitlab 服务器容器之后、在 Gitlab 中创建任何组或项目之前迁移到哈希存储

在 Gitlab 服务器中使用以下命令:

  • Omnibus 安装:

    sudo gitlab-rake gitlab:storage:migrate_to_hashed

  • 源安装:

    sudo -u git -H bundle exec rake gitlab:storage:migrate_to_hashed RAILS_ENV=生产

现在您可以在@hashed文件夹下找到您的组和项目。

有关解释相对路径的信息,请参阅:
https://0xacab.org/help/administration/repository_storage_types.md #翻译哈希存储路径

The solution is to migrate to hashed storage after the creation of the Gitlab server container and before creating any groups or projects in Gitlab.

Use the following command inside Gitlab server:

  • Omnibus installation:

    sudo gitlab-rake gitlab:storage:migrate_to_hashed

  • Source installation:

    sudo -u git -H bundle exec rake gitlab:storage:migrate_to_hashed RAILS_ENV=production

Now you can find your groups and projects under @hashed folder.

For information on interpreting the relative path, see:
https://0xacab.org/help/administration/repository_storage_types.md#translate-hashed-storage-paths

没有心的人 2025-01-16 14:55:13

当您没有连接到配置的外部 postgresql 数据库时,也可能会出现此错误。然后检查 gitlab.rb 的下一部分:

# Fill in the values for database.yml
gitlab_rails['db_adapter'] = 'postgresql'
gitlab_rails['db_encoding'] = 'utf8'
gitlab_rails['db_host'] = '172.22.22.7'
gitlab_rails['db_port'] = '5432'
gitlab_rails['db_username'] = 'gitlab'
gitlab_rails['db_password'] = '***'

This error could appear also, when you have no connection to configured external postgresql database. Then check next section at your gitlab.rb:

# Fill in the values for database.yml
gitlab_rails['db_adapter'] = 'postgresql'
gitlab_rails['db_encoding'] = 'utf8'
gitlab_rails['db_host'] = '172.22.22.7'
gitlab_rails['db_port'] = '5432'
gitlab_rails['db_username'] = 'gitlab'
gitlab_rails['db_password'] = '***'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文