We are getting the message, "A variable value contains an illegal string or character" from Bitbucket Pipeline.
The Environment Variable Document, unless I missed it, doesn't mention any limits on values. It doesn't say anything about escaping characters in the values.
What characters are not valid? Are there any escaping mechanisms?
For real? I have more than 18 intents and then read this...
I'm confused, so what is the point of allowing us to create user-defined ENV vars is we can't actually use them? If anything using them in the pipelines.yml file seems like the ONLY place you would want to use them...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just to add to the conversation: using the ENV VARS within the pipelines section works; I added the following as the last command of the pipeline for instance:
echo "Database name is $DB_NAME"
And it does output in the log the database name, so it seems that only when using env vars in the definitions section they are not properly parsed:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @gusrub,
Yes you're right, under our official documentation "Defining a service" you'll see:
Note - the environment section must contain only literal values, not environment variables.
I will raise a bug against the validator - it should say it is invalid.
Cheers,
Davina
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This problem had me confused for a while. Is it true that we cannot set env vars in the definitions with env vars from the pipeline settings?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is so unintuitive... Why would we use environment variables from Bitbucket, when we can't actually use them in the service definitions...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
SERIOUSLY - Wasted a few hours on this ridiculousness..why would Atlassian do something awesome like create environmental variables and then NOT allow us to implement them in the entire YAML file?! And the ENTIRE documentation for bitbucket pipelines doesnt promote the use of the environmental variables...I'm about to switch to Gitlab where we don't have half-baked implementations and documentation ..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Douglas,
If you scroll down on that documentation page to "User variables", you will see a few limitations:
Hope this helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @davina I'm having exactly the same issue. I do not see any illegal characters on my env vars.
Opening the validator shows this:
I even tried to use the env vars without the double quotes to no avail, still getting this:
I do have, of course, the referenced variables defined in my environment variables page set.
Is this a known issue... something we are doing wrong perhaps?
I love to have the pipelines integrated with the source control but unfortunately storing the credentials on the YAML is not an option as you'd guess.
Thanks in advance!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.