# AWS Credentials not working from SHELL Environment Variable

**URL:** <https://community.codefresh.io/t/aws-credentials-not-working-from-shell-environment-variable/230>\
**Category:** Pipeline Workflows\
**Created:** [November 9, 2019, 12:56am UTC](https://community.codefresh.io/t/aws-credentials-not-working-from-shell-environment-variable/230 "2019-11-09T00:56:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jei](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/jei/32/170_2.png) [@jei](https://community.codefresh.io/u/jei)\
**Post date:** [November 9, 2019, 12:56am UTC](https://community.codefresh.io/t/aws-credentials-not-working-from-shell-environment-variable/230/1 "2019-11-09T00:56:25Z")

</div>

Hi there,

Not sure which section of the community my problem resides in, but I am having issues with authenticating `aws-cli`.

I am decrypting my AWS credentials from a repo and exporting it to the SHELL environment variables using the following command:

`export $(grep -v '^#' /codefresh/volume/production)` - `production` are my AWS creds.

However, when I run `aws s3 ls`, I am getting the following error:

```auto
An HTTP Client raised and unhandled exception: Invalid header value b'AWS4-HMAC-SHA256 Credential=xxx\r/20191108/us-east-1/s3/aws4_request, Sign
edHeaders=host;x-amz-content-sha256;x-amz-date, Signature=xxx'                                      

```

I did some Googling around, some users are saying it could be related to whitespace issue, and some are saying you can’t have issue. I checked my files, none of them have newlines or whitespaces at the end of the file.

Please advise.

Thank you.

---

<div class="post-metadata">

**Author:** ![Kostis](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/kostis/32/391_2.png) [@Kostis](https://community.codefresh.io/u/Kostis)\
**Post date:** [November 12, 2019, 12:21pm UTC](https://community.codefresh.io/t/aws-credentials-not-working-from-shell-environment-variable/230/2 "2019-11-12T12:21:23Z")

</div>

It is hard to diagnose this without looking at the build with more detail. Could you please open an issue with us ?

Just click on your profile (top right) \> Support \> Submit a request.

Please also include the build URL of the pipeline that has the issue.

---

<div class="post-metadata">

**Author:** ![jei](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/jei/32/170_2.png) [@jei](https://community.codefresh.io/u/jei)\
**Post date:** [November 13, 2019, 1:50am UTC](https://community.codefresh.io/t/aws-credentials-not-working-from-shell-environment-variable/230/3 "2019-11-13T01:50:42Z")

</div>

I can create a Support Ticket, however, my build URL contains sensitive information.

Please advise how I should proceed.

Thank you.

---

<div class="post-metadata">

**Author:** ![Kostis](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/kostis/32/391_2.png) [@Kostis](https://community.codefresh.io/u/Kostis)\
**Post date:** [November 13, 2019, 11:17am UTC](https://community.codefresh.io/t/aws-credentials-not-working-from-shell-environment-variable/230/4 "2019-11-13T11:17:28Z")

</div>

Your builds are not accessible outside of your account. Only support stuff have access to them (with your explicit permission)

Here is for example one my builds [Codefresh | console](https://g.codefresh.io/build/5dc8b30b39002b740d0d197b)

---

<div class="post-metadata">

**Author:** ![jei](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/jei/32/170_2.png) [@jei](https://community.codefresh.io/u/jei)\
**Post date:** [November 13, 2019, 1:40pm UTC](https://community.codefresh.io/t/aws-credentials-not-working-from-shell-environment-variable/230/5 "2019-11-13T13:40:29Z")

</div>

It’s not accessible from the outside, but support staff have access to my sensitive information?

I just don’t want anything to happen to my credentials that I have written to the output log in the build. I did this for debugging purposes.

---

<div class="post-metadata">

**Author:** ![Kostis](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/kostis/32/391_2.png) [@Kostis](https://community.codefresh.io/u/Kostis)\
**Post date:** [November 13, 2019, 5:24pm UTC](https://community.codefresh.io/t/aws-credentials-not-working-from-shell-environment-variable/230/6 "2019-11-13T17:24:05Z")

</div>

Support stuff will only access your build logs after your explicit permission. Once you submit an issue you can also give extra instructions to our support team.

---

<div class="post-metadata">

**Author:** ![todaywasawesome](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/todaywasawesome/32/91_2.png) [@todaywasawesome](https://community.codefresh.io/u/todaywasawesome)\
**Post date:** [November 13, 2019, 5:33pm UTC](https://community.codefresh.io/t/aws-credentials-not-working-from-shell-environment-variable/230/7 "2019-11-13T17:33:11Z")

</div>

@jei I would recommend just sharing the whole thing with support and planning on changing the keys once you’ve identified the issue. I’m assuming the keys are single use here.

Or you could create a duplicate pipeline with dummy keys. My guess would be you have a parsing issue after the secret is decrypted. So work backwards, first in the step just try to echo the variables. If they come back correctly then you know it’s something else. If they don’t then work backwards to when you import the keys.

---

<div class="post-metadata">

**Author:** ![jei](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/jei/32/170_2.png) [@jei](https://community.codefresh.io/u/jei)\
**Post date:** [November 14, 2019, 1:49am UTC](https://community.codefresh.io/t/aws-credentials-not-working-from-shell-environment-variable/230/8 "2019-11-14T01:49:15Z")

</div>

@todaywasawesome No problem. I have created a Support Ticket: [Codefresh](https://support.codefresh.io/hc/en-us/requests/2049)

Hopefully we can find the root cause of the issue and rectify it.

Thank you again @Kostis for the assistance on this matter. I really appreciate it 😃

Have a great day guys!
