4

GitLab server can't start. The reason is likely because gitlab.yml configuration file is not correct.

What tool to use to check yml grammar is correct?

I have tried Notepad++ and SublimeText, but they show small sign in different places:

Notepad doesn't like indent for 1 line. Notepad++

SublimeText enter image description here

Can really indents and spaces be problem in GitLab config parser?

Community
  • 1
  • 1
Paul Verest
  • 60,022
  • 51
  • 208
  • 332

1 Answers1

1

What I use, and this works with any editor, is a comparison between:

  • gitlab.yml
  • gitlab.yml.example

I developed a little bash diff script which will look for differences in keys (not values, since you are supposed to put your own values there)

## LDAP setting
ldap:               (<--- it is a key)
  enabled: true
    ^^^     ^^^
    key      value

I just do a:

cd gitlab/config
check_all_diff .

That way, if there are any change in term of keys, key order, new keys or deleted keys, I can spot those when I upgrade gitlab.

To summarize, you need to copy in a directory part of your $PATH:

Don't forget to:

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • How to run check_all_diff ? It just gives me command not found (with or without sudo) – Paul Verest Jul 24 '13 at 06:01
  • You need to copy the script (https://raw.github.com/VonC/compileEverything/master/sbin/check_all_diff) in a file name `check_all_diff`, `chmod 755 check_all_diff`, and make sure it is in a folder part of your `$PATH`. – VonC Jul 24 '13 at 06:04
  • Even after executing `chmod 755 check_all_diff` I can't make it run in any way: check_all_diff, ./check_all_diff, sudo check_all_diff, sudo ./check_all_diff -> bash: check_all_diff: command not found. – Paul Verest Jul 24 '13 at 07:33
  • @PaulVerest but did you add the parent directory of that script in your `$PATH`? (http://unix.stackexchange.com/q/26047/7490) – VonC Jul 24 '13 at 07:34
  • I am Windows user and expected that I can run from current folder. I have just run PATH=$PATH:/opt/bitnami/apps/gitlab/htdocs/config Now when running `check_all_diff`, I get /bin/bash^M: bad interpreter: No such file or directory – Paul Verest Jul 24 '13 at 07:48
  • @PaulVerest Windows? In that case, make sure your Windows text editor doesn't save the file with bad eol (end of line) characters (like `\r\n`, instead of `\r`): that is the `^M` you see in the error message. Tools like Notepad++ or UltraEdit knows how to respect and not change those eol. See for instance http://stackoverflow.com/q/10531472/6309, but also http://stackoverflow.com/a/73886/6309, http://stackoverflow.com/a/3773847/6309 and http://stackoverflow.com/a/64798/6309. – VonC Jul 24 '13 at 07:50
  • @PaulVerest Note: there are actually 2 scripts involved: `check_all_diff` and `check_diff`. I have edited my answer to make that clear. – VonC Jul 24 '13 at 15:23