使用 apt-get upgrade 升级后 Gitlab prometheus 出现错误

使用 apt-get upgrade 升级后 Gitlab prometheus 出现错误

在将我的 Ubuntu 18.04 上的 gitlab 从 10.9.2 升级到 10.10 版本后,apt-get 升级过程无法成功结束。它以以下消息结束:

Ensuring Prometheus is updated:Traceback (most recent call last):
    11: from /opt/gitlab/embedded/bin/omnibus-ctl:23:in `<main>'
    10: from /opt/gitlab/embedded/bin/omnibus-ctl:23:in `load'
     9: from /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/omnibus-ctl-0.6.0/bin/omnibus-ctl:31:in `<top (required)>'
     8: from /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/omnibus-ctl-0.6.0/lib/omnibus-ctl.rb:746:in `run'
     7: from /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/omnibus-ctl-0.6.0/lib/omnibus-ctl.rb:197:in `block in add_command'
     6: from /opt/gitlab/embedded/service/omnibus-ctl/prometheus-upgrade.rb:45:in `block in load_file'
     5: from /opt/gitlab/embedded/service/omnibus-ctl/lib/gitlab_ctl/prometheus_upgrade.rb:40:in `backup_data'
     4: from /opt/gitlab/embedded/lib/ruby/2.6.0/fileutils.rb:520:in `mv'
     3: from /opt/gitlab/embedded/lib/ruby/2.6.0/fileutils.rb:1555:in `fu_each_src_dest'
     2: from /opt/gitlab/embedded/lib/ruby/2.6.0/fileutils.rb:1571:in `fu_each_src_dest0'
     1: from /opt/gitlab/embedded/lib/ruby/2.6.0/fileutils.rb:1557:in `block in fu_each_src_dest'
/opt/gitlab/embedded/lib/ruby/2.6.0/fileutils.rb:525:in `block in mv': File exists - /var/opt/gitlab/prometheus/data_tmp/data (Errno::EEXIST)
Ensuring Prometheus is updated: NOT OK
Error ensuring Prometheus is updated. Please check the logs
dpkg: error processing package gitlab-ce (--configure):
 installed gitlab-ce package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 gitlab-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)

当我使用 gitlab-ctl restart 重新启动我的 gitlab 时,它工作正常,但是当我再次尝试 apt-get upgrade 时,它​​想要完成安装并再次停止并显示相同的消息。

任何想法?

答案1

问题是File exists - /var/opt/gitlab/prometheus/data_tmp/data (Errno::EEXIST)。错误消息在GitLab 问题关于另一个问题。您可以将该文件移至/var/opt/gitlab/prometheus/data_tmp/data另一个位置或将其完全删除(这样会丢失数据),并希望更新能够顺利完成。

相关内容