diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-30 18:09:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-30 18:09:15 +0300 |
commit | 536aa3a1f4b96abc4ca34489bf2cbe503afcded7 (patch) | |
tree | 88d08f7dfa29a32d6526773c4fe0fefd9f2bc7d1 /doc/administration/troubleshooting | |
parent | 50ae4065530c4eafbeb7c5ff2c462c48c02947ca (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/administration/troubleshooting')
7 files changed, 60 insertions, 60 deletions
diff --git a/doc/administration/troubleshooting/debug.md b/doc/administration/troubleshooting/debug.md index b754b954391..01d143d045e 100644 --- a/doc/administration/troubleshooting/debug.md +++ b/doc/administration/troubleshooting/debug.md @@ -10,13 +10,13 @@ an SMTP server, but you're not seeing mail delivered. Here's how to check the se 1. Run a Rails console: - ```sh + ```shell sudo gitlab-rails console production ``` or for source installs: - ```sh + ```shell bundle exec rails console production ``` diff --git a/doc/administration/troubleshooting/elasticsearch.md b/doc/administration/troubleshooting/elasticsearch.md index a582e07b141..0fdd5314a9d 100644 --- a/doc/administration/troubleshooting/elasticsearch.md +++ b/doc/administration/troubleshooting/elasticsearch.md @@ -332,7 +332,7 @@ bind ports 9200/9300 so it can be used. The following is an example of running a docker container of Elasticsearch v7.2.0: -```bash +```shell docker pull docker.elastic.co/elasticsearch/elasticsearch:7.2.0 docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.2.0 ``` diff --git a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md index c4b7324ce05..7bffe00a969 100644 --- a/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md +++ b/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md @@ -30,7 +30,7 @@ should and, if needed, update the script for the latest version of GitLab. If the script you want to run is short, you can use the Rails Runner to avoid entering the rails console in the first place. Here's an example of its use: -```bash +```shell gitlab-rails runner "RAILS_COMMAND" # Example with a 2-line script @@ -130,19 +130,19 @@ end ### Check the GitLab version fast -```bash +```shell grep -m 1 gitlab /opt/gitlab/version-manifest.txt ``` ### Debugging SSH -```bash +```shell GIT_SSH_COMMAND="ssh -vvv" git clone <repository> ``` ### Debugging over HTTPS -```bash +```shell GIT_CURL_VERBOSE=1 GIT_TRACE=1 git clone <repository> ``` @@ -301,19 +301,19 @@ correctly named empty project using the steps below. Move the new repository to the empty repository: -```bash +```shell mv /var/opt/gitlab/git-data/repositories/<group>/<new-project> /var/opt/gitlab/git-data/repositories/<group>/<empty-project> ``` Make sure the permissions are correct: -```bash +```shell chown -R git:git <path-to-directory>.git ``` Clear the cache: -```bash +```shell sudo gitlab-rake cache:clear ``` @@ -489,7 +489,7 @@ User.active.count ::HistoricalData.max_historical_user_count ``` -```bash +```shell # Using curl and jq (up to a max 100, see pagination docs https://docs.gitlab.com/ee/api/#pagination curl --silent --header "Private-Token: ********************" "https://gitlab.example.com/api/v4/users?per_page=100&active" | jq --compact-output '.[] | [.id,.name,.username]' ``` @@ -995,13 +995,13 @@ See <https://github.com/mperham/sidekiq/wiki/Signals#ttin>. ### Connect to Redis (omnibus) -```sh +```shell /opt/gitlab/embedded/bin/redis-cli -s /var/opt/gitlab/redis/redis.socket ``` ### Connect to Redis (HA) -```sh +```shell /opt/gitlab/embedded/bin/redis-cli -h <host ip> -a <password> ``` @@ -1034,7 +1034,7 @@ This script will go through all the encrypted variables and count how many are n to be decrypted. Might be helpful to run on multiple nodes to see which `gitlab-secrets.json` file is most up to date: -```bash +```shell wget -O /tmp/bad-decrypt.rb https://gitlab.com/snippets/1730735/raw gitlab-rails runner /tmp/bad-decrypt.rb ``` @@ -1075,7 +1075,7 @@ two-factor authentication. This script will search for all encrypted tokens that are causing decryption errors, and update or reset as needed: -```bash +```shell wget -O /tmp/encrypted-tokens.rb https://gitlab.com/snippets/1876342/raw gitlab-rails runner /tmp/encrypted-tokens.rb ``` diff --git a/doc/administration/troubleshooting/kubernetes_cheat_sheet.md b/doc/administration/troubleshooting/kubernetes_cheat_sheet.md index 7c2c2050b12..dfd5e82a159 100644 --- a/doc/administration/troubleshooting/kubernetes_cheat_sheet.md +++ b/doc/administration/troubleshooting/kubernetes_cheat_sheet.md @@ -20,13 +20,13 @@ and they will assist you with any issues you are having. - How to authorize to your GCP project (can be especially useful if you have projects under different GCP accounts): - ```bash + ```shell gcloud auth login ``` - How to access Kubernetes dashboard: - ```bash + ```shell # for minikube: minikube dashboard —url # for non-local installations if access via Kubectl is configured: @@ -42,7 +42,7 @@ and they will assist you with any issues you are having. - How to copy a file from local machine to a pod: - ```bash + ```shell kubectl cp file-name pod-name:./destination-path ``` @@ -51,19 +51,19 @@ and they will assist you with any issues you are having. - Check logs via Kubernetes dashboard. - Check logs via Kubectl: - ```bash + ```shell kubectl logs <unicorn pod> -c dependencies ``` - How to tail all Kubernetes cluster events in real time: - ```bash + ```shell kubectl get events -w --all-namespaces ``` - How to get logs of the previously terminated pod instance: - ```bash + ```shell kubectl logs <pod-name> --previous ``` @@ -79,13 +79,13 @@ and they will assist you with any issues you are having. - Tailing logs of a separate pod. An example for a Unicorn pod: - ```bash + ```shell kubectl logs gitlab-unicorn-7656fdd6bf-jqzfs -c unicorn ``` - Tail and follow all pods that share a label (in this case, `unicorn`): - ```bash + ```shell # all containers in the unicorn pods kubectl logs -f -l app=unicorn --all-containers=true --max-log-requests=50 @@ -96,21 +96,21 @@ and they will assist you with any issues you are having. - One can stream logs from all containers at once, similar to the Omnibus command `gitlab-ctl tail`: - ```bash + ```shell kubectl logs -f -l release=gitlab --all-containers=true --max-log-requests=100 ``` - Check all events in the `gitlab` namespace (the namespace name can be different if you specified a different one when deploying the Helm chart): - ```bash + ```shell kubectl get events -w --namespace=gitlab ``` - Most of the useful GitLab tools (console, rake tasks, etc) are found in the task-runner pod. You may enter it and run commands inside or run them from the outside: - ```bash + ```shell # find the pod kubectl get pods | grep task-runner @@ -145,7 +145,7 @@ and they will assist you with any issues you are having. - How to get your initial admin password <https://docs.gitlab.com/charts/installation/deployment.html#initial-login>: - ```bash + ```shell # find the name of the secret containing the password kubectl get secrets | grep initial-root # decode it @@ -154,19 +154,19 @@ and they will assist you with any issues you are having. - How to connect to a GitLab Postgres database: - ```bash + ```shell kubectl exec -it <task-runner-pod-name> -- /srv/gitlab/bin/rails dbconsole -p ``` - How to get info about Helm installation status: - ```bash + ```shell helm status name-of-installation ``` - How to update GitLab installed using Helm Chart: - ```bash + ```shell helm repo upgrade # get current values and redirect them to yaml file (analogue of gitlab.rb values) @@ -185,7 +185,7 @@ and they will assist you with any issues you are having. - Modify the `gitlab.yaml` file. - Run the following command to apply changes: - ```bash + ```shell helm upgrade <release name> <chart path> -f gitlab.yaml ``` @@ -197,20 +197,20 @@ to those documents for details. - Install Kubectl via Homebrew: - ```bash + ```shell brew install kubernetes-cli ``` - Install Minikube via Homebrew: - ```bash + ```shell brew cask install minikube ``` - Start Minikube and configure it. If Minikube cannot start, try running `minikube delete && minikube start` and repeat the steps: - ```bash + ```shell minikube start --cpus 3 --memory 8192 # minimum amount for GitLab to work minikube addons enable ingress minikube addons enable kube-dns @@ -218,7 +218,7 @@ to those documents for details. - Install Helm via Homebrew and initialize it: - ```bash + ```shell brew install kubernetes-helm helm init --service-account tiller ``` @@ -231,7 +231,7 @@ to those documents for details. - Install the GitLab Helm Chart: - ```bash + ```shell helm repo add gitlab https://charts.gitlab.io helm install --name gitlab -f <path-to-yaml-file> gitlab/gitlab ``` diff --git a/doc/administration/troubleshooting/linux_cheat_sheet.md b/doc/administration/troubleshooting/linux_cheat_sheet.md index 853f553571c..0ad1f028f20 100644 --- a/doc/administration/troubleshooting/linux_cheat_sheet.md +++ b/doc/administration/troubleshooting/linux_cheat_sheet.md @@ -23,7 +23,7 @@ on. Contributions are welcome to help add them. ### Distro Information -```bash +```shell # Debian/Ubuntu uname -a lsb_release -a @@ -38,14 +38,14 @@ cat /etc/os-release ### Shut down or Reboot -```bash +```shell shutdown -h now reboot ``` ### Permissions -```bash +```shell # change the user:group ownership of a file/dir chown root:git <file_or_dir> @@ -55,7 +55,7 @@ chmod u+x <file> ### Files & Dirs -```bash +```shell # create a new directory and all subdirectories mkdir -p dir/dir2/dir3 @@ -71,7 +71,7 @@ sed -i 's/original-text/new-text/g' <filename> ### See all set environment variables -```bash +```shell env ``` @@ -79,7 +79,7 @@ env ### File names -```bash +```shell # search for a file in a filesystem find . -name 'filename.rb' -print @@ -95,7 +95,7 @@ history ### File contents -```bash +```shell # -B/A = show 2 lines before/after search_term grep -B 2 -A 2 search_term <filename> @@ -114,7 +114,7 @@ fgrep -R string_pattern <filename or directory> ### CLI -```bash +```shell # View command history history @@ -132,7 +132,7 @@ sudo !! ### Memory, Disk, & CPU usage -```bash +```shell # disk space info. The '-h' gives the data in human-readable values df -h @@ -157,7 +157,7 @@ top -o %CPU ### Strace -```bash +```shell # strace a process strace -tt -T -f -y -s 1024 -p <pid> @@ -200,7 +200,7 @@ can also sort based on total time, # of syscalls made, PID #, and # of child pro using the `-S` or `--sort` flag. The number of results defaults to 25 processes, but can be changed using the `-c`/`--count` option. See `--help` for full details. -```sh +```shell $ ./strace-parser strace.txt Top 25 PIDs @@ -218,7 +218,7 @@ Based on the summary, you can then view the details of syscalls made by one or m procsses using the `-p`/`--pid` for a specific process, or `-s`/`--stats` flags for a sorted list. `--stats` takes the same sorting and count options as summary. -```sh +```shell $ ./strace-parse strace.text -p 6423 PID 6423 @@ -274,7 +274,7 @@ small differences should not be considered significant. ### Ports -```bash +```shell # Find the programs that are listening on ports netstat -plnt ss -plnt @@ -283,7 +283,7 @@ lsof -i -P | grep <port> ### Internet/DNS -```bash +```shell # Show domain IP address dig +short example.com nslookup example.com @@ -302,7 +302,7 @@ curl --head --location https://example.com ## Package Management -```bash +```shell # Debian/Ubuntu # List packages @@ -332,7 +332,7 @@ rpm -qa | grep <package> ## Logs -```bash +```shell # Print last lines in log file where 'n' # is the number of lines to print tail -n /path/to/log/file diff --git a/doc/administration/troubleshooting/ssl.md b/doc/administration/troubleshooting/ssl.md index dcda4fbb7a9..98d144e012f 100644 --- a/doc/administration/troubleshooting/ssl.md +++ b/doc/administration/troubleshooting/ssl.md @@ -83,13 +83,13 @@ To fix this problem: If your GitLab instance is using a self-signed certificate, or the certificate is signed by an internal certificate authority (CA), you might run into the following errors when attempting to perform Git operations: -```bash +```shell $ git clone https://gitlab.domain.tld/group/project.git Cloning into 'project'... fatal: unable to access 'https://gitlab.domain.tld/group/project.git/': SSL certificate problem: self signed certificate ``` -```bash +```shell $ git clone https://gitlab.domain.tld/group/project.git Cloning into 'project'... fatal: unable to access 'https://gitlab.domain.tld/group/project.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none @@ -107,6 +107,6 @@ To fix this problem: - Disable SSL verification in your Git client. Note that this intended as a temporary measure as it could be considered a **security risk**. - ```bash + ```shell git config --global http.sslVerify false ``` diff --git a/doc/administration/troubleshooting/test_environments.md b/doc/administration/troubleshooting/test_environments.md index d0f670a5663..e9db5f64446 100644 --- a/doc/administration/troubleshooting/test_environments.md +++ b/doc/administration/troubleshooting/test_environments.md @@ -37,7 +37,7 @@ you change a few things: For example, when the `docker-machine` host we want to use is `do-docker`: -```sh +```shell docker run --detach --name gitlab \ --env GITLAB_OMNIBUS_CONFIG="external_url 'http://$(docker-machine ip do-docker)'; gitlab_rails['gitlab_shell_ssh_port'] = 2222;" \ --hostname $(docker-machine ip do-docker) \ @@ -52,7 +52,7 @@ gitlab/gitlab-ee:11.5.3-ee.0 We can use the [`test-saml-idp` Docker image](https://hub.docker.com/r/jamedjo/test-saml-idp) to do the work for us: -```sh +```shell docker run --name gitlab_saml -p 8080:8080 -p 8443:8443 \ -e SIMPLESAMLPHP_SP_ENTITY_ID=<GITLAB_IP_OR_DOMAIN> \ -e SIMPLESAMLPHP_SP_ASSERTION_CONSUMER_SERVICE=<GITLAB_IP_OR_DOMAIN>/users/auth/saml/callback \ @@ -93,7 +93,7 @@ See [the GDK SAML documentation](https://gitlab.com/gitlab-org/gitlab-developmen ### Elasticsearch -```sh +```shell docker run -d --name elasticsearch \ -p 9200:9200 -p 9300:9300 \ -e "discovery.type=single-node" \ @@ -110,7 +110,7 @@ on running PlantUML in Docker. ### Jira -```sh +```shell docker run -d -p 8081:8080 cptactionhank/atlassian-jira:latest ``` @@ -119,7 +119,7 @@ Jira license. ### Grafana -```sh +```shell docker run -d --name grafana -e "GF_SECURITY_ADMIN_PASSWORD=gitlab" -p 3000:3000 grafana/grafana ``` |