Various failures when environment variable KEY contains "="

POSIX does not permit = in environment variable names: http://pubs.opengroup.org/onlinepubs/009695399/functions/setenv.html however, it is not filtered on bitrise leading to weird states.

Examples:

  1. Envman fails with not so user-friendly message setenv: invalid argument
  2. Script step just fails without any message: https://www.bitrise.io/build/b5c947f0057f2f49
  3. CLI fails on EnvmanJSONPrint: https://www.bitrise.io/build/2f02f4f9779941cc

Note that, there are even several errors reported in a single line:

ERRO[15:41:36] Step (activate-ssh-key@3.1.1) failed, error: EnvmanJSONPrint failed, err: Error: exit status 1, details: FATA[15:41:36] Failed to convert envs, error: setenv: invalid argument 

Starting build with = in env variable name should be probably disallowed. E.g. Build trigger API should return an error instead of starting build as well as online trigger form.

1 Like

Thanks for reporting @koral!

In general I think there’s not much validation for keys right now, only in Workflow Editor’s Env Vars tab, but neither on API level nor in envman and other tools.

Just to be sure, this only affects the key, right? Value should and can include = without issues.

Will create an internal bug report for this too :wink:

Yep, there are no restrictions on values however key cannot be empty nor it cannot contain =.

Envman and form on bitrise.io already validates if key is not empty. Haven’t tried with API.

1 Like

Got it - created the internal bug report, we’ll try to schedule some time to add more validation :wink: