meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
git:gitlab [2016/04/26 12:07]
niziak
git:gitlab [2021/12/10 10:45] (current)
niziak
Line 1: Line 1:
-====== ​gitlab ​======+====== ​Gitlab ​======
  
 Download location: [[https://​packages.gitlab.com/​gitlab/​gitlab-ce]] \\ Download location: [[https://​packages.gitlab.com/​gitlab/​gitlab-ce]] \\
 Archive versions: [[https://​about.gitlab.com/​downloads/​archives/​]] \\ Archive versions: [[https://​about.gitlab.com/​downloads/​archives/​]] \\
 Configure Gitlab'​s web server: [[https://​gitlab.com/​gitlab-org/​omnibus-gitlab/​blob/​master/​doc/​settings/​nginx.md]] \\ Configure Gitlab'​s web server: [[https://​gitlab.com/​gitlab-org/​omnibus-gitlab/​blob/​master/​doc/​settings/​nginx.md]] \\
 +
 +
 +Get installed version info
 +<code bash>​gitlab-rake gitlab:​env:​info</​code>​
 +
 +See logs:
 +<code bash>
 +gitlab-ctl tail # all logs
 +
 +tail -f /​var/​log/​gitlab/​gitlab-rails/​production.log
 +</​code>​
 +
 +<code bash>​gitlab-rake gitlab:​app:​check</​code>​
 +<code bash>​gitlab-rake gitlab --tasks</​code>​
 +<code bash>
 +gitlab-rails console
 +</​code>​
 +
 +Restart services without downtime
 +<code bash>
 +sudo gitlab-ctl hup unicorn
 +sudo gitlab-ctl hup puma
 +sudo gitlab-ctl restart sidekiq
 +sudo gitlab-ctl hup nginx
 +</​code>​
 +
 +===== Start / stop / enable / disable =====
  
 <code bash> <code bash>
 gitlab-ctl stop gitlab-ctl stop
 gitlab-ctl start gitlab-ctl start
 +
 +systemctl disable gitlab-runsvdir.service
 +systemctl enable gitlab-runsvdir.service
 </​code>​ </​code>​
  
-Get installed version info 
-<code bash>​gitlab-rake gitlab:​env:​info</​code>​ 
  
-<code bash>​gitlab-ctl tail</​code>​+ 
 ===== Configuration ===== ===== Configuration =====
-<file | /​etc/​gitlab/​gitlab.rb>​+<​file ​ruby | /​etc/​gitlab/​gitlab.rb>​
  
 # will be started on :80 port # will be started on :80 port
 external_url "​http://​gitlab.example.com"​ external_url "​http://​gitlab.example.com"​
  
 +external_port "​8888"​
  
 # will be started on :443 port # will be started on :443 port
Line 38: Line 68:
 </​file>​ </​file>​
  
-<​code>​sudo gitlab-ctl reconfigure</​code>​+<file ruby | /​etc/​gitlab/​gitlab.rb>​ 
 +gitlab_rails['​smtp_enable'​] = true 
 +gitlab_rails['​smtp_address'​] = "​smtp.gmail.com"​ 
 +gitlab_rails['​smtp_user_name'​] = "​username"​ 
 +gitlab_rails['​smtp_password'​] = "​password"​ 
 +gitlab_rails['​smtp_domain'​] = "​gmail.com"​ 
 +gitlab_rails['​smtp_authentication'​] = "​login"​ 
 +gitlab_rails['​smtp_enable_starttls_auto'​] = true 
 + 
 +# If your SMTP server does not like the default 'From: gitlab@localhost'​ you 
 +# can change the '​From'​ with this setting. 
 +gitlab_rails['​gitlab_email_from'​] = '​gitlab.mydomain.org'​ 
 +gitlab_rails['​gitlab_email_display_name'​] = '​MyDomain.org Gitlab'​ 
 +gitlab_rails['​gitlab_email_reply_to'​] = '​username@gmail.com'​ 
 +</​file>​ 
 + 
 +<​code ​bash>sudo gitlab-ctl reconfigure</​code>​
  
 ===== Uninstall ===== ===== Uninstall =====
Line 49: Line 95:
 </​code>​ </​code>​
  
-===== Making backup ===== 
-  * block gitlab access (but leave maintenance web page) 
-    * gitlab-ctl deploy-page up 
-    * sudo gitlab-ctl stop unicorn 
-    * sudo gitlab-ctl stop sidekiq 
-  * Store configuration file manually (/​etc/​gitlab) 
-  * Trigger backup creation 
-    * ''​gitlab-rake gitlab:​backup:​create''​ 
- 
-  * Start gitlab 
-    * ''​gitlab-ctl start''​ 
-    * ''​gitlab-ctl deploy-page down''​ 
- 
-===== Restoring backup ===== 
-  * install exactly the same version from backup comes 
-    * to wrap ''​initctl''​ with ''​systemctl'',​ use [[https://​gist.github.com/​zorael/​8907216]] 
-  * install default gitlab package and make sure it is running 
-    * use /etc/gitlab from backup 
-    * run ''​gitlab-ctl reconfigure''​ 
-  * stop gitlab 
-    * ''​sudo gitlab-ctl stop unicorn''​ 
-    * ''​sudo gitlab-ctl stop sidekiq''​ 
-  * Restore backup 
-    * ''​sudo gitlab-rake gitlab:​backup:​restore''​ 
-    * OR ''​sudo gitlab-rake gitlab:​backup:​restore BACKUP=1393513186''​ 
-  * Start GitLab 
-    * ''​sudo gitlab-ctl start''​ 
-  * Check GitLab 
-    * ''​sudo gitlab-rake gitlab:​check SANITIZE=true''​ 
  
  
Line 128: Line 145:
   * [[gitlab#​Restoring backup|restore backup]]   * [[gitlab#​Restoring backup|restore backup]]
  
 +===== Issues =====
  
-===== FQDN issue =====+==== undefined method `tree' for #<​Rugged::​Tag ==== 
 + 
 +After update ''​gitlab-ce:​amd64 12.7.6-ce.0''​ to ''​12.8.1-ce.0''​. 
 +Problem browsing repo files when TAG is selected. 
 +<code bash> 
 +tail -f /​var/​log/​gitlab/​gitlab-rails/​production.log 
 +</​code>​ 
 + 
 +<​code>​ 
 +NoMethodError (undefined method `tree' for #<​Rugged::​Tag::​Annotation:​0x00007f8981373c70>​):​ 
 +  lib/​gitlab/​git/​rugged_impl/​tree.rb:​79:​in `get_tree_entries_from_rugged'​ 
 +  lib/​gitlab/​git/​rugged_impl/​tree.rb:​37:​in `tree_entries_from_rugged'​ 
 +  lib/​gitlab/​git/​rugged_impl/​tree.rb:​26:​in `tree_entries_with_flat_path_from_rugged'​ 
 +  lib/​gitlab/​git/​rugged_impl/​use_rugged.rb:​28:​in `block in execute_rugged_call'​ 
 +  lib/​gitlab/​gitaly_client/​storage_settings.rb:​31:​in `block in allow_disk_access'​ 
 +  lib/​gitlab/​temporarily_allow.rb:​9:​in `temporarily_allow'​ 
 +  lib/​gitlab/​gitaly_client/​storage_settings.rb:​31:​in `allow_disk_access'​ 
 +  lib/​gitlab/​git/​rugged_impl/​use_rugged.rb:​25:​in `execute_rugged_call'​ 
 +  lib/​gitlab/​git/​rugged_impl/​tree.rb:​19:​in `tree_entries'​ 
 +  lib/​gitlab/​git/​tree.rb:​21:​in `where'​ 
 +  app/​models/​tree.rb:​17:​in `initialize'​ 
 +  app/​models/​repository.rb:​673:​in `new'​ 
 +  app/​models/​repository.rb:​673:​in `tree'​ 
 +  app/​graphql/​resolvers/​tree_resolver.rb:​23:​in `resolve'​ 
 +  lib/​gitlab/​graphql/​generic_tracing.rb:​40:​in `with_labkit_tracing'​ 
 +  lib/​gitlab/​graphql/​generic_tracing.rb:​30:​in `platform_trace'​ 
 +  lib/​gitlab/​graphql/​generic_tracing.rb:​40:​in `with_labkit_tracing'​ 
 +  lib/​gitlab/​graphql/​generic_tracing.rb:​30:​in `platform_trace'​ 
 +  lib/​gitlab/​graphql/​generic_tracing.rb:​40:​in `with_labkit_tracing'​ 
 +  lib/​gitlab/​graphql/​generic_tracing.rb:​30:​in `platform_trace'​ 
 +  app/​graphql/​gitlab_schema.rb:​39:​in `multiplex'​ 
 +  app/​controllers/​graphql_controller.rb:​41:​in `execute_multiplex'​ 
 +  app/​controllers/​graphql_controller.rb:​19:​in `execute'​ 
 +  app/​controllers/​application_controller.rb:​478:​in `set_current_admin'​ 
 +  lib/​gitlab/​i18n.rb:​55:​in `with_locale'​ 
 +  lib/​gitlab/​i18n.rb:​61:​in `with_user_locale'​ 
 +  app/​controllers/​application_controller.rb:​463:​in `set_locale'​ 
 +  lib/​gitlab/​application_context.rb:​46:​in `block in use' 
 +  lib/​gitlab/​application_context.rb:​46:​in `use'​ 
 +  lib/​gitlab/​application_context.rb:​19:​in `with_context'​ 
 +  app/​controllers/​application_controller.rb:​454:​in `set_current_context'​ 
 +  lib/​gitlab/​error_tracking.rb:​34:​in `with_context'​ 
 +  app/​controllers/​application_controller.rb:​554:​in `sentry_context'​ 
 +  lib/​gitlab/​request_profiler/​middleware.rb:​17:​in `call'​ 
 +  lib/​gitlab/​middleware/​go.rb:​20:​in `call'​ 
 +  lib/​gitlab/​etag_caching/​middleware.rb:​13:​in `call'​ 
 +  lib/​gitlab/​middleware/​multipart.rb:​117:​in `call'​ 
 +  lib/​gitlab/​middleware/​read_only/​controller.rb:​53:​in `call'​ 
 +  lib/​gitlab/​middleware/​read_only.rb:​18:​in `call'​ 
 +  lib/​gitlab/​middleware/​basic_health_check.rb:​25:​in `call'​ 
 +  lib/​gitlab/​middleware/​request_context.rb:​23:​in `call'​ 
 +  config/​initializers/​fix_local_cache_middleware.rb:​9:​in `call'​ 
 +  lib/​gitlab/​metrics/​requests_rack_middleware.rb:​49:​in `call'​ 
 +  lib/​gitlab/​middleware/​release_env.rb:​12:​in `call'​ 
 +</​code>​ 
 +==== /​var/​opt/​gitlab perm ==== 
 + 
 +[[https://​gitlab.com/​gitlab-org/​omnibus-gitlab/​issues/​2374]] 
 +[[https://​github.com/​gitlabhq/​omnibus-gitlab/​blob/​master/​docker/​assets/​update-permissions]] 
 +[[https://​gitlab.com/​gitlab-org/​omnibus-gitlab/​blob/​master/​docker/​assets/​update-permissions]] 
 + 
 +==== FQDN issue ====
 ERROR: External URL must include a FQDN ERROR: External URL must include a FQDN
 <file | external_url = '​gitlab.thefallenphoenix.net'>​ <file | external_url = '​gitlab.thefallenphoenix.net'>​
 external_url = '​gitlab.thefallenphoenix.net'​ external_url = '​gitlab.thefallenphoenix.net'​
 </​file>​ </​file>​
 +
 +==== 500 error webhooks ====
 +
 +After pressing Test --> Push events, gitlab shows 500 ERROR page.
 +<​code>​
 +# gitlab-ctl tail
 +
 +==> /​var/​log/​gitlab/​gitlab-rails/​production.log <==
 +
 +URI::​InvalidURIError (URI::​InvalidURIError):​
 +  lib/​gitlab/​proxy_http_connection_adapter.rb:​14:​in `connection'​
 +  app/​services/​web_hook_service.rb:​73:​in `make_request'​
 +  app/​services/​web_hook_service.rb:​26:​in `execute'​
 +  app/​models/​hooks/​web_hook.rb:​10:​in `execute'​
 +  app/​services/​test_hooks/​base_service.rb:​22:​in `block in execute'​
 +</​code>​
 +<code bash>
 +
 +New security settigns was added. To allow remote network operations you should enable it in admin settings:
 +Outbound requests --> Allow requests to the local network from hooks and services
 +
 +
 +gitlab-rake check
 +</​code>​
 +
 +==== [WARNING] Executing 4:Deadline Exceeded ====
 +
 +During backup:
 +<​code>​
 +...
 + * project/​repo ... [WARNING] Executing 4:Deadline Exceeded
 +Ignoring error on project/​repo - Failed to backup repo
 +[DONE]
 +...
 +</​code>​
 +
 +[[https://​gitlab.com/​gitlab-org/​gitlab-ce/​issues/​46721]]
 +[[https://​gitlab.com/​gitlab-org/​gitlab-ce/​issues/​49690]]
 +
 +Fixed [[https://​gitlab.com/​gitlab-org/​gitlab-ce/​merge_requests/​20810/​diffs]]
 +
 +//The issue originally refers to the HasLocalBranches RPC which operates under the 'fast timeout'​ with a default of 10s. That is a very very generous timeout for running git for-each-ref --count=1 refs/heads. The most likely cause for the original issue is some sort of small outage, which is exactly what the timeouts are for.//
 +
 +Introduced already in version 12.4.0 [[https://​gitlab.com/​gitlab-org/​gitlab-foss/​issues/​67471|After upgrading to 12.4.0, timeouts while backing up large repos cam back]]
 +
 +