Errno::ENOENT: No such file or directory - No file specified as Settingslogic source

Hello we have the following problem when we activate LDAP in gitlab.rb on an redhat 7.6 server.
After that cpu goes to 100% and gitlab don’t work any more

Starting Chef Client, version 13.6.4
resolving cookbooks for run list: [“gitlab::show_config”]
Synchronizing Cookbooks:

  • gitlab (0.0.1)
  • package (0.1.0)
  • postgresql (0.1.0)
  • redis (0.1.0)
  • mattermost (0.1.0)
  • registry (0.1.0)
  • consul (0.1.0)
  • gitaly (0.1.0)
  • letsencrypt (0.1.0)
  • nginx (0.1.0)
  • runit (4.3.0)
  • crond (0.1.0)
  • acme (3.1.0)
  • compat_resource (12.19.1)

#########################################################

Recipe: gitlab::gitlab-rails

  • execute[clear the gitlab-rails cache] action run
    [execute] rake aborted!
    Errno::ENOENT: No such file or directory - No file specified as Settingslogic source
    /opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:24:in new' /opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:24:in block in <top (required)>’
    /opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:23:in each' /opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:23:in <top (required)>’
    /opt/gitlab/embedded/service/gitlab-rails/config/environment.rb:6:in <top (required)>' /opt/gitlab/embedded/bin/bundle:23:in load’
    /opt/gitlab/embedded/bin/bundle:23:in `’
    Tasks: TOP => cache:clear => cache:clear:redis => environment
    (See full trace by running task with --trace)

    ================================================================================
    Error executing action run on resource ‘execute[clear the gitlab-rails cache]’

    Mixlib::ShellOut::ShellCommandFailed

    Expected process to exit with [0], but received ‘1’
    ---- Begin output of /opt/gitlab/bin/gitlab-rake cache:clear ----
    STDOUT:
    STDERR: rake aborted!
    Errno::ENOENT: No such file or directory - No file specified as Settingslogic source
    /opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:24:in new' /opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:24:in block in <top (required)>’
    /opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:23:in each' /opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:23:in <top (required)>’
    /opt/gitlab/embedded/service/gitlab-rails/config/environment.rb:6:in <top (required)>' /opt/gitlab/embedded/bin/bundle:23:in load’
    /opt/gitlab/embedded/bin/bundle:23:in `’
    Tasks: TOP => cache:clear => cache:clear:redis => environment
    (See full trace by running task with --trace)
    ---- End output of /opt/gitlab/bin/gitlab-rake cache:clear ----
    Ran /opt/gitlab/bin/gitlab-rake cache:clear returned 1

    Resource Declaration:

    In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-rails.rb

    400: execute “clear the gitlab-rails cache” do
    401: command “/opt/gitlab/bin/gitlab-rake cache:clear”
    402: action :nothing
    403: not_if { omnibus_helper.not_listening?(‘redis’) || !node[‘gitlab’][‘gitlab-rails’][‘rake_cache_clear’] }
    404: end
    405:

    Compiled Resource:

    Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-rails.rb:400:in `from_file’

    execute(“clear the gitlab-rails cache”) do
    action [:nothing]
    default_guard_interpreter :execute
    command “/opt/gitlab/bin/gitlab-rake cache:clear”
    backup 5
    returns 0
    user nil
    declared_type :execute
    cookbook_name “gitlab”
    recipe_name “gitlab-rails”
    domain nil
    not_if { #code block }
    end

    System Info:

    chef_version=13.6.4
    platform=redhat
    platform_version=7.6
    ruby=ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
    program_name=/opt/gitlab/embedded/bin/chef-client
    executable=/opt/gitlab/embedded/bin/chef-client

Running handlers:
There was an error running gitlab-ctl reconfigure:

execute[clear the gitlab-rails cache] (gitlab::gitlab-rails line 400) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit w ith [0], but received ‘1’
---- Begin output of /opt/gitlab/bin/gitlab-rake cache:clear ----
STDOUT:
STDERR: rake aborted!
Errno::ENOENT: No such file or directory - No file specified as Settingslogic source
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:24:in new' /opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:24:in block in <top (required)>’
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:23:in each' /opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:23:in <top (required)>’
/opt/gitlab/embedded/service/gitlab-rails/config/environment.rb:6:in <top (required)>' /opt/gitlab/embedded/bin/bundle:23:in load’
/opt/gitlab/embedded/bin/bundle:23:in `’
Tasks: TOP => cache:clear => cache:clear:redis => environment
(See full trace by running task with --trace)
---- End output of /opt/gitlab/bin/gitlab-rake cache:clear ----
Ran /opt/gitlab/bin/gitlab-rake cache:clear returned 1

Running handlers complete
Chef Client failed. 5 resources updated in 16 seconds

######################################################

here the LDAP config

gitlab_rails[‘ldap_enabled’] = true

gitlab_rails[‘ldap_servers’] = YAML.load <<-EOS
main: # ‘main’ is the GitLab ‘provider ID’ of this LDAP server
label: ‘LDAP’
host: ‘10.x.x.x’
port: 389
uid: ‘sAMAccountName’
encryption: ‘plain’ # “start_tls” or “simple_tls” or “plain”
bind_dn: ‘CN=servicename,OU=Service Auccounts,OU=Administratoren,OU=123,DC=123,DC=123’
password: ‘servicepwd’
smartcard_auth: false
active_directory: true
block_auto_created_users: false
allow_username_or_email_login: false
lowercase_usernames: false
base: ‘’
user_filter: ‘’
group_base: ‘’
admin_group: ‘’
sync_ssh_keys: false
EOS

thanks for any help

1 Like

I have no help, but it seems we have a similar problem.
As soon as I enable gitlab_rails['ldap_enabled'] = true and try gitlab-ctl reconfigure, I get this error, and Gitlab fails to start properly, like you mention:

    Recipe: gitlab::gitlab-rails
  * execute[clear the gitlab-rails cache] action run
    [execute] rake aborted!
              Errno::ENOENT: No such file or directory - No file specified as Settingslogic source
              /opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:29:in `new'
              /opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:29:in `block in <top (required)>'
              /opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:28:in `each'
              /opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:28:in `<top (required)>'
              /opt/gitlab/embedded/service/gitlab-rails/config/environment.rb:5:in `<top (required)>'
              /opt/gitlab/embedded/bin/bundle:23:in `load'
              /opt/gitlab/embedded/bin/bundle:23:in `<main>'
              Tasks: TOP => cache:clear => cache:clear:redis => environment
              (See full trace by running task with --trace)
    
    ================================================================================
    Error executing action `run` on resource 'execute[clear the gitlab-rails cache]'
    ================================================================================
    
    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    Expected process to exit with [0], but received '1'
    ---- Begin output of /opt/gitlab/bin/gitlab-rake cache:clear ----
    STDOUT: 
    STDERR: rake aborted!
    Errno::ENOENT: No such file or directory - No file specified as Settingslogic source
    /opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:29:in `new'
    /opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:29:in `block in <top (required)>'
    /opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:28:in `each'
    /opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:28:in `<top (required)>'
    /opt/gitlab/embedded/service/gitlab-rails/config/environment.rb:5:in `<top (required)>'
    /opt/gitlab/embedded/bin/bundle:23:in `load'
    /opt/gitlab/embedded/bin/bundle:23:in `<main>'
    Tasks: TOP => cache:clear => cache:clear:redis => environment
    (See full trace by running task with --trace)
    ---- End output of /opt/gitlab/bin/gitlab-rake cache:clear ----
    Ran /opt/gitlab/bin/gitlab-rake cache:clear returned 1
    
    Resource Declaration:
    ---------------------
    # In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-rails.rb
    
    409: execute "clear the gitlab-rails cache" do
    410:   command "/opt/gitlab/bin/gitlab-rake cache:clear"
    411:   action :nothing
    412:   not_if { omnibus_helper.not_listening?('redis') || !node['gitlab']['gitlab-rails']['rake_cache_clear'] }
    413: end
    414: 
    
    Compiled Resource:
    ------------------
    # Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-rails.rb:409:in `from_file'
    
    execute("clear the gitlab-rails cache") do
      action [:nothing]
      default_guard_interpreter :execute
      command "/opt/gitlab/bin/gitlab-rake cache:clear"
      backup 5
      declared_type :execute
      cookbook_name "gitlab"
      recipe_name "gitlab-rails"
      domain nil
      user nil
      not_if { #code block }
    end
    
    System Info:
    ------------
    chef_version=14.14.29
    platform=debian
    platform_version=9.12
    ruby=ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]
    program_name=/opt/gitlab/embedded/bin/chef-client
    executable=/opt/gitlab/embedded/bin/chef-client
    

Running handlers:
There was an error running gitlab-ctl reconfigure:

execute[clear the gitlab-rails cache] (gitlab::gitlab-rails line 409) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /opt/gitlab/bin/gitlab-rake cache:clear ----
STDOUT: 
STDERR: rake aborted!
Errno::ENOENT: No such file or directory - No file specified as Settingslogic source
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:29:in `new'
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:29:in `block in <top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:28:in `each'
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/1_settings.rb:28:in `<top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/config/environment.rb:5:in `<top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => cache:clear => cache:clear:redis => environment
(See full trace by running task with --trace)
---- End output of /opt/gitlab/bin/gitlab-rake cache:clear ----
Ran /opt/gitlab/bin/gitlab-rake cache:clear returned 1

Running handlers complete
Chef Client failed. 4 resources updated in 19 seconds

@glanyi Oh, after spending hours to figure this out, my case was actually trivial to solve: I just had to correct the YAML indentation of the LDAP configuration :grimacing:.
It’s quite a pity that GitLab doesn’t fail more gracefully in such a case.