In GitLab, How Do You Find Only Files (not folders or projects) That Have “foo” in Their Content and Have File Extensions of .bar?

Problem scenario
You are using the GitLab GUI. You want to find files that end with .bar and have the patter “foo” in the content. How do you find them?

Solution
Use the Search feature. Use this as the search term for a given Group in GitLab (with “Any” for the “Project”):

foo extension:bar

(Do not use “.bar”.)

The source of this is https://docs.gitlab.com.

How Do You Troubleshoot a Web UI Problem with GitLab?

Problem scenario
When you are using GitLab, you receive various 500 errors. The web UI is not working correctly. What should you do?

Possible solution #1
1. Go to the back-end of the GitLab server. Run this: sudo gitlab-ctl tail
2. Reproduce the web UI problems that you are having. Examine the output.

Possible solution #2
You may want to install Fiddler on your desktop to get more details about the front-end.

How Do You Find the Web UI of a GitLab Server on Your Network?

Problem scenario
You inherited a GitLab server on your network to manage. You want to find the front end of the URL. What should you do?

Solution
Find the external IP address. Log into the back-end. If it has access to the internet, run this command: curl icanhazip.com

If you have no access to the internet, run this command: ip addr show

Use the IP addresses exhaustively in a web browser with a port in this fashion (where ppp should be replaced with the port number you want to try): http://x.x.x.x:pppp

The port number may be one to five numbers long.

How Do You Troubleshoot This Error “502 Whoops, GitLab is taking too much time to respond.”?

Problem scenario
You try to log into GitLab for the first time, but you get this error:

“502 Whoops, GitLab is taking too much time to respond.”

What should you do?

Solution
Go to the back end of the server. Run the top command. Is the left most load average above 1 (e.g, 1.08)?

The top line of the results of the top command will look something like this:

load average: 1.08,

How Do You Troubleshoot the GitLab Installation Error “dpkg: error processing package gitlab-ee…post-installation script returned error exit status 1”?

Problem scenario
You are trying to install GitLab, but you get this error:

“dpkg: error processing package gitlab-ee (–configure):
subprocess installed post-installation script returned error exit status 1″

What do you do?

Possible solution #1
Is Jenkins running on the server? Is a service running on port 8080? Can you stop any process running on port 8080 and try again?

How Do You Find the Port Number That GitLab’s Web UI Uses from the Back-end of a Linux Server?

Problem scenario
You have an existing GitLab set up on a Linux server. You have access to the back-end. You want to find the port number to connect to. How do you do this?

Solution
First find the external IP address (e.g., curl icanhazip)

Second, install nmap (e.g., sudo yum -y install nmap or sudo apt-get -y install nmap).

How Do You Change The Port That GitLab Listens on?

Problem scenario
By default GitLab runs on port 8080.  You want to run something else on the server with GitLab.  How do you change the port that GitLab uses?

Solution
1.  Edit the /etc/gitlab/gitlab.rb file.

Find the stanzas with for the “external_url”.

Change it from this:  http://x.x.x.x/

to this:  http://x.x.x.x:555

(where x.x.x.x is either the external IP address or FQDN of the gitlab server and 555 is the desired non-standard port number that you want GitLab to listen on).

How Do You Troubleshoot a GitLab Webhook Failing Because of “Execution expired”?

Problem scenario
You try to test an Integration, specifically a Webhook, in GitLab.  The URL is for Jenkins.  You get “Execution expired.”  What could be wrong?

Possible solution #1
See if the GitLab’s IP address or hostname changed.  If the external_url stanza in /etc/gitlab/gitlab.rb uses an old IP address or FQDN, then that may need to be updated.  You may need to run “sudo gitlab-ctl reconfigure” again. 

How Do You Troubleshoot the GitLab Integration Webhook Error “No valid crumb was included in the request”?

Problem scenario
You are trying to configure GitLab to work with Jenkins (so the two are integrated to enable CI, continual integration, in your environment).  When you test a connection of an integration webhook from GitLab to reach out to Jenkins you receive this error:

“Hook executed successfully but returned HTTP 403… No valid crumb was included in the request.”

What should you do?

Solution
Possible solution #1
Warning: This is not a recommended practice.