Ruby_block[authorize Grafana with GitLab] action run timeouts

I am trying to install gitlab on my server, which is running Debian 10. I have successfully added the repository and installed with apt. I then changed the configuration file to use my email address for let’s encrypt and changed the external_url to the subdomain I want it on. I run gitlab-ctl reconfigure and I get the following error:

================================================================================
Error executing action `run` on resource 'ruby_block[authorize Grafana with GitLab]'
================================================================================

Mixlib::ShellOut::CommandTimeout
--------------------------------
Command timed out after 600s:
Command exceeded allowed execution time, process terminated
---- Begin output of /opt/gitlab/bin/gitlab-rails runner -e production 'app = Doorkeeper::Application.where(redirect_uri: "https://git.techiedamien.xyz/-/grafana/login/gitlab", name: "GitLab Grafana").first_or_create;puts app.uid.concat(" ").concat(app.secret);' ----
STDOUT: 
STDERR: 
---- End output of /opt/gitlab/bin/gitlab-rails runner -e production 'app = Doorkeeper::Application.where(redirect_uri: "https://git.techiedamien.xyz/-/grafana/login/gitlab", name: "GitLab Grafana").first_or_create;puts app.uid.concat(" ").concat(app.secret);' ----
Ran /opt/gitlab/bin/gitlab-rails runner -e production 'app = Doorkeeper::Application.where(redirect_uri: "https://git.techiedamien.xyz/-/grafana/login/gitlab", name: "GitLab Grafana").first_or_create;puts app.uid.concat(" ").concat(app.secret);' returned 

Cookbook Trace:
---------------
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/shell_out_helper.rb:6:in `do_shell_out'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/helpers/authorizer_helper.rb:6:in `query_gitlab_rails'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/helpers/grafana_helper.rb:12:in `authorize_with_gitlab'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/monitoring/recipes/grafana.rb:97:in `block (2 levels) in from_file'

Resource Declaration:
---------------------
# In /opt/gitlab/embedded/cookbooks/cache/cookbooks/monitoring/recipes/grafana.rb

 95:   ruby_block "authorize Grafana with GitLab" do
 96:     block do
 97:       GrafanaHelper.authorize_with_gitlab(external_url)
 98:     end
 99:     # Try connecting to GitLab only if it is enabled and on this node
100:     only_if { node['gitlab']['gitlab-rails']['enable'] }
101:   end
102: end

Compiled Resource:
------------------
# Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/monitoring/recipes/grafana.rb:95:in `from_file'

ruby_block("authorize Grafana with GitLab") do
  action [:run]
  default_guard_interpreter :default
  declared_type :ruby_block
  cookbook_name "monitoring"
  recipe_name "grafana"
  block #<Proc:0x00005611ec9da388@/opt/gitlab/embedded/cookbooks/cache/cookbooks/monitoring/recipes/grafana.rb:96>
  block_name "authorize Grafana with GitLab"
  only_if { #code block }
end

System Info:
------------
chef_version=15.9.17
platform=debian
platform_version=10
ruby=ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]
program_name=/opt/gitlab/embedded/bin/chef-client
executable=/opt/gitlab/embedded/bin/chef-client


Running handlers:
There was an error running gitlab-ctl reconfigure:

ruby_block[authorize Grafana with GitLab] (monitoring::grafana line 95) had an error: Mixlib::ShellOut::CommandTimeout: Command timed out after 600s:
Command exceeded allowed execution time, process terminated
---- Begin output of /opt/gitlab/bin/gitlab-rails runner -e production 'app = Doorkeeper::Application.where(redirect_uri: "https://git.techiedamien.xyz/-/grafana/login/gitlab", name: "GitLab Grafana").first_or_create;puts app.uid.concat(" ").concat(app.secret);' ----
STDOUT: 
STDERR: 
---- End output of /opt/gitlab/bin/gitlab-rails runner -e production 'app = Doorkeeper::Application.where(redirect_uri: "https://git.techiedamien.xyz/-/grafana/login/gitlab", name: "GitLab Grafana").first_or_create;puts app.uid.concat(" ").concat(app.secret);' ----
Ran /opt/gitlab/bin/gitlab-rails runner -e production 'app = Doorkeeper::Application.where(redirect_uri: "https://git.techiedamien.xyz/-/grafana/login/gitlab", name: "GitLab Grafana").first_or_create;puts app.uid.concat(" ").concat(app.secret);' returned 

Running handlers complete
Chef Infra Client failed. 0 resources updated in 19 minutes 37 seconds

It seems like it is timing out, but I am not sure why. If anyone has any insight, I would be very grateful!

1 Like

Sorry to hear you’re having problems getting GitLab installed. Thanks for your patience.

I suggest we get it installed and running with Grafana disabled at first, and then we can enable Grafana separately once we have your instance up and running.

To do this, please:

  • set grafana['enable'] = false in your gitlab.rb
  • try to reconfigure again - gitlab-ctl reconfigure

If this doesn’t work, can you please share any error messages or relevant details you see on your end.

Thanks in advance!

3 Likes

With 4.4K views at time of posting, this may be popular. I want to say my underlying problem was not enough memory for my VM. I repurposed my cvs server that had 1GB of memory and 2 vCPUs on VMWare. Once I upped the memory to 8GB, the install went as expected with Grafana enabled. Also, had to remove Apache for obvious reasons due to nginx. When using 1GB ‘gitlab-ctl status’ said all was ok but landing page never came up. I would just get 502. Hope this helps people out there!

faced same one.
still remains this problem…/w AWS t2.medium(4GB Mem). but t3.large(8GB Mem) is working as well.
hope this gonna be fixed soon later.

Download and install GitLab recommended 4GB of RAM…

ciao,
-susumu