Skip to content

Commit 4ab15d6

Browse files
committed
update Reademe file
1 parent adc84b0 commit 4ab15d6

File tree

1 file changed

+41
-4
lines changed

1 file changed

+41
-4
lines changed

README.md

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,40 @@ And I will get back a 200 OK response of the below form-data
6868

6969
[Small note on .env file - When putting the value for "AWS_Uploaded_File_URL_LINK" - I have to include a forward slash ("/") after ]
7070

71-
### Issue I faced after changing the AWS credentials - Upload was failing and in Postman was getting error something like "The AWS Key is not found in our system"
71+
### Bit Time-wasting Issue I faced after changing the AWS credentials - Upload was failing and in Postman was getting below error -
72+
73+
```js
74+
{
75+
"error": true,
76+
"Message": {
77+
"message": "The AWS Access Key Id you provided does not exist in our records.",
78+
"code": "InvalidAccessKeyId",
79+
"region": null,
80+
"time": "2018-12-03T03:35:06.814Z",
81+
"requestId": "CB10MJLKH';K329221D58F",
82+
"extendedRequestId": "buSOYR4iBPxaCyNsn3WhggsgkkkUT:"669Y;g;fk;gffLuJe2596PO1464RRw+is7Gg=",
83+
"statusCode": 403,
84+
"retryable": false,
85+
"retryDelay": 5.089012444180119
86+
}
87+
}
88+
```
7289
7390
The app was taking old `process.env` variable rather than what I set inside the app in the .enf file - 29-Nov-2018
7491
7592
The backend Route for document upload will not take what I was setting up in the .env file rathar was taking from a catch.
7693
77-
So in the backend upload routes .js file I put the below to see what it was throwing.
94+
So in the backend upload routes .js file I put the `console.log()` code to see what it was throwing.
95+
96+
```js
97+
let s3bucket = new AWS.S3({
98+
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
99+
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
100+
region: process.env.AWS_REGION
101+
});
102+
```
103+
104+
Just below the above code in routes.js file put the below code
78105
79106
```js
80107
console.log(process.env.AWS_BUCKET_NAME);
@@ -86,10 +113,20 @@ console.log(process.env.AWS_Uploaded_File_URL_LINK);
86113
87114
And saw it was taking a completely wrong AWS credentials.
88115
89-
Then I ran the command `unset AWS_ACCESS_KEY_ID`, which was deleting the key and after doing this unset, then running
116+
Then first I ran the following commands
90117
91118
`echo $AWS_ACCESS_KEY_ID`
92119
93-
was no more showing the value in the terminal, but as soon as I send a POST request to upload a document with Postman, again, I will get back that wrong key in the Terminal
120+
`echo $AWS_SECRET_ACCESS_KEY`
121+
122+
And both will give different credentials than what I have in .env file.
123+
124+
Then I ran the command
125+
126+
`unset AWS_ACCESS_KEY_ID`
127+
128+
`unset AWS_SECRET_ACCESS_KEY`
129+
130+
which was deleting the key and after doing this unset, then running `echo $AWS_ACCESS_KEY_ID` was no more showing the value in the terminal, but as soon as I send a POST request to upload a document with Postman, again, I will get back that wrong key in the Terminal
94131
95132
### Final Solution - Plain old whole full system (my local machine) restart.

0 commit comments

Comments
 (0)