Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

s3 cloudfront app Code: NoSuchKey on refreshing

I have my angular2 webapp hosted in s3. it has cloudfront as well. Its connecting to nodejs as backend which is in different machine in AWS EBS.

My web application works fine.But when i refresh any page , its throwing 404 Not Found with the below message.

Code: NoSuchKey
Message: The specified key does not exist.
Key: user/adduser/edit
RequestId: CA306FFABB30FB75
HostId: WAp7/BZMHH0UpE3z2dJLJT4gqEwv7u/LKbFTUuHH86lRyReLXvODLgTuTw+3emnTJ3jDj2VpiYo=

Can you help to resolve this?

like image 711
Janier Avatar asked Mar 24 '17 17:03

Janier


People also ask

What does NoSuchKey mean?

NoSuchKey means it cannot find the topic. I should've created both the topic and bucket notification using same credentials. But when creating the topic, it allowed me to create without any credential and ended up being created under anonymous user. That is what has caused it to throw NoSuchKey error.

How do I fix AWS 404 error?

If the requested object was available in the S3 bucket for some time and you receive a 404 NoSuchKey error again, then check the following: Confirm that the request matches the object name exactly, including the capitalization of the object name. Requests for S3 objects are case sensitive.

How long do CloudFront invalidations take?

Object invalidations typically take from 10 to 100 seconds to complete. You can check the status of an invalidation by viewing your distribution from the CloudFront console.

How do I access my S3 bucket from CloudFront?

Open the CloudFront console. Choose Create Distribution. Under Origin, for Origin domain, choose your S3 bucket's REST API endpoint from the dropdown list. Or, enter your S3 bucket's website endpoint.


1 Answers

I am not sure if its the correct thing to do.But it fixed my issue. I configured s3 404 redirection url to be my index.html.ie pointed my 404 redirection to index.html itself. It worked.

like image 97
Janier Avatar answered Oct 15 '22 20:10

Janier