Skip to content

Issue with postfixadmin: undefined method `[]' for nil:NilClass in recipes/mysql.rb:33 #7

@arunderwood

Description

@arunderwood

I've created a simple wrapper cookbook that invokes postfix-dovecot::default, but every time during the run it bails out the same way.

My chef -vv output:

Chef Development Kit Version: 1.2.22
chef-client version: 12.18.31
delivery version: master (0b746cafed65a9ea1a79de3cc546e7922de9187c)
berks version: 2017-03-01T23:07:07.921211 29945] 2017-03-01T23:07:07.921356 29945] 2017-03-01T23:07:07.921462 29945] 2017-03-01T23:07:07.921559 29945] 2017-03-01T23:07:07.949605 29945] 2017-03-01T23:07:07.949715 29945] 5.6.0
kitchen version: 1.15.0

The resulting message:

Installing Cookbook Gems:
Compiling Cookbooks...
Recipe: postfixadmin::default
  * chef_gem[sequel] action install[2017-03-02T05:04:11+00:00] INFO: Processing chef_gem[sequel] action install (postfixadmin::default line 60)
 (up to date)

  ================================================================================
  Recipe Compile Error in /tmp/kitchen/cache/cookbooks/ise_mail/recipes/postfix_dovecot.rb
  ================================================================================

  NoMethodError
  -------------
  undefined method `[]' for nil:NilClass

  Cookbook Trace:
  ---------------
    /tmp/kitchen/cache/cookbooks/postfixadmin/recipes/mysql.rb:33:in `from_file'
    /tmp/kitchen/cache/cookbooks/postfixadmin/recipes/default.rb:63:in `from_file'
    /tmp/kitchen/cache/cookbooks/postfix-dovecot/recipes/postfixadmin.rb:22:in `from_file'
    /tmp/kitchen/cache/cookbooks/postfix-dovecot/recipes/default.rb:23:in `from_file'
    /tmp/kitchen/cache/cookbooks/ise_mail/recipes/postfix_dovecot.rb:7:in `from_file'

  Relevant File Content:
  ----------------------
  /tmp/kitchen/cache/cookbooks/postfixadmin/recipes/mysql.rb:

   26:    key = "server_#{user}_password"
   27:    encrypted_attribute_write(['postfixadmin', 'mysql', key]) { secure_password }
   28:  end
   29:
   30:  self.encrypted_attributes_enabled = node['postfixadmin']['encrypt_attributes']
   31:
   32:  recipe = self
   33>> mysql_service node['mysql']['service_name'] do
   34:    version node['mysql']['version']
   35:    port node['mysql']['port']
   36:    data_dir node['mysql']['data_dir']
   37:    server_root_password recipe.mysql_password('root')
   38:    server_debian_password recipe.mysql_password('debian')
   39:    server_repl_password recipe.mysql_password('repl')
   40:    allow_remote_root node['mysql']['allow_remote_root']
   41:    remove_anonymous_users node['mysql']['remove_anonymous_users']
   42:    remove_test_database node['mysql']['remove_test_database']

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions