![gitlab 설치 중 gitlab-ctl reconfigure 에서 Expected process to exit with [0], but received '137' 오류](/tutorial-cover/post/gitlab 설치 중 gitlab-ctl reconfigure 에서 Expected process to exit with [0] but received '137' 오류.png)
gitlab 설치 중 gitlab-ctl reconfigure 에서 Expected process to exit with [0], but received '137' 오류
2022-10-05 last update
6 minutes reading GitLab개요
GCP의 Compute에서 gitlab을 세우려고하면,
도중에 에러가 나왔기 때문에.
앞으로 gitlab 서 있지 않을 생각도 있지만 지견으로 쓴다.
설치 절차로
gitlab-ctl reconfigure
할 필요가 있지만 오류가 발생했습니다.
이 명령은 내부적으로 chef가 움직이고 있습니다.
chef가 실행 한 bash로 오류를 토하고 있습니다.
환경
이 시점에서 찾는 사람도 있을지도 모른다.
Google Cloud Platform f1-micro(vCPU x 1, 메모리 0.6GB)
OS: Linux CentOS7.3
오류 전문
Rails에서 데이터베이스를 마이그레이션 할 때,
정상 종료해야하는 경우 [137]를 반환하고 비정상적으로 종료됩니다.
137은 kill -9 (SIGKILL)되었을 때 반환되는 것 같습니다.
Recipe: gitlab::database_migrations
* bash[migrate gitlab-rails database] action run
================================================================================
Error executing action `run` on resource 'bash[migrate gitlab-rails database]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '137'
---- Begin output of "bash" "/tmp/chef-script20170613-10673-15jo1yq" ----
STDOUT:
STDERR:
---- End output of "bash" "/tmp/chef-script20170613-10673-15jo1yq" ----
Ran "bash" "/tmp/chef-script20170613-10673-15jo1yq" returned 137
Resource Declaration:
---------------------
# In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/database_migrations.rb
51: bash "migrate gitlab-rails database" do
52: code <<-EOH
53: set -e
54: log_file="#{node['gitlab']['gitlab-rails']['log_directory']}/gitlab-rails-db-migrate-$(date +%Y-%m-%d-
55: umask 077
56: /opt/gitlab/bin/gitlab-rake gitlab:db:configure 2>& 1 | tee ${log_file}
57: STATUS=${PIPESTATUS[0]}
58: echo $STATUS > #{db_migrate_status_file}
59: exit $STATUS
60: EOH
61: environment env_variables unless env_variables.empty?
62: notifies :run, 'execute[enable pg_trgm extension]', :before if omnibus_helper.service_enabled?('postgres
63: notifies :run, "execute[clear the gitlab-rails cache]", :immediately
64: dependent_services.each do |svc|
65: notifies :restart, svc, :immediately
66: end
67: not_if "(test -f #{db_migrate_status_file}) && (cat #{db_migrate_status_file} | grep -Fx 0)"
68: only_if { node['gitlab']['gitlab-rails']['auto_migrate'] }
69: end
Compiled Resource:
------------------
# Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/database_migrations.rb:51:in `from_
bash("migrate gitlab-rails database") do
action [:run]
updated true
retries 0
retry_delay 2
default_guard_interpreter :default
command "migrate gitlab-rails database"
backup 5
returns 0
code " set -e\n log_file=\"/var/log/gitlab/gitlab-rails/gitlab-rails-db-migrate-$(date +%Y-%m-%d-%H-%M-tlab:db:configure 2>& 1 | tee ${log_file}\n STATUS=${PIPESTATUS[0]}\n echo $STATUS > /var/opt/gitlab/gitlab-r803-915a0aa\n exit $STATUS\n"
interpreter "bash"
declared_type :bash
cookbook_name "gitlab"
recipe_name "database_migrations"
not_if "(test -f /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-873248b1f0d3a7a5535771a3a1635803-915amigrate-873248b1f0d3a7a5535771a3a1635803-915a0aa | grep -Fx 0)"
only_if { #code block }
end
Platform:
---------
x86_64-linux
원인
137은 kill -9 (SIGKILL)되었을 때 반환되는 것 같습니다.
/var/log/messages를 보면,
Jun 13 **:**:** [hostname] kernel: Out of memory: Kill process 12897 (bundle) score 321 or sacrifice child
Jun 13 **:**:** [hostname] kernel: Killed process 12897 (bundle) total-vm:496584kB, anon-rss:193164kB, file-rss:0kB, shmem-rss:0kB
메모리가 없다…
해결
가상 메모리를 파일로 만들어서 어떻게 됐다.
dd if=/dev/zero of=/swap bs=1M count=1024
mkswap /swap
swapon /swap