Recipe compile error in opt gitlab embedded cookbooks cache cookbooks gitlab ee recipes default rb

Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab-ee/recipes/default.rb How can I deal with this problem. [root@1t316 gitlab]# sudo gitlab-ctl reconfigure Starting Chef Client, version 13.6.4 resolving cookbooks for run list: [«gitlab-ee»] Synchronizing Cookbooks: gitlab-ee (0.0.1) package (0.1.0) gitlab (0.0.1) consul (0.0.0) repmgr (0.1.0) runit (0.14.2) postgresql (0.1.0) redis (0.1.0) registry (0.1.0) mattermost (0.1.0) gitaly (0.1.0) letsencrypt (0.1.0) […]

Содержание

  1. Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab-ee/recipes/default.rb
  2. ================================================================================ Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab-ee/recipes/default.rb
  3. NoMethodError
  4. Cookbook Trace:
  5. Relevant File Content:
  6. System Info:
  7. Native Fedora30 Package installation issue
  8. NoMethodError
  9. Cookbook Trace:
  10. Relevant File Content:
  11. Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab-ee/recipes/default.rb
  12. ================================================================================ Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab-ee/recipes/default.rb
  13. NoMethodError
  14. Cookbook Trace:
  15. Relevant File Content:
  16. System Info:
  17. Reconfigure gitlab 11.8.1 fails if gitlab_pages enabled, giving unsuccessful upgrade
  18. Summary
  19. Steps to reproduce
  20. What is the current bug behavior?
  21. What is the expected correct behavior?
  22. Relevant logs
  23. gitlab-ctl reconfigure
  24. Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks /gitlab-ee/recipes/default.rb
  25. NoMethodError
  26. Cookbook Trace:
  27. Relevant File Content:
  28. System Info:
  29. gitlab.rb syntax issues after upgrade 11.5
  30. SyntaxError
  31. Cookbook Trace:
  32. Relevant File Content:
  33. System Info:
  34. Backup Settings
  35. Docs: https://docs.gitlab.com/omnibus/settings/backups.html

Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab-ee/recipes/default.rb

How can I deal with this problem.

[root@1t316 gitlab]# sudo gitlab-ctl reconfigure Starting Chef Client, version 13.6.4 resolving cookbooks for run list: [«gitlab-ee»] Synchronizing Cookbooks:

  • gitlab-ee (0.0.1)
  • package (0.1.0)
  • gitlab (0.0.1)
  • consul (0.0.0)
  • repmgr (0.1.0)
  • runit (0.14.2)
  • postgresql (0.1.0)
  • redis (0.1.0)
  • registry (0.1.0)
  • mattermost (0.1.0)
  • gitaly (0.1.0)
  • letsencrypt (0.1.0)
  • nginx (0.1.0)
  • acme (3.1.0)
  • crond (0.1.0)
  • compat_resource (12.19.0) Installing Cookbook Gems: Compiling Cookbooks. Recipe: gitlab::default
  • directory[/etc/gitlab] action create (up to date)

================================================================================ Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab-ee/recipes/default.rb

NoMethodError

undefined method `[]’ for nil:NilClass

Cookbook Trace:

Relevant File Content:

14: # See the License for the specific language governing permissions and 15: # limitations under the License. 16: # 17:
18: define :redis_service, socket_group: nil do 19: svc = params[:name] 20:
21>> redis_dir = node[‘gitlab’][svc][‘dir’] 22: redis_log_dir = node[‘gitlab’][svc][‘log_directory’] 23: redis_user = AccountHelper.new(node).redis_user 24: omnibus_helper = OmnibusHelper.new(node) 25:
26: account ‘user and group for redis’ do 27: username redis_user 28: uid node[‘gitlab’][svc][‘uid’] 29: ugid redis_user 30: groupname redis_user

System Info:

chef_version=13.6.4 platform=centos platform_version=6.10 ruby=ruby 2.4.5p335 (2018-10-18 revision 65137) [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:

undefined method `[]’ for nil:NilClass

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

Источник

Native Fedora30 Package installation issue

I am trying to install and configure gitlab-ee-12.2.5-ee.0.el7.x86_64 on fedora 30 server.

After installation when i run the following command

it fails with following error:

Starting Chef Client, version 14.13.11 resolving cookbooks for run list: [«gitlab-ee»]

  • gitlab-ee (0.0.1)
  • package (0.1.0)
  • consul (0.1.0)
  • gitlab (0.0.1)
  • repmgr (0.1.0)
  • runit (4.3.0)
  • postgresql (0.1.0)
  • redis (0.1.0)
  • monitoring (0.1.0)
  • registry (0.1.0)
  • mattermost (0.1.0)
  • gitaly (0.1.0)
  • letsencrypt (0.1.0)
  • nginx (0.1.0)
  • crond (0.1.0)
  • acme (4.0.0)

Installing Cookbook Gems:

Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab-ee/recipes/default.rb

NoMethodError

undefined method `to_hash’ for nil:NilClass

Cookbook Trace:

/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/settings_helper.rb:176:in `block in generate_config’

Relevant File Content:

250: Gitlab[‘prometheus’][‘scrape_configs’] = default_scrape_configs.compact.flatten

253: def gitlab_monitor_scrape_configs

254: # Don’t parse if gitlab_monitor is explicitly disabled

255: return unless Services.enabled?(‘gitlab_monitor’)

257>> default_config = Gitlab[‘node’][‘gitlab’][‘gitlab-monitor’].to_hash

258: user_config = Gitlab[‘gitlab_monitor’]

260: listen_address = user_config[‘listen_address’] || default_config[‘listen_address’]

261: listen_port = user_config[‘listen_port’] || default_config[‘listen_port’]

262: prometheus_target = [listen_address, listen_port].join(‘:’)

264: # Include gitlab-monitor defaults scrape config.

266: ‘job_name’ => ‘gitlab_monitor_database’,

ruby=ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]

There was an error running gitlab-ctl reconfigure:

undefined method `to_hash’ for nil:NilClass

Running handlers complete

Chef Client failed. 0 resources updated in 19 seconds

Источник

Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab-ee/recipes/default.rb

How can I deal with this problem.

]# sudo gitlab-ctl reconfigure Starting Chef Client, version 13.6.4 resolving cookbooks for run list: [«gitlab-ee»] Synchronizing Cookbooks:

  • gitlab-ee (0.0.1)
  • package (0.1.0)
  • gitlab (0.0.1)
  • consul (0.0.0)
  • repmgr (0.1.0)
  • runit (0.14.2)
  • postgresql (0.1.0)
  • redis (0.1.0)
  • registry (0.1.0)
  • mattermost (0.1.0)
  • gitaly (0.1.0)
  • letsencrypt (0.1.0)
  • nginx (0.1.0)
  • acme (3.1.0)
  • crond (0.1.0)
  • compat_resource (12.19.0) Installing Cookbook Gems: Compiling Cookbooks. Recipe: gitlab::default
  • directory[/etc/gitlab] action create (up to date)

================================================================================ Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab-ee/recipes/default.rb

NoMethodError

undefined method `[]’ for nil:NilClass

Cookbook Trace:

Relevant File Content:

14: # See the License for the specific language governing permissions and 15: # limitations under the License. 16: # 17:
18: define :redis_service, socket_group: nil do 19: svc = params[:name] 20:
21>> redis_dir = node[‘gitlab’][svc][‘dir’] 22: redis_log_dir = node[‘gitlab’][svc][‘log_directory’] 23: redis_user = AccountHelper.new(node).redis_user 24: omnibus_helper = OmnibusHelper.new(node) 25:
26: account ‘user and group for redis’ do 27: username redis_user 28: uid node[‘gitlab’][svc][‘uid’] 29: ugid redis_user 30: groupname redis_user

System Info:

chef_version=13.6.4 platform=centos platform_version=6.10 ruby=ruby 2.4.5p335 (2018-10-18 revision 65137) [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:

undefined method `[]’ for nil:NilClass

Running handlers complete Chef Client failed. 0 resources updated in 04 seconds

Источник

Reconfigure gitlab 11.8.1 fails if gitlab_pages enabled, giving unsuccessful upgrade

Summary

Reconfigure fails if gitlab_pages enable is set to true, after upgrade from gitlab-ee-11.3.6 to gitlab-ee-11.8.1. If I remove this line from /etc/gitlab/gitlab.rb, reconfigure runs fine:

This problem made an upgrade completely fail, making the Gitlab instance unavailable after upgrading.

Steps to reproduce

Add gitlab_pages[‘enable’] = true to gitlab.rb.config + reconfigure/restart

Upgrade gitlab-ee from 11.3.6 to 11.8.1

What is the current bug behavior?

gitlab-ctl reconfigure fails. Se below for log.

What is the expected correct behavior?

No errors in gitlab-ctl reconfigure..

Relevant logs

gitlab-ctl reconfigure

Starting Chef Client, version 13.6.4 resolving cookbooks for run list: [«gitlab-ee»] Synchronizing Cookbooks:

  • gitlab-ee (0.0.1)
  • package (0.1.0)
  • repmgr (0.1.0)
  • runit (4.3.0)
  • postgresql (0.1.0)
  • redis (0.1.0)
  • registry (0.1.0)
  • mattermost (0.1.0)
  • gitaly (0.1.0)
  • letsencrypt (0.1.0)
  • nginx (0.1.0)
  • acme (3.1.0)
  • compat_resource (12.19.1)
  • gitlab (0.0.1)
  • crond (0.1.0)
  • consul (0.1.0) Installing Cookbook Gems: Compiling Cookbooks.

Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks /gitlab-ee/recipes/default.rb

NoMethodError

undefined method `+’ for nil:NilClass

Cookbook Trace:

/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/gitl ab_pages.rb:84:in parse_gitlab_pages_daemon’ /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/gitl ab_pages.rb:28:in parse_variables’ /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/hel pers/settings_helper.rb:174:in block in generate_config’ /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/hel pers/settings_helper.rb:172:in each’ /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/hel pers/settings_helper.rb:172:in generate_config’ /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/config .rb:26:in from_file’ /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/defaul t.rb:26:in from_file’ /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab-ee/recipes/def ault.rb:20:in from_file’

Relevant File Content:

77: Gitlab[‘gitlab_pages’][‘cert_key’] ||= «/etc/gitlab/ssl/ #.key» 78: end 79: 80: Gitlab[‘gitlab_pages’][‘pages_root’] ||= (Gitlab[‘gitlab_r ails’][‘pages_path’] || File.join(Gitlab[‘gitlab_rails’][‘shared_path’ ], ‘pages’)) 81: Gitlab[‘gitlab_pages’][‘artifacts_server_url’] ||= Gitlab[ ‘external_url’].chomp(‘/’) + ‘/api/v4’ 82: 83: pages_uri = URI(Gitlab[‘pages_external_url’].to_s) 84>> Gitlab[‘gitlab_pages’][‘auth_redirect_uri’] ||= pages_uri. scheme + ‘://projects.’ + pages_uri.host + ‘/auth’ 85: Gitlab[‘gitlab_pages’][‘auth_server’] ||= Gitlab[‘external _url’] 86: end 87: 88: def authorize_with_gitlab 89: redirect_uri = Gitlab[‘gitlab_pages’][‘auth_redirect_uri’] 90: app_name = ‘GitLab Pages’ 91: 92: o = query_gitlab_rails(redirect_uri, app_name) 93: if o.exitstatus.zero?

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:

undefined method `+’ for nil:NilClass

Running handlers complete Chef Client failed. 0 resources updated in 04 seconds

Источник

gitlab.rb syntax issues after upgrade 11.5

gitlab upgrade is failing from gitlab 11.4.5 to 11.5 due to the issue caused by gitlab-ctl reconfigure.

I am able to download the gitlab-ce-11.5 latest package and after that gitlab.rb configuration file got updated with the syntax error and that is preventing me to upgrade to the gitlab latest version. These are the errors below.

sudo gitlab-ctl reconfigure Starting Chef Client, version 13.6.4 resolving cookbooks for run list: [«gitlab»] Synchronizing Cookbooks:

compat_resource (12.19.0) Installing Cookbook Gems: Compiling Cookbooks.

Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb

SyntaxError

/etc/gitlab/gitlab.rb:298: syntax error, unexpected ‘n’, expecting =>

Cookbook Trace:

/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/settings_helper.rb:100:in block in from_file’ /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/config_mash.rb:28:in auto_vivify’ /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/settings_helper.rb:100:in from_file’ /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/config.rb:23:in from_file’ /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb:26:in `from_file’

Relevant File Content:

93: def ee_attribute(name, **config) 94: config = < ee: true >.merge(config) 95: attribute(name, **config) 96: end 97: 98: def from_file(_file_path) 99: # Allow auto mash creation during from_file call 100>> Gitlab::ConfigMash.auto_vivify < super >101: end 102: 103: def method_missing(method_name, *arguments) # rubocop:disable Style/MethodMissing 104: # Give better message for NilClass errors 105: # If there are no arguements passed, this is a ‘GET’ call, and if 106: # there is no matching key in the configuration, then it has not been set (not even to nil) 107: # and we will output a nicer error above the exception 108: if arguments.length.zero? && !configuration.key?(method_name) 109: breaktxt = ‘=’ * 80

System Info:

chef_version=13.6.4 platform=redhat platform_version=7.6 ruby=ruby 2.4.5p335 (2018-10-18 revision 65137) [x86_64-linux]

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

/etc/gitlab/gitlab.rb:298: syntax error, unexpected ‘n’, expecting =>

Running handlers complete Chef Client failed. 0 resources updated in 03 seconds

Now I see the new error.If you open the file name

Backup Settings

Docs: https://docs.gitlab.com/omnibus/settings/backups.html

298 line gitlab_rails[‘manage_backup_path’] = true gitlab_rails[‘backup_path’] = ‘/var/opt/gitlab/backups’

Источник

Change gitlab _ rails [‘gitlab _ email _ enabled’] in gitlab.rb to false
When it was first installed, it exploded without reason.
Now that this has been changed, reconfigure will not be able to pass …

The log is as follows:

Starting Chef Client, version 12.5.1
 resolving cookbooks for run list: ["gitlab"]
 Synchronizing Cookbooks:
 - gitlab (0.0.1)
 - package (0.0.0)
 - runit (0.14.2)
 Compiling Cookbooks  ...
 Recipe: gitlab::default
 * directory[/etc/gitlab] action create (up to date)
 /sbin/init: unrecognized option '--version'
 -.mount                                          loaded active mounted   /
 
 ================================================================================
 Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb
 ================================================================================
 
 Errno::ENOMEM
 -------------
 Cannot allocate memory - fork(2)
 
 Cookbook Trace:
 ---------------
 /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/helper.rb:26:in `do_shell_out'
 /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/helper.rb:37:in `success?  '
 /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/helper.rb:107:in `service_up?  '
 /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/helper.rb:99:in `should_notify?  '
 /opt/gitlab/embedded/cookbooks/cache/cookbooks/runit/definitions/runit_service.rb:202:in `block (2 levels) in from_file'
 /opt/gitlab/embedded/cookbooks/cache/cookbooks/runit/definitions/runit_service.rb:191:in `block in from_file'
 /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/definitions/sidekiq_service.rb:31:in `block in from_file'
 /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/sidekiq.rb:20:in `from_file'
 /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb:110:in `block in from_file'
 /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb:108:in `each'
 /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb:108:in `from_file'
 
 Relevant File Content:
 ----------------------
 /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/helper.rb:
 
 19:  require 'mixlib/shellout'
 20:  require 'uri'
 21:
 22:  module ShellOutHelper
 23:
 24:    def do_shell_out(cmd)
 25:      o = Mixlib::ShellOut.new(cmd)
 26>>     o.run_command
 27:      o
 28:    rescue Errno::EACCES
 29:      Chef::Log.info("Cannot execute #{cmd}.")
 30:      o
 31:    rescue Errno::ENOENT
 32:      Chef::Log.info("#{cmd} does not exist.")
 33:      o
 34:    end
 35:
 
 
 Running handlers:
 Running handlers complete
 Chef Client failed. 0 resources updated in 05 seconds

Cannot allocate memory

There should be not enough memory

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account


Closed

dfduarte opened this issue

Sep 10, 2015

· 13 comments

Comments

@dfduarte

Good afternoon,

I’m trying to run the chef-server cookbook using chef-provisioning (and chef-solo from Vagrant), and it returning the following error:

                  ================================================================================
                          Recipe Compile Error in /opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/default.rb
                          ================================================================================

                          Chef::Exceptions::ValidationFailed
                          ----------------------------------
                          common_name is required

                          Cookbook Trace:
                          ---------------
                            /opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/nginx.rb:58:in `block in from_file'
                            /opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/nginx.rb:57:in `from_file'
                            /opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/default.rb:208:in `block in from_file'
                            /opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/default.rb:191:in `each'
                            /opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/default.rb:191:in `from_file'

                          Relevant File Content:
                          ----------------------
                          /opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/nginx.rb:

                           51:  
                           52:  ssl_keyfile = File.join(nginx_ca_dir, "#{node['private_chef']['nginx']['server_name']}.key")
                           53:  ssl_crtfile = File.join(nginx_ca_dir, "#{node['private_chef']['nginx']['server_name']}.crt")
                           54:  ssl_dhparam = File.join(nginx_ca_dir, 'dhparams.pem')
                           55:  
                           56:  # Generate self-signed SSL certificate
                           57:  openssl_x509 ssl_crtfile do
                           58>>   common_name node['private_chef']['nginx']['server_name']
                           59:    org node['private_chef']['nginx']['ssl_company_name']
                           60:    org_unit node['private_chef']['nginx']['ssl_organizational_unit_name']
                           61:    country node['private_chef']['nginx']['ssl_country_name']
                           62:    key_length node['private_chef']['nginx']['ssl_key_length']
                           63:    expire node['private_chef']['nginx']['ssl_duration']
                           64:    owner 'root'
                           65:    group 'root'
                           66:    mode '0644'
                           67:  end

                          [2015-09-10T17:10:11+00:00] ERROR: Running exception handlers
                          [2015-09-10T17:10:11+00:00] ERROR: Exception handlers complete
                          [2015-09-10T17:10:11+00:00] FATAL: Stacktrace dumped to /opt/opscode/embedded/cookbooks/cache/chef-stacktrace.out
                          [2015-09-10T17:10:13+00:00] FATAL: Chef::Exceptions::ValidationFailed: common_name is required
                          STDERR: sudo: unable to resolve host ip-10-0-0-151
                          sudo: unable to resolve host ip-10-0-0-151
                          sudo: unable to resolve host ip-10-0-0-151
                          ERROR: CONFIGURATION ERROR:Specified config file /etc/opscode/pivotal.rb does not exist
                          sudo: unable to resolve host ip-10-0-0-151
                          ERROR: CONFIGURATION ERROR:Specified config file /etc/opscode/pivotal.rb does not exist
                          ---- End output of "bash"  "/tmp/chef-script20150910-3220-19gpj5q" ----
                          Ran "bash"  "/tmp/chef-script20150910-3220-19gpj5q" returned 1

These errors started suddenly, and the chef-client cannot run the recipe due this. Note: I’ve used the wrapper that manages this cookbook (chef-server) before, without problems

The only one attribute passed by wrapper, is:

node.override[‘chef-server’][‘api-fqdn’] = node[‘ipaddress’]

@jjasghar

I was able to repo this too.

[2015-09-23T16:46:46+00:00] WARN: common_name nil currently does not overwrite the value of common_name. This will change in Chef 13, and the value will be set to nil instead. Please change your code to explicitly accept nil using "property :common_name, [MyType, nil]", or stop setting this value to nil.

  ================================================================================
  Recipe Compile Error in /opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/default.rb
  ================================================================================

  Chef::Exceptions::ValidationFailed
  ----------------------------------
  common_name is required

  Cookbook Trace:
  ---------------
    /opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/nginx.rb:58:in `block in from_file'
    /opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/nginx.rb:57:in `from_file'
    /opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/default.rb:208:in `block in from_file'
    /opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/default.rb:191:in `each'
    /opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/default.rb:191:in `from_file'

  Relevant File Content:
  ----------------------
  /opt/opscode/embedded/cookbooks/cache/cookbooks/private-chef/recipes/nginx.rb:

   51:
   52:  ssl_keyfile = File.join(nginx_ca_dir, "#{node['private_chef']['nginx']['server_name']}.key")
   53:  ssl_crtfile = File.join(nginx_ca_dir, "#{node['private_chef']['nginx']['server_name']}.crt")
   54:  ssl_dhparam = File.join(nginx_ca_dir, 'dhparams.pem')
   55:
   56:  # Generate self-signed SSL certificate
   57:  openssl_x509 ssl_crtfile do
   58>>   common_name node['private_chef']['nginx']['server_name']
   59:    org node['private_chef']['nginx']['ssl_company_name']
   60:    org_unit node['private_chef']['nginx']['ssl_organizational_unit_name']
   61:    country node['private_chef']['nginx']['ssl_country_name']
   62:    key_length node['private_chef']['nginx']['ssl_key_length']
   63:    expire node['private_chef']['nginx']['ssl_duration']
   64:    owner 'root'
   65:    group 'root'
   66:    mode '0644'
   67:  end


  Running handlers:
[2015-09-23T16:46:46+00:00] ERROR: Running exception handlers
  Running handlers complete
[2015-09-23T16:46:46+00:00] ERROR: Exception handlers complete
  Chef Client failed. 1 resources updated in 10.379691033 seconds
[2015-09-23T16:46:46+00:00] FATAL: Stacktrace dumped to /opt/opscode/embedded/cookbooks/cache/chef-stacktrace.out
[2015-09-23T16:46:47+00:00] FATAL: Chef::Exceptions::ValidationFailed: common_name is required

/cc @ryancragun

@dfduarte

Hello jjasghar.

I figured out that this problem is related to a known bug with the Nginx cookbook (that Chef-server cookbook uses, also). The bug is a cookbook crash, when the machine to be configured, don’t have a resolvable hostname and a VALID hostname (at least), and don’t have a hostname set within OHAI.

At least here, I solved this setting a valid and correct hostname for my instance.

I don’t know if this is related to your problem, as my issue here (besides the both problem are the same), but it’s a good way to look for the solution.

@jjasghar

Ah yep! I just sudo echo "127.0.0.1 <HOSTNAME> <HOSTNAME>" >> /etc/hosts and it worked. Thanks!

@lbornov2

Facing this as well when installing on EC2.
[ec2-user@ip-XYZ ~]$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain chef.orgname.com

@djdefi

Confirmed on ec2 default ubuntu 14.04

@cixelsyd

This just bit me today also. I too am attempting to use the ‘official’ ubuntu image on EC2.

@cwidhelm

Make an entry in /etc/hosts using the name provided by executing the ‘hostname’ command.

127.0.0.1 ip-172-28-0-156.ec2.internal

@Doormouse2House

Any suggestions on how to work around this if you want to host the chef-server on a different sub-domain? I’ve changed the following, for example:

default[‘private_chef’][‘nginx’][‘server_name’] = «chef.#{node[‘fqdn’]}»

That appears to work for the hosting, but the cert generated is based on the hostname only — I want the common_name for the server cert to be chef.hostname

@obazoud

Confirmed on ec2 default ubuntu 14.04
Fixed with:

hostname `curl http://169.254.169.254/latest/meta-data/public-hostname`

@cheeseplus

This should largely be resolved by setting the api_fqdn as appropriate or leaving unset to use IP addresses. Feel free to open new issues if this is manifesting presently.

@ghost

just updating that this is still relevant as of today, fixing using sudo echo "127.0.0.1 <HOSTNAME> <HOSTNAME>" >> /etc/hosts

@maksimu

I used this command to avoid looking up for hostname:

eval "sudo echo "127.0.0.1 $(hostname) $(hostname)" >> /etc/hosts"

@karthiupnr

i got the same error and tried to install/ un-install the chef. no luck

then, i tried the above step. and then «reconfigured» it is working. thanks.

echo «127.0.0.1 chef_server chef_server.com»>> /etc/hosts

Я пытаюсь запустить Gitlab локально и сталкиваюсь с проблемой разрешений:

cp: cannot create regular file '/etc/gitlab/gitlab.rb': Permission denied

Я запускаю команду

sudo docker run 
    --hostname local.gitlab 
    --publish 443:443 --publish 80:80 --publish 2200:22 
    --name gitlab 
    --restart always 
    --volume /srv/gitlab/config:/etc/gitlab 
    --volume /srv/gitlab/logs:/var/log/gitlab 
    --volume /srv/gitlab/data:/var/opt/gitlab 
    gitlab/gitlab-ce:latest

Предыдущая команда будет выполнена успешно, если я опущу аргументы --volumes.

Я пробовал бегать

docker exec -it gitlab update-permissions
docker restart gitlab

Но это, похоже, тоже не работает.

Вывод из docker ps:

CONTAINER ID        IMAGE                     COMMAND             CREATED             STATUS                            PORTS                                                            NAMES
aa0654ff45e2        gitlab/gitlab-ce:latest   "/assets/wrapper"   29 seconds ago      Up 3 seconds (health: starting)   0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:2200->22/tcp   gitlab

Вывод из docker logs gitlab:

Thank you for using GitLab Docker Image!
Current version: gitlab-ce=10.3.2-ce.0

Configure GitLab for your system by editing /etc/gitlab/gitlab.rb file
And restart this container to reload settings.
To do it use docker exec:

docker exec -it gitlab vim /etc/gitlab/gitlab.rb
docker restart gitlab

For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

If this container fails to start due to permission problems try to fix it by executing:

docker exec -it gitlab update-permissions
docker restart gitlab

Installing gitlab.rb config...
cp: cannot create regular file '/etc/gitlab/gitlab.rb': Permission denied

Я на macOS Sierra 10.12.6

Любая помощь была бы признательна!


< Сильный > Обновление

Я изменил разрешения для папки в соответствии с этим ответом, и дела идут немного дальше, но появляются новые ошибки разрешений сейчас же. Ниже вывод из docker logs gitlab:

Thank you for using GitLab Docker Image!
Current version: gitlab-ce=10.3.2-ce.0

Configure GitLab for your system by editing /etc/gitlab/gitlab.rb file
And restart this container to reload settings.
To do it use docker exec:

docker exec -it gitlab vim /etc/gitlab/gitlab.rb
docker restart gitlab

For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

If this container fails to start due to permission problems try to fix it by executing:

docker exec -it gitlab update-permissions
docker restart gitlab

Preparing services...
Starting services...
Configuring GitLab package...
/opt/gitlab/embedded/bin/runsvdir-start: line 24: ulimit: pending signals: cannot modify limit: Operation not permitted
/opt/gitlab/embedded/bin/runsvdir-start: line 37: /proc/sys/fs/file-max: Read-only file system
gitlab preinstall: 
gitlab preinstall: This node does not appear to be running a database
gitlab preinstall: Skipping version check, if you think this is an error exit now
gitlab preinstall: 
Configuring GitLab...
Starting Chef Client, version 12.12.15
resolving cookbooks for run list: ["gitlab"]
Synchronizing Cookbooks:
- gitlab (0.0.1)
- package (0.1.0)
- registry (0.1.0)
- mattermost (0.1.0)
- consul (0.0.0)
- gitaly (0.1.0)
- runit (0.14.2)
Installing Cookbook Gems:
Compiling Cookbooks...
Recipe: gitlab::default
* directory[/etc/gitlab] action create

    ================================================================================
    Error executing action `create` on resource 'directory[/etc/gitlab]'
    ================================================================================

    Errno::EPERM
    ------------
    Operation not permitted @ chmod_internal - /etc/gitlab

    Cookbook Trace:
    ---------------
    /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb:33:in `from_file'

    Resource Declaration:
    ---------------------
    # In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb

    28: directory "/etc/gitlab" do
    29:   owner "root"
    30:   group "root"
    31:   mode "0775"
    32:   only_if { node['gitlab']['manage-storage-directories']['manage_etc'] }
    33: end.run_action(:create)
    34: 
    35: if File.exists?("/var/opt/gitlab/bootstrapped")
    36:     node.default['gitlab']['bootstrap']['enable'] = false
    37: end
    38: 

    Compiled Resource:
    ------------------
    # Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb:28:in `from_file'

    directory("/etc/gitlab") do
    action [:create]
    retries 0
    retry_delay 2
    default_guard_interpreter :default
    path "/etc/gitlab"
    declared_type :directory
    cookbook_name "gitlab"
    recipe_name "default"
    owner "root"
    group "root"
    mode "0775"
    only_if { #code block }
    end

    Platform:
    ---------
    x86_64-linux


================================================================================
Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb
================================================================================

Errno::EPERM
------------
directory[/etc/gitlab] (gitlab::default line 28) had an error: Errno::EPERM: Operation not permitted @ chmod_internal - /etc/gitlab

Cookbook Trace:
---------------
    /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb:33:in `from_file'

Relevant File Content:
----------------------
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb:

26:  include_recipe 'gitlab::config'
27:  
28:  directory "/etc/gitlab" do
29:    owner "root"
30:    group "root"
31:    mode "0775"
32:    only_if { node['gitlab']['manage-storage-directories']['manage_etc'] }
33>> end.run_action(:create)
34:  
35:  if File.exists?("/var/opt/gitlab/bootstrapped")
36:     node.default['gitlab']['bootstrap']['enable'] = false
37:  end
38:  
39:  directory "Create /var/opt/gitlab" do
40:    path "/var/opt/gitlab"
41:    owner "root"
42:    group "root"

Platform:
---------
x86_64-linux


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

directory[/etc/gitlab] (gitlab::default line 28) had an error: Errno::EPERM: Operation not permitted @ chmod_internal - /etc/gitlab

Running handlers complete
Chef Client failed. 0 resources updated in 05 seconds

Я пытался изменить разрешения /etc/gitlab, используя Get Info и chmod, но безуспешно.


Обновить часть 2

Я отказался от запуска GL локально и просто настроил версию для удаленной разработки.

5 ответов

Лучший ответ

Вам нужно предоставить разрешения на чтение и запись для всех в папках хоста, которые пытаются подключить /srv/gitlab/config, /srv/gitlab/logs и /srv/gitlab/data. Right Click > Get Info > Lock Icon .

Эта проблема связана с общим доступом к файловой системе (osxfs) на Mac и его особенностями. поддерживает права доступа к файлу между хостом и контейнером.


7

yamenk
30 Дек 2017 в 20:24

Помимо создания папок в пользовательском каталоге. Мне также пришлось изменить владельца этих папок, чтобы они принадлежали USERNAME, а не root

Итак, шаги, которые работали для меня были:

  1. Создать папки mkdir -p ~/srv/gitlab/data ~/srv/gitlab/config ~/srv/gitlab/logs
  2. Сменить владельца sudo chown -R USERNAME:staff srv
  3. Запустить контейнер
docker run --detach                                                                                                                                                        
  --hostname gitlab.example.com 
  --publish 443:443 --publish 80:80 --publish 22:22 
  --name gitlab 
  --volume ~/srv/gitlab/config:/etc/gitlab 
  --volume ~/srv/gitlab/logs:/var/log/gitlab 
  --volume ~/srv/gitlab/data:/var/opt/gitlab 
  gitlab/gitlab-ce:latest


0

mcha
17 Апр 2019 в 04:37

Используйте папку вашего пользователя. Это позволит вам в некотором смысле обойти необходимость настройки разрешений для внешней папки. Работал на меня!

    --volume /Users/username/gitlab/config:/etc/gitlab 
    --volume /Users/username/gitlab/logs:/var/log/gitlab 
    --volume /Users/username/gitlab/data:/var/opt/gitlab 


10

Justin Hammond
12 Июн 2019 в 10:22

У меня была та же проблема, что и у вас после вашего первого обновления:
directory[/etc/gitlab] (gitlab::default line 28) had an error: Errno::EPERM: Operation not permitted @ chmod_internal - /etc/gitlab
Я также пытался «исправить» разрешения, но безрезультатно.
Мне не удалось решить эту проблему при использовании описанных томов /srv/gitlab по умолчанию.
Только когда я переместил его в каталог пользователя, это удалось.

Возможно, это как-то связано с настройками совместного доступа к файлам в докере, но я считаю, что в моем случае это тоже было правильно настроено.


0

Xaho
12 Мар 2018 в 17:05

Понравилась статья? Поделить с друзьями:
  • Received error when trying to advertise server on master server response was not valid json
  • Redis error moved
  • Received error from kdc 1765328360 preauthentication failed
  • Receipt is already open эвотор ошибка
  • Recaptcha validate error перевод