So i disconnected Cloudflare from by websapce in the meantime and changed the DNS back to the provider settings to make sure it's nothing DNS related or such, but my problem still presisted.
Then i've been running (i forgot about the debug function 😆 btw) my Flarum in debug mode and tried to create a new discussion:
ERR: 400
POST https://myflarum.net/api/discussions
Flarum\Http\Exception\TokenMismatchException: CSRF token did not match in /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php:47
Stack trace:
#0 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\CheckCsrfToken->process()
#1 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/flarum/core/src/Http/Middleware/ResolveRoute.php(69): Laminas\Stratigility\Next->handle()
#2 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\ResolveRoute->process()
#3 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/flarum/core/src/Http/Middleware/SetLocale.php(51): Laminas\Stratigility\Next->handle()
#4 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\SetLocale->process()
#5 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/flarum/core/src/Http/Middleware/AuthenticateWithHeader.php(58): Laminas\Stratigility\Next->handle()
#6 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\AuthenticateWithHeader->process()
#7 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(31): Laminas\Stratigility\Next->handle()
#8 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\AuthenticateWithSession->process()
#9 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(52): Laminas\Stratigility\Next->handle()
#10 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\RememberFromCookie->process()
#11 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/flarum/core/src/Http/Middleware/StartSession.php(61): Laminas\Stratigility\Next->handle()
#12 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\StartSession->process()
#13 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/flarum/core/src/Api/Middleware/FakeHttpMethods.php(29): Laminas\Stratigility\Next->handle()
#14 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Api\Middleware\FakeHttpMethods->process()
#15 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(28): Laminas\Stratigility\Next->handle()
#16 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\ParseJsonBody->process()
#17 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/flarum/core/src/Http/Middleware/HandleErrors.php(57): Laminas\Stratigility\Next->handle()
#18 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\HandleErrors->process()
#19 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/flarum/core/src/Http/Middleware/InjectActorReference.php(25): Laminas\Stratigility\Next->handle()
#20 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\InjectActorReference->process()
#21 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(81): Laminas\Stratigility\Next->handle()
#22 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/middlewares/request-handler/src/RequestHandler.php(84): Laminas\Stratigility\MiddlewarePipe->process()
#23 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/laminas/laminas-stratigility/src/Next.php(52): Middlewares\RequestHandler->process()
#24 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/middlewares/base-path-router/src/BasePathRouter.php(99): Laminas\Stratigility\Next->handle()
#25 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/laminas/laminas-stratigility/src/Next.php(52): Middlewares\BasePathRouter->process()
#26 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/laminas/laminas-stratigility/src/Middleware/OriginalMessages.php(36): Laminas\Stratigility\Next->handle()
#27 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/laminas/laminas-stratigility/src/Next.php(52): Laminas\Stratigility\Middleware\OriginalMessages->process()
#28 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/middlewares/base-path/src/BasePath.php(73): Laminas\Stratigility\Next->handle()
#29 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/laminas/laminas-stratigility/src/Next.php(52): Middlewares\BasePath->process()
#30 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/flarum/core/src/Http/Middleware/ProcessIp.php(24): Laminas\Stratigility\Next->handle()
#31 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/laminas/laminas-stratigility/src/Next.php(52): Flarum\Http\Middleware\ProcessIp->process()
#32 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(81): Laminas\Stratigility\Next->handle()
#33 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(70): Laminas\Stratigility\MiddlewarePipe->process()
#34 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(73): Laminas\Stratigility\MiddlewarePipe->handle()
#35 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/vendor/flarum/core/src/Http/Server.php(45): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
#36 /var/www/vhosts/hosting707423.a150f.netcup.net/myflarum.net/httpdocs/index.php(26): Flarum\Http\Server->listen()
#37 {main}
My extensions (via composer.json):
"require": {
"askvortsov/flarum-pwa": "",
"askvortsov/flarum-rich-text": "",
"blomstra/fontawesome": "",
"clarkwinkelmann/flarum-ext-likes-received": "",
"clarkwinkelmann/flarum-ext-popular-discussion-badge": "",
"clarkwinkelmann/flarum-ext-readonly-profile": "", - inactive
"darkle/fancybox": "",
"datlechin/flarum-chatgpt": "", - inactive
"dhtml/composer": "",
"flarum-lang/german": "",
"flarum-lang/hungarian": "",
"flarum/approval": "",
"flarum/bbcode": "",
"flarum/core": "1.8",
"flarum/emoji": "",
"flarum/extension-manager": "",
"flarum/flags": "",
"flarum/gdpr": "",
"flarum/lang-english": "",
"flarum/likes": "",
"flarum/lock": "",
"flarum/markdown": "",
"flarum/mentions": "",
"flarum/sticky": "",
"flarum/subscriptions": "",
"flarum/suspend": "",
"flarum/tags": "",
"fof/anti-spam": "", - inactive
"fof/ban-ips": "",
"fof/best-answer": "",
"fof/byobu": "",
"fof/cookie-consent": "",
"fof/formatting": "", - inactive
"fof/frontpage": "",
"fof/ignore-users": "",
"fof/linguist": "",
"fof/links": "",
"fof/nightmode": "",
"fof/pages": "",
"fof/polls": "",
"fof/pretty-mail": "",
"fof/recaptcha": "",
"fof/secure-https": "",
"fof/sitemap": "",
"fof/upload": "",
"fof/user-bio": "",
"ianm/synopsis": "",
"ianm/twofactor": "",
"justoverclock/flarum-ext-hashtag": "",
"kyrne/websocket": "", - inactive
"michaelbelgium/flarum-profile-views": "",
"the-turk/flarum-stickiest": "",
"v17development/flarum-seo": ""
},!<
Chatgpt says he notices a CSRF token mismatch Flarum\Http\Exception\TokenMismatchException: CSRF token did not match (i provided him the logs from the 17th and 18th of nov. since everything started to go downhill around that time with Flarum)see here:
- No Errors or Critical Issues Found: In both logs, there were no critical errors or warnings that pointed directly to the cause of the issue (such as server misconfigurations or database problems). This suggests that the server and database were functioning normally around those dates.
-
- Update Activity: The logs show that there was no direct indication of a Flarum update happening during this period, but there are entries related to the application interacting with different parts of the site. No specific action (like an upgrade from Flarum 1.8.8 to 1.8.9) appears in the logs from November 17 or 18. This could mean that either the update didn’t log properly, or no update was performed during this time.
-
- TokenMismatchError (CSRF Token Issues): A recurring problem in the logs is related to CSRF (Cross-Site Request Forgery) token mismatches. This indicates that users are unable to submit new discussions or comments due to session or token issues, likely because the CSRF token used in the request does not match the one expected by the server. This could be linked to the caching or session management issue you're facing, where the CSRF token is not refreshed properly.
-
- Request Handling: There are numerous entries related to the middleware and routing process, which suggests that requests are being properly processed by the system. However, when these requests are reaching the API endpoints (e.g., for posting discussions), the CSRF token mismatch prevents them from being completed. This might be due to outdated sessions or improperly cached tokens.
-
- Missing Update Logs: There is no specific log entry indicating that the Flarum application was updated on these dates, which could imply that either the update process did not trigger proper logging or no updates took place during this period.
-
- Summary:
- The logs do not show any fatal errors or major misconfigurations but suggest a session or CSRF token problem, which may be why new discussions cannot be posted.
- There is no evidence of a Flarum version update in the logs from November 17 and 18.
- The CSRF token issue is a central point and likely the cause of the issues you're encountering, which might be related to session management or caching.
-
- I recommend focusing on the CSRF token issue and testing if the token mismatch is connected to caching, session handling, or proxy issues like Cloudflare. You may need to clear or regenerate session tokens to resolve the issue.
Does this all make any sense to you?
TYIA