paint-brush
Troubleshooting GitLab and GitLab CIby@josejaviasilis
1,658 reads
1,658 reads

Troubleshooting GitLab and GitLab CI

by Jose Javi AsilisApril 23rd, 2018
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

This is a final post just in case something went wrong with your <a href="https://hackernoon.com/tagged/gitlab" target="_blank">GitLab</a> installation:
featured image - Troubleshooting GitLab and GitLab CI
Jose Javi Asilis HackerNoon profile picture

This is a final post just in case something went wrong with your GitLab installation:

Posts:

  1. [Tutorial — Guide] Installing GitLab, GitLab CI on AWS EC2 from Zero.
  2. Configure GitLab CI on AWS EC2 Using Docker
  3. Configuring .gitlab-ci.yml
  4. Troubleshooting GitLab and GitLab CI (This Post)

#1-IP Changed on GitLab Repo — Displaying wrong URL

You forgot to set an Elastic IP, the IP changed and now your project changed, and now GitLab doesn’t know how to work it out.

We need to change the external URL from the /etc/gitlab/gitlab.rb file:

#Alternative 1 — Change it using Vim

(Go to your PuTTY terminal, and run:

sudo vim /etc/gitlab/gitlab.rb

Press the letter “i” to start editing.

After you finish editing, press esc and type :wq This will write and quit the program.

#Alternative 2— Download the file and change its content.

Alternatively, you can access the file directly through FTP via Filezilla or WinSCP. But you’re going to have to temporarily enable access of the file:

sudo chmod 777 /etc/gitlab/gitlab.rb

From <https://forum.filezilla-project.org/viewtopic.php?t=22618>

After that, we’re able to download the file and edit it:

Change Line 13. Reupload the file to save the changes.

Don’t forget to run:

sudo chmod 600 /etc/gitlab/gitlab.rb

For all alternatives, run:

sudo gitlab-ctl reconfigure

For changes to take effect.

Remember to set an Elastic IP in AWS so this doesn’t’ happen again!

#2- What to do in case the project build or any other stage is failing:

  1. In case you receive that No task runners are running. Then, that could mean:
  • The task runner is not running. Use sudo gitlab-runner start OR sudo gitlab-runner run to make it work.
  • The task runner is configured to run with tags and your job doesn’t have tags with it! Tags aren’t set at the project level, but at the job level inside the .gitlab-ci.yml file!

2. In case that you receive a connection time out problem

In this specific case, the problem was with the lack Elastic IP, and the server address change. By not using Elastic IP, your server’s address is released , and is completely changed.