Forem Creators and Builders

nobody
nobody

Posted on

cannot edit a comment without refresh

issue

Hi we self host a forum using Forem over AWS with Cloudflare as cdn. I just notice that user cannot edit his comment without refresh the page.

Image description
in this example, no response will be given if I click the three button right after I post the comment.
Image description
However, if I refresh the page, everything works just fine again.
The same issue happens when I try to edit a comment.

Image description
after I submit my revised comment, an empty page will be returned.

my finding

In

journalctl -f -u forem-rails.service

, I find

Can't verify CSRF token authenticity

.

In safari's inspection window, I find there are some errors.
Image description

Discussion (4)

Collapse
ellativity profile image
Ella (she/her/elle)

Hey @charliebbs, thanks for sharing this issue. Which version of Forem are you currently running? I ask, because I believe this issue that has been fixed.

You can find your version with

foremctl version
Enter fullscreen mode Exit fullscreen mode
Collapse
johndoes profile image
nobody Author • Edited on

thank you for reply

Repository: quay.io/forem/forem:latest SHA256: 6e792b0ec4d12418576ea7993d81aa858479651a2b1eb33a43843260b9d27e00 Created: 23 hours ago

edit: I just run

foremimg quay.io/forem/forem:testing


foremctl update


foremctl depoly

to update the image to the testing branding, but the issue still persists.

Collapse
jamie profile image
Jamie Gaskins

@charliebbs You have a typo in foremctl deploy in there. Is that how you typed it into the command line? If so, you may still be running the previous version.

I'm unable to reproduce this on my own selfhosted Forem instance running on the latest container image. You mention you're using Cloudflare, though, and I'm not, which makes me think this might be a caching issue with the CDN. Specifically, it could be caching pages with outdated CSRF tokens in them. If you point your DNS directly at your Forem instance, does the issue persist?

Thread Thread
johndoes profile image
nobody Author • Edited on

yes, I think Cloudflare is the issue. I deployed another development instance with docker-compose yesterday. Everything works fine if I connect to it directly with its ip address. However, if I use reverse proxy + Cloudflare to connect to it, the bug appears again. Just want to let everybody who reads here realize Forem is currently NOT compatible with Cloudflare.
Thank you Jamie.