ruby - Gitlab 升级后运行提示无法启动
怪我咯
怪我咯 2017-04-21 11:17:20
0
1
843

Gitlab的话我目前是从6.1打算升级到6.2来着的,前面的都按照升级教程比较完美的进行了。除了在第五步需要rake几个命令的时候提示了rake aborted!出错信息如下:


root@ubuntu-gitlab:/home/git/gitlab# sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production rake aborted! (<unknown>): found character that cannot start any token while scanning for the next token at line 150 column 1 /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:103:in `initialize' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:60:in `new' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:60:in `instance' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:37:in `[]' /home/git/gitlab/config/initializers/1_settings.rb:38:in `<top (required)>' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `block in load' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:588:in `block (2 levels) in <class:Engine>' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:587:in `each' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:587:in `block in <class:Engine>' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing' /home/git/gitlab/config/environment.rb:5:in `<top (required)>' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require_with_backports' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/application.rb:103:in `require_environment!' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/application.rb:297:in `block (2 levels) in initialize_tasks' Tasks: TOP => db:migrate => environment (See full trace by running task with --trace)

root@ubuntu-gitlab:/home/git/gitlab# sudo -u git -H bundle exec rake assets:clean RAILS_ENV=production /usr/local/bin/ruby /home/git/gitlab/vendor/bundle/ruby/2.0.0/bin/rake assets:clean:all RAILS_ENV=production RAILS_GROUPS=assets rake aborted! (<unknown>): found character that cannot start any token while scanning for the next token at line 150 column 1 /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:103:in `initialize' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:60:in `new' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:60:in `instance' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:37:in `[]' /home/git/gitlab/config/initializers/1_settings.rb:38:in `<top (required)>' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `block in load' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:588:in `block (2 levels) in <class:Engine>' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:587:in `each' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:587:in `block in <class:Engine>' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing' /home/git/gitlab/config/environment.rb:5:in `<top (required)>' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require_with_backports' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/application.rb:103:in `require_environment!' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/application.rb:297:in `block (2 levels) in initialize_tasks' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/sprockets/assets.rake:93:in `block (2 levels) in <top (required)>' Tasks: TOP => environment (See full trace by running task with --trace) rake aborted! Command failed with status (1): [/usr/local/bin/ruby /home/git/gitlab/vendo...] /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/sprockets/assets.rake:12:in `ruby_rake_task' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task' /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/sprockets/assets.rake:80:in `block (2 levels) in <top (required)>' Tasks: TOP => assets:clean (See full trace by running task with --trace)
root@ubuntu-gitlab:/home/git/gitlab# sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
/usr/local/bin/ruby /home/git/gitlab/vendor/bundle/ruby/2.0.0/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
(<unknown>): found character that cannot start any token while scanning for the next token at line 150 column 1
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:103:in `initialize'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:60:in `new'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:60:in `instance'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:37:in `[]'
/home/git/gitlab/config/initializers/1_settings.rb:38:in `<top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `block in load'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:588:in `block (2 levels) in <class:Engine>'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:587:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:587:in `block in <class:Engine>'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/git/gitlab/config/environment.rb:5:in `<top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require_with_backports'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/application.rb:103:in `require_environment!'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/application.rb:297:in `block (2 levels) in initialize_tasks'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/sprockets/assets.rake:93:in `block (2 levels) in <top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
Tasks: TOP => environment
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/usr/local/bin/ruby /home/git/gitlab/vendo...]
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
root@ubuntu-gitlab:/home/git/gitlab#
root@ubuntu-gitlab:/home/git/gitlab# sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production
rake aborted!
(<unknown>): found character that cannot start any token while scanning for the next token at line 150 column 1
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:103:in `initialize'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:60:in `new'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:60:in `instance'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:37:in `[]'
/home/git/gitlab/config/initializers/1_settings.rb:38:in `<top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `block in load'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:588:in `block (2 levels) in <class:Engine>'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:587:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:587:in `block in <class:Engine>'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/git/gitlab/config/environment.rb:5:in `<top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/backports-3.3.2/lib/backports/tools.rb:328:in `require_with_backports'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/application.rb:103:in `require_environment!'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/application.rb:297:in `block (2 levels) in initialize_tasks'
Tasks: TOP => cache:clear => environment
(See full trace by running task with --trace)
root@ubuntu-gitlab:/home/git/gitlab#

其它步骤都是正常的。然后到了第8步的时候启动Gitlab就出现了如下错误:

root@ubuntu-gitlab:/home/git/gitlab# sudo service gitlab start
Removing stale Unicorn web server pid. This is most likely caused by the web server crashing the last time it ran.
Removing stale Sidekiq web server pid. This is most likely caused by the Sidekiq crashing the last time it ran.
Starting the GitLab Unicorn web server...
master failed to start, check stderr log for details
Starting the GitLab Sidekiq event dispatcher...
The GitLab Unicorn webserver is not running.
The GitLab Sidekiq job dispatcher with pid 4030 is running.

我搜了一下有尝试用pkill将进程杀掉,不过好像都不太管用的样子,不知道是不是我的方法没用对的原因。之前从5.4升级到6.0的时候也碰上过同样的错误,然后有看到Gitlab 的Github issue 上有人吐槽这个问题,没过两天我再重新按照教程步骤来就已经正常了。不过这回都到6.4了,也没看见人吐槽这个问题,所以想应该不是程序问题是我这边的问题吧。

另外因为升级失败,本来想暂时退回到6.1去的结果也同样出现了这个报错,之前从5.4升级到6.0的时候我是按照教程顺利退回到5.4了的。

另外,这是目前的LOG日志文件:http://imnerd.org/lab/unicorn.stderr.log

情况就是以上这些,还请各位懂的答疑解惑,谢谢!

怪我咯
怪我咯

走同样的路,发现不同的人生

모든 응답(1)
迷茫

config 폴더, 특히 database.yml의 관련 구성이 올바른지 확인하세요. 데이터베이스 구성에 문제가 있어 migration 실행이 실패하는 것 같습니다.
업그레이드 전 gitlab을 프로덕션 환경(RAILS_ENV=production)에서 실행하셨는지, 개발 환경(RAILS_ENV=development)에서 실행하셨는지 모르겠습니다. 개발 환경이라면 실제로 sudo -u git -H bundle exec rake db:migrate RAILS_ENV=development를 실행해야 합니다.
또는 개발 및 프로덕션에 동일한 데이터베이스 구성을 사용해 보십시오(물론 모범 사례는 아닙니다).

으아아아
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿