2014-05-27 08:12:15 -04:00
# Maintenance
2014-04-24 18:48:22 -04:00
## Gather information about GitLab and the system it runs on
2012-12-05 12:27:54 -05:00
2014-04-24 18:48:22 -04:00
This command gathers information about your GitLab installation and the System it runs on. These may be useful when asking for help or reporting issues.
2012-12-05 12:27:54 -05:00
```
2014-06-23 04:38:22 -04:00
# omnibus-gitlab
sudo gitlab-rake gitlab:env:info
2015-01-28 01:50:31 -05:00
# installation from source
2013-01-05 16:36:04 -05:00
bundle exec rake gitlab:env:info RAILS_ENV=production
2012-12-05 12:27:54 -05:00
```
Example output:
```
System information
2015-01-28 02:07:27 -05:00
System: Debian 7.8
Current User: git
Using RVM: no
Ruby Version: 2.1.5p273
Gem Version: 2.4.3
Bundler Version: 1.7.6
Rake Version: 10.3.2
Sidekiq Version: 2.17.8
2012-12-06 15:16:48 -05:00
GitLab information
2015-01-28 02:07:27 -05:00
Version: 7.7.1
Revision: 41ab9e1
Directory: /home/git/gitlab
DB Adapter: postgresql
URL: https://gitlab.example.com
HTTP Clone URL: https://gitlab.example.com/some-project.git
SSH Clone URL: git@gitlab.example.com:some-project.git
Using LDAP: no
Using Omniauth: no
2012-12-05 12:27:54 -05:00
2013-02-25 14:45:33 -05:00
GitLab Shell
2015-01-28 02:07:27 -05:00
Version: 2.4.1
Repositories: /home/git/repositories/
Hooks: /home/git/gitlab-shell/hooks/
Git: /usr/bin/git
2012-12-05 12:27:54 -05:00
```
2014-04-24 18:48:22 -04:00
## Check GitLab configuration
2012-12-02 07:56:04 -05:00
2012-12-12 17:55:09 -05:00
Runs the following rake tasks:
2014-04-24 18:48:22 -04:00
- `gitlab:gitlab_shell:check`
- `gitlab:sidekiq:check`
- `gitlab:app:check`
2012-12-12 17:55:09 -05:00
It will check that each component was setup according to the installation guide and suggest fixes for issues found.
You may also have a look at our [Trouble Shooting Guide ](https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide ).
2012-12-02 07:56:04 -05:00
```
2014-06-23 04:38:22 -04:00
# omnibus-gitlab
sudo gitlab-rake gitlab:check
2015-01-28 01:50:31 -05:00
# installation from source
2013-01-05 16:36:04 -05:00
bundle exec rake gitlab:check RAILS_ENV=production
2012-12-02 07:56:04 -05:00
```
2014-07-07 08:41:02 -04:00
NOTE: Use SANITIZE=true for gitlab:check if you want to omit project names from the output.
2012-12-02 07:56:04 -05:00
Example output:
```
2012-12-12 17:55:09 -05:00
Checking Environment ...
2013-04-14 16:17:06 -04:00
Git configured for git user? ... yes
2012-12-12 17:55:09 -05:00
Has python2? ... yes
python2 is supported version? ... yes
Checking Environment ... Finished
2013-05-19 05:13:39 -04:00
Checking GitLab Shell ...
2012-12-12 17:55:09 -05:00
2013-04-14 16:17:06 -04:00
GitLab Shell version? ... OK (1.2.0)
2012-12-12 17:55:09 -05:00
Repo base directory exists? ... yes
2013-04-14 16:17:06 -04:00
Repo base directory is a symlink? ... no
2012-12-12 17:55:09 -05:00
Repo base owned by git:git? ... yes
2012-12-30 21:46:28 -05:00
Repo base access is drwxrws---? ... yes
2012-12-12 17:55:09 -05:00
post-receive hook up-to-date? ... yes
2013-04-14 16:17:06 -04:00
post-receive hooks in repos are links: ... yes
2012-12-12 17:55:09 -05:00
2013-05-19 05:13:39 -04:00
Checking GitLab Shell ... Finished
2012-12-12 17:55:09 -05:00
2013-04-14 16:17:06 -04:00
Checking Sidekiq ...
2012-12-12 17:55:09 -05:00
Running? ... yes
2013-04-14 16:17:06 -04:00
Checking Sidekiq ... Finished
2012-12-12 17:55:09 -05:00
Checking GitLab ...
Database config exists? ... yes
2013-04-14 16:17:06 -04:00
Database is SQLite ... no
2012-12-12 17:55:09 -05:00
All migrations up? ... yes
GitLab config exists? ... yes
2013-04-14 16:17:06 -04:00
GitLab config outdated? ... no
2012-12-12 17:55:09 -05:00
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
2013-04-14 16:17:06 -04:00
Projects have satellites? ... yes
Redis version >= 2.0.0? ... yes
2012-12-12 17:55:09 -05:00
Checking GitLab ... Finished
2012-12-02 07:56:04 -05:00
```
2014-08-04 16:32:41 -04:00
## (Re-)Create satellite repositories
2012-12-20 15:52:26 -05:00
2014-08-04 16:32:41 -04:00
This will create satellite repositories for all your projects.
2014-04-24 18:48:22 -04:00
2014-09-02 01:48:57 -04:00
If necessary, remove the `repo_satellites` directory and rerun the commands below.
2012-12-20 15:52:26 -05:00
```
2014-09-02 01:48:57 -04:00
sudo -u git -H mkdir -p /home/git/gitlab-satellites
sudo -u git -H bundle exec rake gitlab:satellites:create RAILS_ENV=production
sudo chmod u+rwx,g=rx,o-rwx /home/git/gitlab-satellites
2012-12-20 15:52:26 -05:00
```
2014-11-20 06:18:28 -05:00
## Rebuild authorized_keys file
In some case it is necessary to rebuild the `authorized_keys` file.
2014-11-20 06:22:46 -05:00
For Omnibus-packages:
2014-11-20 06:18:28 -05:00
```
sudo gitlab-rake gitlab:shell:setup
```
For installations from source:
```
2014-11-20 06:22:46 -05:00
cd /home/git/gitlab
2014-11-20 06:18:28 -05:00
sudo -u git -H bundle exec rake gitlab:shell:setup RAILS_ENV=production
```
```
This will rebuild an authorized_keys file.
You will lose any data stored in authorized_keys file.
Do you want to continue (yes/no)? yes
2015-01-28 02:07:27 -05:00
```
## Clear redis cache
2015-06-03 05:26:57 -04:00
If for some reason the dashboard shows wrong information you might want to
2015-01-28 02:07:27 -05:00
clear Redis' cache.
For Omnibus-packages:
```
sudo gitlab-rake cache:clear
```
For installations from source:
```
cd /home/git/gitlab
sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production
```
## Precompile the assets
2014-11-20 06:18:28 -05:00
2015-01-28 02:07:27 -05:00
Sometimes during version upgrades you might end up with some wrong CSS or
missing some icons. In that case, try to precompile the assets again.
2015-06-19 10:19:56 -04:00
Note that this only applies to source installations and does NOT apply to
omnibus packages.
2015-01-28 02:07:27 -05:00
For installations from source:
```
cd /home/git/gitlab
sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
2014-11-20 06:18:28 -05:00
```
2015-06-19 10:19:56 -04:00
For omnibus versions, the unoptimized assets (JavaScript, CSS) are frozen at
the release of upstream GitLab. The omnibus version includes optimized versions
of those assets. Unless you are modifying the JavaScript / CSS code on your
production machine after installing the package, there should be no reason to redo
rake assets:precompile on the production machine. If you suspect that assets
have been corrupted, you should reinstall the omnibus package.