basho-labs / puppet-riak

A puppet module to deploy Riak clusters
Apache License 2.0
33 stars 37 forks source link

Riak Control errors #20

Closed rhoml closed 9 years ago

rhoml commented 11 years ago

It seems that when I modify appconfig.pp in order to launch the Riak Control it sets by default on the app.config file

    riak_control => {
      enabled  => true,
      auth     => '__atom_userlist',
      userlist => ['__tuple', 'user', 'pass'],
      admin    => true
    },

but this makes riak control fail with a error 500

Internal Server Error

The server encountered an error while processing this request:
{error,function_clause,
       [{proplists,get_value,
                   ["user",{"user","pass"},undefined],
                   [{file,"proplists.erl"},{line,222}]},
        {riak_control_security,valid_userpass,3,
                               [{file,"src/riak_control_security.erl"},
                                {line,127}]},
        {riak_control_security,enforce_user_pass,5,
                               [{file,"src/riak_control_security.erl"},
                                {line,115}]},
        {webmachine_resource,resource_call,3,
                             [{file,"src/webmachine_resource.erl"},
                              {line,183}]},
        {webmachine_resource,do,3,
                             [{file,"src/webmachine_resource.erl"},
                              {line,141}]},
        {webmachine_decision_core,resource_call,1,
                                  [{file,"src/webmachine_decision_core.erl"},
                                   {line,48}]},
        {webmachine_decision_core,decision,1,
                                  [{file,"src/webmachine_decision_core.erl"},
                                   {line,209}]},
        {webmachine_decision_core,handle_request,2,
                                  [{file,"src/webmachine_decision_core.erl"},
                                   {line,33}]}]}

The correct form of the riak_control section is


 {riak_control, [
                {enabled, true},
                {auth, userlist},
                {userlist, [{"user", "pass"}
                           ]},
                {admin, true}
        ]},
haf commented 11 years ago

Looks like a problem with generation of erlang code using the erly.rb util:

https://github.com/basho/puppet-riak/blob/master/lib/puppet/parser/util/erly.rb#L94

Could you also attach the generated file's contents?

Failing test should be written at

https://github.com/basho/puppet-riak/blob/master/spec/functions/write_erl_config_spec.rb#L5

danieldreier commented 9 years ago

I'm closing this issue because the code has been refactored such that the impacted code no longer exists. I haven't tested it, but you should be able to enable riak control with something like the following syntax in the new version, which will install Riak 2.

class { '::riak':
  settings       => {
    'riak_control' => 'on',
  },
}

If that doesn't work for you we'll add a test case and fix it, just re-open the issue.