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 revisionPrevious revision
Next revision
Previous revision
git:gitlab [2018/06/25 10:05] – [/var/opt/gitlab perm] niziakgit: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]] \\
Line 5: Line 5:
 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]] \\
  
-<code bash> 
-gitlab-ctl stop 
-gitlab-ctl start 
-</code> 
  
 Get installed version info Get installed version info
 <code bash>gitlab-rake gitlab:env:info</code> <code bash>gitlab-rake gitlab:env:info</code>
  
-<code bash>gitlab-ctl tail</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:app:check</code>
 <code bash>gitlab-rake gitlab --tasks</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>
 +gitlab-ctl stop
 +gitlab-ctl start
 +
 +systemctl disable gitlab-runsvdir.service
 +systemctl enable gitlab-runsvdir.service
 +</code>
 +
 +
 +
  
 ===== Configuration ===== ===== Configuration =====
Line 69: 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'' 
- 
-Make backup without repository 
-<code bash>gitlab-rake gitlab:backup:create SKIP=repositories,uploads</code> 
-For possible rake tasks to skip see into file ''/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/backup.rake''. 
-For now it cane be: ''repositories,db,builds,uploads,artifacts,lfs'' 
- 
- 
-==== Automating backups ==== 
-crontab -e 
-<code bash>0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1</code> 
- 
-==== What is in backup ==== 
-Backup file e.g.: ''1462327272_gitlab_backup.tar'' is simple tar archive with example content: 
-<code> 
-|-- artifacts.tar.gz 
-|-- backup_information.yml 
-|-- builds.tar.gz 
-|-- db 
-|   `-- database.sql.gz 
-|-- lfs.tar.gz 
-|-- repositories 
-|   |-- group1 
-|     |-- http-server.bundle 
-|     |-- kernel.bundle 
-|   |-- group2 
-|     |-- buildroot.bundle 
-|     |-- linux-stable.bundle 
-|     |-- u-boot.bundle 
-|     `-- yocto.bundle 
-|   `-- user1 
-|       |-- buildroot.bundle 
-|       |-- linux-stable.bundle 
-|       |-- linux.bundle 
-|       |-- uboot.bundle 
-`-- uploads.tar.gz 
-</code> 
-Where .bundle filesa re simple tar archives of bare git repos. 
- 
-===== 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 187: Line 147:
 ===== Issues ===== ===== Issues =====
  
 +==== 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 ==== ==== /var/opt/gitlab perm ====
  
Line 222: Line 237:
 gitlab-rake check gitlab-rake check
 </code> </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]]
 +
 +