You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
restic 0.16.4 (v0.16.4-0-g3786536dc) compiled with go1.21.8 on linux/amd64
What backend/service did you use to store the repository?
local/any
Problem description / Steps to reproduce
restic seems to silently ignore problems with some environment variable parameters.
In my instance, the documentation wasn't clear that RESTIC_PACK_SIZE needed to be numeric only (and was in MB) and it silently ignored RESTIC_PACK_SIZE=64M and continued to use the default rather than issuing a warning or failing.
It does properly warn if the problem parameter is on the command line.
Expected behavior
I would expect restic to warn or fail if an environment variable it is using is not valid (as long as it is not being overridden on the command line).
Actual behavior
restic silently ignores problems with environment variables like RESTIC_PACK_SIZE.
Did restic help you today? Did it make you happy in any way?
Using it in a new situation, working pretty well!
The text was updated successfully, but these errors were encountered:
This is unfortunately rather complex to properly fix. Currently, environment variables are parsed inside init() functions before the regular execution starts. At that point, the code has no idea which command will be called in the end. Blindly failing if the environment variable value leads to a few weird corner cases:
shell autocompletion will stop working if an invalid environment variable is set
environment variables for a different command can cause the current one to fail
RESTIC_PACK_SIZE=64M restic --pack-size 64 ... would still fail
Avoiding these corner cases, however, requires restructuring how all commands are defined. And I'm not yet sure how a correct implementation would look like.
MichaelEischer
changed the title
environment variable values silently ignored
invalid environment variable values silently ignored
Apr 10, 2024
Output of
restic version
restic 0.16.4 (v0.16.4-0-g3786536dc) compiled with go1.21.8 on linux/amd64
What backend/service did you use to store the repository?
local/any
Problem description / Steps to reproduce
restic
seems to silently ignore problems with some environment variable parameters.In my instance, the documentation wasn't clear that
RESTIC_PACK_SIZE
needed to be numeric only (and was in MB) and it silently ignoredRESTIC_PACK_SIZE=64M
and continued to use the default rather than issuing a warning or failing.It does properly warn if the problem parameter is on the command line.
Expected behavior
I would expect
restic
to warn or fail if an environment variable it is using is not valid (as long as it is not being overridden on the command line).Actual behavior
restic silently ignores problems with environment variables like
RESTIC_PACK_SIZE
.Did restic help you today? Did it make you happy in any way?
Using it in a new situation, working pretty well!
The text was updated successfully, but these errors were encountered: