Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tags page unauthorized on AWS - Fixed #1073

Open
timhc22 opened this issue Dec 13, 2024 · 1 comment
Open

Tags page unauthorized on AWS - Fixed #1073

timhc22 opened this issue Dec 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@timhc22
Copy link

timhc22 commented Dec 13, 2024

Fixed Issue - see comments


I'm in the process of transferring my blog over to this template (thanks for this) from Jekyll..

I have set it up to deploy to AWS using sst.

The blogs pages and the tag homepage works, but clicking on individual tags gives an error:

<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>REQUEST_ID</RequestId>
<HostId>HOST_ID</HostId>
</Error>

example here: https://unegma.blog/tags (then click a tag)

This seems like the kind of error which I'd usually get when trying to access a file in a private aws bucket, and I'm wondering if it has anything to do with the system trying to fetch the xml files from the public/tags/tag/tag.xml

Any thoughts or ideas? Really not sure how to debug this, but I've done a 'bind' between the application and the bucket in my sst config, so I'm not sure why that would be an issue. Happy to post sst config if useful.


Update:

On further research:

https://unegma.blog/tags/tech?_rsc=1yyo8

These requests are all blocked as well (403), seems to be related to React Server Components?


Update:

Visiting:
https://unegma.blog/tags
Works

Visiting:
https://unegma.blog/tags/
Throws the same unauthorised error as visiting a tag page (e.g. unegma.blog/tags/tag)

Visiting:
https://unegma.blog/posts
Works

Visiting:
https://unegma.blog/posts/
Redirects to the blog page without the trailing /

I'm trying to work out what is happening differently within the application that causes the tag pages to be handled differently, so any feedback on that would be helpful and welcome. Thanks.

@timhc22 timhc22 added the bug Something isn't working label Dec 13, 2024
@timhc22 timhc22 changed the title Tags page unauthorized on AWS Tags page unauthorized on AWS - Fixed Dec 15, 2024
@timhc22
Copy link
Author

timhc22 commented Dec 15, 2024

That was a killer to debug but got there in the end (chatgpt was not really all that helpful either).

so apparently, because the feed.xml files were being put into public/tags/mytag/feed.xml, it was interfering with the nextjs routes (I didn't realise that these routes take precedence over the nextjs router). I solved the issue by putting the rss feed into public/tag/mytag/feed.xml (needed to update the rss generation script and the metadata connecting the blog with the rss feed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant