Skip to content

gitaly: validate-configuration sub-command

Pavlo Strokov requested to merge ps-config-validation into master

In order to improve developers experience in using Gitaly the new 'validate-configuration' is added. The purpose of it to validate provided configuration before starting the service. The output lists all the problems of the configuration in JSON format into STDOUT. The structure of object includes 'key' which is a path to the field where the problem detected and the 'message' with an explanation of the problem.

Part of: #4650 (closed)

Example of output:

  • empty configuration, almost all validation errors are reported
{
 "errors": [
   {
     "key": [
       "socket_path"
     ],
     "message": "none of 'socket_path', 'listen_addr' or 'tls_listen_addr' is set"
   },
   {
     "key": [
       "listen_addr"
     ],
     "message": "none of 'socket_path', 'listen_addr' or 'tls_listen_addr' is set"
   },
   {
     "key": [
       "tls_listen_addr"
     ],
     "message": "none of 'socket_path', 'listen_addr' or 'tls_listen_addr' is set"
   },
   {
     "key": [
       "storage"
     ],
     "message": "no configurations found. Are you using the right format? https://gitlab.com/gitlab-org/gitaly/issues/397"
   },
   {
     "key": [
       "gitlab-shell",
       "dir"
     ],
     "message": "is not set"
   },
   {
     "key": [
       "gitaly-ruby",
       "dir"
     ],
     "message": "is not set"
   },
   {
     "key": [
       "bin_dir"
     ],
     "message": "is not set"
   }
 ]
}
  • bad toml file format (some = value without quotes):
{
 "message": "line 1 column 8: toml: incomplete number"
}
  • bad value for the specific field ([pack_objects_limiting]\nmax_queue_wait = 'invalid')
{
 "message": "line 2 column 18: toml: time: invalid duration \"invalid\""
}
Edited by Pavlo Strokov

Merge request reports