Gitlab Setup Could not spawn process for application /opt/gitlab/embedded/service/gitlab-rails

504 views Asked by At

I am trying to setup Gitlab on centos 7 server, and trying use existing nginx to configure many domains. but it has error about gitlab-rails, but i don't know what it is.

my /var/log/nginx/error.log show error:

App 13682 stdout: App 13682 stdout: [ E 2017-08-31 10:41:44.4250 9768/T15 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /opt/gitlab/embedded/service/gitlab-rails: An error o$ Error ID: 24c0d6b5 Error details saved to: /tmp/passenger-error-PkX0HB.html Message from application: cannot load such file -- bundler/setup (LoadError) /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require' /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:inrequire' /usr/share/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:430:in activate_gem' /usr/share/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:297:inblock in run_load_path_setup_code' /usr/share/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:435:in running_bundler' /usr/share/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:296:inrun_load_path_setup_code' /usr/share/passenger/helper-scripts/rack-preloader.rb:100:in preload_app' /usr/share/passenger/helper-scripts/rack-preloader.rb:156:in' /usr/share/passenger/helper-scripts/rack-preloader.rb:30:in <module:PhusionPassenger>' /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in' [ E 2017-08-31 10:41:44.4319 9768/T3 age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 1-11] Cannot checkout session because a spawning error occurred. The identifier

my gitlab configure /etc/gitlab/gitlab.rb:

external_url 'http://gitlab.ifbuyer.com'
nginx['enable'] = false
unicorn['enable'] = false
web_server['external_users'] = ['nginx']
gitlab_rails['internal_api_url'] = 'http://gitlab.ifbuyer.com'
nginx['redirect_http_to_https'] = true

my gitlab.ifbuyer.com.conf is followed by the link https://docs.gitlab.com/omnibus/settings/nginx.html#using-an-existing-passenger-nginx-installation

I am using gitlab-ce-9.5.0-ce.0.el7.x86_64

Any help would be appreciated. Thanks you so much

1

There are 1 answers

0
Tarun Lalwani On BEST ANSWER

You should try and run Gitlab using docker, that will help you focus on just the nginx part

You can instal docker and docker-compose using below script

curl -SsL https://get.docker.com | sh
pip install docker-compose

Then create a folder for gitlab and create a docker-compose.yml file

docker-compose.yml

version: '3'
services:
  gitlab:
    image: gitlab/gitlab-ce:${GITLAB_VERSION}
    hostname: gitlab.example.com
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'https://gitlab.example.com'
        gitlab_rails['gitlab_shell_ssh_port'] = 22
    ports:
      - "22:22"
      - "80:80"
      - "443:443"
    volumes:
      - ./config:/etc/gitlab
      - ./logs:/var/log/gitlab
      - ./data:/var/opt/gitlab
      - ./scrtips:/scripts

Latest GITLAB_VERSION is 9.5.2-ce.0. So you can either replace it in file or export that before running the above using below commands

$ GITLAB_VERSION='9.5.2-ce.0' docker-compose up

Once the server is up it will be accessible at gitlab.example.com, either make a host entry or use IP in config. Then you can proxy_pass it from your nginx.