# Issue with environment variables

**URL:** <https://discuss.circleci.com/t/issue-with-environment-variables/21155>\
**Category:** Bug Reports\
**Tags:** envars, aws, awscli\
**Created:** [March 31, 2018, 1:56pm UTC](https://discuss.circleci.com/t/issue-with-environment-variables/21155 "2018-03-31T13:56:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jameswlane](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jameswlane/32/17969_2.png) [@jameswlane](https://discuss.circleci.com/u/jameswlane)\
**Post date:** [March 31, 2018, 1:56pm UTC](https://discuss.circleci.com/t/issue-with-environment-variables/21155/1 "2018-03-31T13:56:25Z")

</div>

CircleCI is doing one of two things:

- It is adding white space at the beginning of the environment variable when I add it
- Not updating the environment variable when I change it

My AWS deployment is failing due to the AWS\_ACCESS\_KEY\_ID value has space as the first character.  
I have removed it and re-added the variable several time through the admin UI and kicked off a new build. It still has space at the beginning of the variable.

When I SSH in and manually set it the value without space it works fine.

For the time being, I had to add this to remove the space:  
AWS\_ACCESS\_KEY\_ID="(echo -e "{AWS\_ACCESS\_KEY\_ID}" | tr -d ‘[:space:]’)"

It is working for the time being.

---

<div class="post-metadata">

**Author:** ![KyleTryon](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/kyletryon/32/9977_2.png) [@KyleTryon](https://discuss.circleci.com/u/KyleTryon)\
**Post date:** [March 31, 2018, 8:23pm UTC](https://discuss.circleci.com/t/issue-with-environment-variables/21155/2 "2018-03-31T20:23:09Z")

</div>

> [@jameswlane](#):
>
> It is adding white space at the beginning of the environment variable when I add it  
> Not updating the environment variable when I change it
> 
> My AWS deployment is failing due to the AWS\_ACCESS\_KEY\_ID value has space as the first character.
> 
> I have removed it and re-added the variable several time through the admin UI and kicked off a new build. It still has space at the beginning of the variable.
> 
> When I SSH in and manually set it the value without

Hello James,  
The adding of a space I have seen often before in cases where you copy the password from a location where a ghost space is inserted, is that possible? As for the UI behaving a little strange, rather than refreshing the page (or using back/forward), try going into the address bar and hitting enter to “refresh” the page. Because our site is a React app this is sometimes necessary when the browser doesn’t catch certain updates.

Try echoing out a few test env vars and let us know if you see the extra spacing.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 29, 2018, 8:23pm UTC](https://discuss.circleci.com/t/issue-with-environment-variables/21155/3 "2018-06-29T20:23:14Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
