rebar3 icon indicating copy to clipboard operation
rebar3 copied to clipboard

"Unable to read vars file" error when overlay_vars is a list of string with length > 1

Open imtutta opened this issue 1 year ago • 5 comments

With the following profile set on rebar.config

{profiles, [
    {local, [
        {relx, [
            {dev_mode, true},
            {include_erts, true},
            {system_libs, true},
            {overlay_vars, [
                "config/overlays/default.config",
                "config/overlays/default_secrets.config"
            ]}
        ]}
    ]}
]}

Running

rebar3 as local release

I always got this error message at the end of the releasing process

...
===> Compiling doorman
===> Assembling release doorman-0.0.1...
===> Release successfully assembled: _build/local/rel/doorman
===> Unable to read vars file (config/overlays/default.configconfig/overlays/default_secrets.config) for overlay due to: enoent

Overlays are applied correctly. (Even if it happened they did not, but I still did not find any determinism on this) I suspect the error above could be the symptom of something worse.

config/overlays/default.config, config/overlays/default_secrets.config correctly exists config/overlays/default.configconfig/overlays/default_secrets.config does not exist, it looks a weird append behaviour on lists

imtutta avatar Jun 26 '23 10:06 imtutta

Overlays are applied correctly.

Hm? They are?

tsloughter avatar Jun 26 '23 10:06 tsloughter

Overlays are applied correctly.

Hm? They are?

Yeah, well... yes but as I said it happened that they did not work sometime. Basically no overlay was applied, but I don't see any determinism or replication procedure. Still investigating.

You seems pretty sure it shouldn't work :) is the list on the overlay_vars wrong?

imtutta avatar Jun 26 '23 10:06 imtutta

Looks the issue is there since 3.19.0

imtutta avatar Jun 26 '23 14:06 imtutta

I think it always existed. The value is just a string. You can put multiple references to other overlay var files in an overlay var file though: https://github.com/erlware/relx/wiki/Overlays#prodconfig

tsloughter avatar Jun 26 '23 15:06 tsloughter

Sure thing! So I should assume passing more overlay files in a list is not the intended way. I should always use reference to other files in a single overlay vars file... am I correct?

imtutta avatar Jun 26 '23 15:06 imtutta