You are here: Troubleshooting.
Why this page exists: Fixes for common deployment problems.

Troubleshooting

/beta/ gives AccessDenied

The Lambda can run, but its IAM role probably cannot list the bucket prefix.

Check s3:ListBucket permission and the s3:prefix condition.

/beta/ gives 404

The Lambda@Edge function may not be attached to the CloudFront behavior, or you are testing /beta without the slash.

This project redirects /beta to /beta/ only if Lambda is actually running.

CloudFront says Lambda role cannot be assumed

Edit the Lambda role trust policy and include:

edgelambda.amazonaws.com

I changed the Lambda but nothing changed online

Lambda@Edge uses published versions.

You must:

1. Deploy the code.

2. Publish a new version.

3. Update CloudFront to the new version ARN.

4. Wait for CloudFront to deploy.

5. Invalidate if needed.

PHP files still download

The directory browser Lambda is not responsible for file headers.

Attach the companion CloudFront Function on Viewer response.

Then check DevTools Network Headers for:

content-type: text/plain; charset=utf-8
content-disposition: inline
x-myanything-source: cloudfront-edge

Markdown files do not render like GitHub

Chrome displays Markdown as raw text. That is normal.

This starter kit makes .md files open inline instead of downloading. Rendering Markdown as styled HTML would require an additional viewer or renderer.

Sorting does not work

Make sure the browser is receiving the latest generated HTML. Invalidate the folder page or use a hard refresh.

Emoji icons look wrong

The generated page includes an emoji-friendly font stack for the icon span. If a system still does not have color emoji fonts, the icons may display as fallback glyphs. The app still works.

Where to go next

AWS recursive loop warning

If AWS reports a Lambda recursive loop, deploy v63 or newer of the updater. The updater must not write folder marker objects from an S3 event. Folder dates should come from the derived metadata inside .directory-index.json.

S3 SlowDown during uploads

If S3 Browser shows SlowDown during a multi-file upload, deploy v67 or newer of the updater. v67 uses event coalescing so one folder rebuild handles a burst of upload events instead of every object event launching duplicate recursive work.

Directory Lambda not running for a prefix

If a page shows a redirect HTML/XML object, or if View Source does not contain a directory-source marker, CloudFront is probably not sending that path through the directory-browser Lambda@Edge association.

Check the matching behavior, origin, and numbered Lambda@Edge version. See CloudFront Behavior Requirements.