Ubuntu安装Gitlab完后,报bash[migrate gitlab-rails database]的问题

根据Gitlab 官网的安装方法,在执行以下命令时出现了问题:

sudo apt-get install gitlab-ce

具体错误如下:

There was an error running gitlab-ctl reconfigure:

bash[migrate gitlab-rails database] (gitlab::database_migrations line 51) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "bash"  "/tmp/chef-script20190428-15510-28f5ti" ----
STDOUT: WARNING: No valid license encryption key provided.
rake aborted!
NameError: uninitialized constant Elasticsearch
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/elastic_client_setup.rb:5:in `<top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/config/environment.rb:6:in `<top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => gitlab:db:configure => environment
(See full trace by running task with --trace)
STDERR: 
---- End output of "bash"  "/tmp/chef-script20190428-15510-28f5ti" ----
Ran "bash"  "/tmp/chef-script20190428-15510-28f5ti" returned 1

安装的gitlab安装包来源与版本信息:

https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu xenial InRelease
gitlab-ce (11.10.1-ce.0)

服务器信息:

Description:    Ubuntu 16.04.6 LTS (x86_64)
Release:    16.04
Codename:    xenial

已经试过的方法

  • 重装Gitlab
  • 把Gitlab换成低版本的(一路调到8)
  • 安装后,重启服务器
阅读 9.6k
2 个回答

第一次执行了sudo apt-get install gitlab-ee,发现不对后卸载了。
之后再次执行sudo apt-get install gitlab-ce就报问题里的错误。
后来把有关gitlab的文件都清理干净后安装成功。


我清理的文件目录如下:

opt/gitlab
etc/gitlab
var/opt/gitlab
var/log/gitlab

我怀疑你是不是把 ee 版本的安装脚本当 ce 的给运行了,因为你给的官网地址上的安装方法就是 ee 版的
而且ee版才需要 license。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题