<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">Mariano, 
<div><br /></div>
<div>I have been using rebar3_cuttlefish for all of my projects, the issue is still there. It uses cuttlefish which is very out of date and doesn’t give any useful error information.</div>
<div><br /></div>
<div>Joe,</div>
<div><br /></div>
<div>Cuttlefish(<a href="https://github.com/tsloughter/rebar3_cuttlefish">https://github.com/tsloughter/rebar3_cuttlefish</a>, <a href="https://github.com/basho/cuttlefish">https://github.com/basho/cuttlefish</a>) is a tool that takes configuration parameters and converts them to an erlang config file. For example, you could have a simple(.conf) file:</div>
<div><br /></div>
<blockquote style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">
<div>host = 127.0.0.1 </div>
<div>Port = 8883</div>
</blockquote>
<div><br /></div>
<div>And using <i>mappings</i> in a <i>schema</i>, you can convert that to part of a system config file (.config)</div>
<blockquote style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">
<div>{http_app, [</div>
<div>     {host, “127.0.0.1”},</div>
<div>     {port, 8883}</div>
<div>]}.</div>
</blockquote>
<div><br /></div>
<div>It can also take multiple values from the .conf file into a larger .config file, and mutate them using translations. Its a cool tool. For example, I use it(in one use case)to set the log locations for lager using a translation. I set </div>
<div><br /></div>
<blockquote style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">
<div>log_file = /var/log/app1/console.log</div>
<div>log_level = debug</div>
</blockquote>
<br />
<div><br /></div>
<div>And then I translate that into </div>
<div><br /></div>
<div><br /></div>
<blockquote style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">
<div>
<div>{lager_file_backend,</div>
</div>
<div>
<div>          [{file,"/var/log/app1/console.log"},</div>
</div>
<div>
<div>           {level,debug},</div>
</div>
<div>
<div>           {formatter,lager_default_formatter},</div>
</div>
<div>
<div>           {formatter_config,</div>
</div>
<div>
<div>               [date," ",time," [",severity,"] ",pid," ",message,</div>
</div>
</blockquote>
<div>
<div>                "\n"]}]}</div>
</div>
<div><br /></div>
<div>It makes for easy and dynamic configuration. The issue is that 1) it’s super old and unsupported, and 2) it gives no error information when there is an issue in configuration. </div>
</div>
<div name="messageReplySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;"><br />
On Oct 31, 2018, 5:19 AM -0400, Mariano Guerra <mariano@marianoguerra.org>, wrote:<br />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">
<div dir="ltr">
<div dir="ltr">On Wed, Oct 31, 2018 at 10:15 AM Mariano Guerra <<a href="mailto:mariano@marianoguerra.org">mariano@marianoguerra.org</a>> wrote:<br />
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr"><br />
<div class="gmail_quote">
<div dir="ltr">On Tue, Oct 30, 2018 at 4:43 PM Code Wiget <<a href="mailto:codewiget95@gmail.com" target="_blank">codewiget95@gmail.com</a>> wrote:<br /></div>
<blockquote class="gmail_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #3498db;">
<div>
<div name="messageBodySection" style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">Hi everyone,
<div><br /></div>
<div>Do any of you use/have/know of a “modern” version of cuttlefish? Cuttlefish is great because it allows for easy user configuration, an advanced configuration, and easy mappings, but then you create a release and get errors like this with 0 context:</div>
<div><br /></div>
</div>
</div>
</blockquote>
<div><br /></div>
<div>hi, I use if for all my projects, it works pretty well with the rebar3_cuttlefish plugin (<a href="https://hex.pm/packages/rebar3_cuttlefish/" target="_blank">https://hex.pm/packages/rebar3_cuttlefish/</a>)</div>
<div><br /></div>
<div>if you want to see a setup that works check the rebar3 riak-core template <a href="https://marianoguerra.github.io/riak-core-tutorial/setup.html#install-riak-core-rebar3-template" target="_blank">https://marianoguerra.github.io/riak-core-tutorial/setup.html#install-riak-core-rebar3-template</a> you don't need to use it, just create the project and check rebar.config and the config folder<br /></div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<div><br /></div>
<div>I noticed that the next step is in a later section: <a href="https://marianoguerra.github.io/riak-core-tutorial/setup.html#test-that-everything-works">https://marianoguerra.github.io/riak-core-tutorial/setup.html#test-that-everything-works</a><br /></div>
<div><br /></div>
<div>to summarize here:</div>
<div><br /></div>
<div>
<pre><span class="gmail-n">mkdir</span> <span class="gmail-o">-</span><span class="gmail-n">p</span> <span class="gmail-o">~/.</span><span class="gmail-n">config</span><span class="gmail-o">/</span><span class="gmail-n">rebar3</span><span class="gmail-o">/</span><span class="gmail-n">templates</span>
<span class="gmail-n">git</span> <span class="gmail-n">clone</span> <span class="gmail-n">https</span><span class="gmail-p">:</span><span class="gmail-o">//</span><span class="gmail-n">github</span><span class="gmail-o">.</span><span class="gmail-n">com</span><span class="gmail-o">/</span><span class="gmail-n">marianoguerra</span><span class="gmail-o">/</span><span class="gmail-n">rebar3_template_riak_core</span><span class="gmail-o">.</span><span class="gmail-n">git</span> <span class="gmail-o">~/.</span><span class="gmail-n">config</span><span class="gmail-o">/</span><span class="gmail-n">rebar3</span><span class="gmail-o">/</span><span class="gmail-n">templates</span><span class="gmail-o">/</span><span class="gmail-n">rebar3_template_riak_core<br /><span></span><span class="gmail-n">rebar3</span> <span class="gmail-n">new</span> <span class="gmail-n">rebar3_riak_core</span> <span class="gmail-n">name</span><span class="gmail-o">=</span><span class="gmail-n">akv<br /><span class="gmail-n">cd</span> <span class="gmail-n">akv</span>
<span class="gmail-n">make<br /><span></span><span class="gmail-n">make</span> <span class="gmail-n">console</span></span></span></span></pre></div>
<div><br /></div>
<div> </div>
<blockquote class="gmail_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div class="gmail_quote">
<div></div>
<div> </div>
<blockquote class="gmail_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #3498db;">
<div>
<div name="messageBodySection" style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
<div></div>
<blockquote style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #d35400;">
<div>Cuttlefish failed! Oh no!</div>
</blockquote>
<div><br /></div>
</div>
</div>
</blockquote>
<div><br /></div>
<div>when I get that error I go to the script, add some prints and run the offending line by hand, usually it's some erlang version problem, format error or similar.</div>
<div><br /></div>
<div>that message doesn't come from cuttlefish itself but from the script that runs it, in my case it's this line:</div>
<div><br /></div>
<div>CUTTLEFISH_CONFIG=$($CUTTLEFISHCMD -e $RUNNER_ETC_DIR -d $RUNNER_GEN_DIR/generated.conf -s $RUNNER_BASE_DIR/share/schema/ -c $RUNNER_ETC_DIR/$CUTTLEFISH_CONF.new)</div>
<div><br /></div>
<div>which I print to the console</div>
<div><br /></div>
<div>echo "$CUTTLEFISHCMD -e $RUNNER_ETC_DIR -d $RUNNER_GEN_DIR/generated.conf -s $RUNNER_BASE_DIR/share/schema/ -c $RUNNER_ETC_DIR/$CUTTLEFISH_CONF.new"</div>
<div><br /></div>
<div>copy the output and run it manually to see the error details (it would be nice to print the error output with the "oh no" message, or at least a random <a href="http://webcomicname.com/" target="_blank">http://webcomicname.com/</a> :P)<br /></div>
<div> </div>
<blockquote class="gmail_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #3498db;">
<div>
<div name="messageBodySection" style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">
<div></div>
<div>You uncomment what you added, and still get a failure. Then you delete the commented section, and <i>maybe</i> it will decide to work.</div>
<div><br /></div>
<div>Is there a more modern version of this for Erlang? I see the last development for Cuttlefish was years ago. I’m sure the kids these days are using something</div>
</div>
</div>
_______________________________________________<br />
erlang-questions mailing list<br />
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br />
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br /></blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
<div></div>
</div>
</body>
</html>