Skip to content

More chkconfig magic would be helpful#158

Closed
seancribbs wants to merge 1 commit intodevelopfrom
bugfix/sdc/gh158-malformatted-advanced-config
Closed

More chkconfig magic would be helpful#158
seancribbs wants to merge 1 commit intodevelopfrom
bugfix/sdc/gh158-malformatted-advanced-config

Conversation

@seancribbs
Copy link

Related to #59

If advanced.config contains a simple tuple without an enclosing array, the error looks like this:

escript: exception error: no function clause matching
                 lists:foldl(#Fun<cuttlefish_advanced.0.102210937>,
                             [{yokozuna,
                               [{root_dir,"./data/yz"},
                                {anti_entropy_data_dir,
                                 "./data/yz_anti_entropy"},
                                {solr_jvm_opts,
                                 "-d64 -Xms1g -Xmx1g -XX:+UseStringCache -XX:+UseCompressedOops"},
                                {solr_jmx_port,8985},

@seancribbs
Copy link

Can you include an example of the erroneous advanced.config?

@macintux
Copy link
Contributor Author

Anything that is not a list should trigger that. I had the riak_kv tuple with add_path inside it, but no global list.

Sent from my iPhone

On Jun 26, 2014, at 1:27 PM, Sean Cribbs notifications@github.com wrote:

Can you include an example of the erroneous advanced.config?


Reply to this email directly or view it on GitHub.

@seancribbs seancribbs added the bug label Jun 26, 2014
@seancribbs seancribbs added this to the 2.0 milestone Jun 26, 2014
@seancribbs seancribbs self-assigned this Jun 26, 2014
@seancribbs
Copy link

Thanks @macintux, that's sufficient to know.

Erlang config files are designed to contain one term, a list, that
contains two-tuples of {Application, Env}. An advanced.config can
possibly contain multiple terms and still parse via file:consult/1, but
cuttlefish does not handle this case. Instead of crashing with
case_clause, we now inform the user that the file is erroneous.
@seancribbs
Copy link

@macintux Please see if this suits your needs.

@macintux
Copy link
Contributor Author

macintux commented Oct 3, 2014

I am unenthused by the error messages, but it's definitely better than before.

The problem now is that the error message doesn't provide anything useful in some cases, and the debug option the command recommends doesn't help either.

E.g., removing the trailing period from the list:

15:07:47.191 [error] Error parsing /Users/John/github/Basho/cuttlefish-cribbs/riak/rel/riak/bin/../etc/advanced.config: 8: syntax error before:

Running riak config generate -l debug as recommended gives a boatload of unrelated information before spitting out the same error.

So definitely better, but would be nice if it were better yet.

@seancribbs
Copy link

@macintux Do you have specific ways the error messages could be improved in this case? I'd like this to land in 2.0.2.

@macintux
Copy link
Contributor Author

syntax error at end of file would be better, missing period at end of list would be moar better, but I don't know how practical either of those are.

I'm fine with this being something we periodically improve (and thus can merge now).

@seancribbs
Copy link

This should have targeted 2.0. Closing.

@seancribbs seancribbs closed this Oct 17, 2014
@seancribbs seancribbs deleted the bugfix/sdc/gh158-malformatted-advanced-config branch April 1, 2015 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants