• Support
  • Oops! Something went wrong.... again

Hi! I have a fresh installation of Flarum beta 11. I can't log in.

Here is log

POST https://onthetable.top/forum/login

Flarum\Http\Exception\TokenMismatchException: CSRF token did not match in file /home/itcomp/onthetable.top/www/forum/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php on line 34
Stack trace:
  1. Flarum\Http\Exception\TokenMismatchException->() /home/itcomp/onthetable.top/www/forum/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php:34
  2. Flarum\Http\Middleware\CheckCsrfToken->process() /home/itcomp/onthetable.top/www/forum/vendor/zendframework/zend-stratigility/src/Next.php:60
  3. Zend\Stratigility\Next->handle() /home/itcomp/onthetable.top/www/forum/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php:32
  4. Flarum\Http\Middleware\AuthenticateWithSession->process() /home/itcomp/onthetable.top/www/forum/vendor/zendframework/zend-stratigility/src/Next.php:60
  5. Zend\Stratigility\Next->handle() /home/itcomp/onthetable.top/www/forum/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php:51
  6. Flarum\Http\Middleware\RememberFromCookie->process() /home/itcomp/onthetable.top/www/forum/vendor/zendframework/zend-stratigility/src/Next.php:60
  7. Zend\Stratigility\Next->handle() /home/itcomp/onthetable.top/www/forum/vendor/flarum/core/src/Http/Middleware/StartSession.php:61
  8. Flarum\Http\Middleware\StartSession->process() /home/itcomp/onthetable.top/www/forum/vendor/zendframework/zend-stratigility/src/Next.php:60
  9. Zend\Stratigility\Next->handle() /home/itcomp/onthetable.top/www/forum/vendor/flarum/core/src/Http/Middleware/CollectGarbage.php:46
 10. Flarum\Http\Middleware\CollectGarbage->process() /home/itcomp/onthetable.top/www/forum/vendor/zendframework/zend-stratigility/src/Next.php:60
 11. Zend\Stratigility\Next->handle() /home/itcomp/onthetable.top/www/forum/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php:28
 12. Flarum\Http\Middleware\ParseJsonBody->process() /home/itcomp/onthetable.top/www/forum/vendor/zendframework/zend-stratigility/src/Next.php:60
 13. Zend\Stratigility\Next->handle() /home/itcomp/onthetable.top/www/forum/vendor/flarum/core/src/Http/Middleware/HandleErrors.php:57
 14. Flarum\Http\Middleware\HandleErrors->process() /home/itcomp/onthetable.top/www/forum/vendor/zendframework/zend-stratigility/src/Next.php:60
 15. Zend\Stratigility\Next->handle() /home/itcomp/onthetable.top/www/forum/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php:83
 16. Zend\Stratigility\MiddlewarePipe->process() /home/itcomp/onthetable.top/www/forum/vendor/middlewares/request-handler/src/RequestHandler.php:84
 17. Middlewares\RequestHandler->process() /home/itcomp/onthetable.top/www/forum/vendor/zendframework/zend-stratigility/src/Next.php:60
 18. Zend\Stratigility\Next->handle() /home/itcomp/onthetable.top/www/forum/vendor/middlewares/base-path-router/src/BasePathRouter.php:97
 19. Middlewares\BasePathRouter->process() /home/itcomp/onthetable.top/www/forum/vendor/zendframework/zend-stratigility/src/Next.php:60
 20. Zend\Stratigility\Next->handle() /home/itcomp/onthetable.top/www/forum/vendor/zendframework/zend-stratigility/src/Middleware/OriginalMessages.php:41
 21. Zend\Stratigility\Middleware\OriginalMessages->process() /home/itcomp/onthetable.top/www/forum/vendor/zendframework/zend-stratigility/src/Next.php:60
 22. Zend\Stratigility\Next->handle() /home/itcomp/onthetable.top/www/forum/vendor/middlewares/base-path/src/BasePath.php:53
 23. Middlewares\BasePath->process() /home/itcomp/onthetable.top/www/forum/vendor/zendframework/zend-stratigility/src/Next.php:60
 24. Zend\Stratigility\Next->handle() /home/itcomp/onthetable.top/www/forum/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php:83
 25. Zend\Stratigility\MiddlewarePipe->process() /home/itcomp/onthetable.top/www/forum/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php:72
 26. Zend\Stratigility\MiddlewarePipe->handle() /home/itcomp/onthetable.top/www/forum/vendor/zendframework/zend-httphandlerrunner/src/RequestHandlerRunner.php:95
 27. Zend\HttpHandlerRunner\RequestHandlerRunner->run() /home/itcomp/onthetable.top/www/forum/vendor/flarum/core/src/Http/Server.php:44
 28. Flarum\Http\Server->listen() /home/itcomp/onthetable.top/www/forum/index.php:23

    datitisev Already done, it does not help. Nothning changes in fact. I refreshed page with Ctrl+R (to reload cache) too.

    clarkwinkelmann Yeah, thank you. Sorry for messing up with topics.

    Flarum core 0.1.0-beta.11.1
    PHP version: 7.1.33
    Loaded extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, gettext, gmp, SPL, iconv, session, interbase, intl, json, mbstring, mcrypt, standard, mysqlnd, pcntl, mysqli, PDO, PDO_Firebird, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, readline, Reflection, imap, shmop, SimpleXML, soap, sockets, exif, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip
    +----------------------+----------------+--------+
    | Flarum Extensions    |                |        |
    +----------------------+----------------+--------+
    | ID                   | Version        | Commit |
    +----------------------+----------------+--------+
    | flarum-approval      | v0.1.0-beta.8  |        |
    | flarum-bbcode        | v0.1.0-beta.8  |        |
    | flarum-emoji         | v0.1.0-beta.10 |        |
    | flarum-lang-english  | v0.1.0-beta.11 |        |
    | flarum-flags         | v0.1.0-beta.10 |        |
    | flarum-likes         | v0.1.0-beta.9  |        |
    | flarum-lock          | v0.1.0-beta.9  |        |
    | flarum-markdown      | v0.1.0-beta.10 |        |
    | flarum-mentions      | v0.1.0-beta.10 |        |
    | flarum-statistics    | v0.1.0-beta.9  |        |
    | flarum-sticky        | v0.1.0-beta.9  |        |
    | flarum-subscriptions | v0.1.0-beta.9  |        |
    | flarum-suspend       | v0.1.0-beta.10 |        |
    | flarum-tags          | v0.1.0-beta.11 |        |
    +----------------------+----------------+--------+
    Base URL: https://onthetable.top/forum
    Installation path: /home/itcomp/onthetable.top/www/forum
    Debug mode: ON
    Don't forget to turn off debug mode! It should never be turned on in a production system.

    tolgaaaltas I just totally do not understand what I should do. It has htaccess from distribution. I uncommented some lines because moved public files to forum root and made all the needed changes in index.php and flarum files.

    Oh one more. I had to comment the line with MultiViews option in .htaccess because my hosting did not want to work with it. But I previously had flarum beta 7 and everything worked well with this option commented.

    maleficmax No, just a redirect from www to https://yourdomain.top/forum.

    In your .htaccess file, after RewriteEngine on, add something like this:

    RewriteCond %{HTTPS} off [OR]
    RewriteCond %{HTTP_HOST} ^www\. [NC]
    RewriteRule ^ https://yourdomain.top%{REQUEST_URI} [L,NE,R=301]

    There are some more explanation on what it does here: https://simonecarletti.com/blog/2016/08/redirect-domain-http-https-www-apache/

      andreherberth
      And it did not work. After adding these lines after RewriteEngine on forum stops loading and browser shows me error about wrong redirection. I checked and rechecked redirect lines, they must be OK. Read the blog entry and everything seems to be fine, but here we are.

      But redirect works, error is showed when adress line shows adress without www in it 🙂

      UPD. This should be added in the forum's htaccess or in the root .htaccess of the whole site?

      After pressing "Log In" I can see 400 Bad Request error in browser log while requesting https://(mysite).top/forum/login URL

      If I try to go to https://(mysite).top/forum/login directly, I (of course) get a MethodNotAllowedException, but have an interesting info in details:
      REDIRECT_SCRIPT_URI http://(mysite).top/forum/login
      SCRIPT_URI http://(mysite).top/forum/login
      (HTTP, not HTTPS here!)
      Is ot OK?

      My htaccess code above was to ensure that visitors would always use the address from your config file.

      Right now, visiting your site, I get this debug message:

      GET https://yoursite.top/forum/api/posts?filter%5Buser%5D=2&filter%5Btype%5D=comment&page%5Blimit%5D=20&sort=-createdAt
      
      <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
      <html><head>
      <title>404 Not Found</title>
      </head><body>
      <h1>Not Found</h1>
      <p>The requested URL /forum/api.php was not found on this server.</p>
      </body></html>

      I managed to register successfully though, so the forum is working.
      So, to me this indicate a rewrite error.

      I would not be surprised if you have an htaccess file in your root folder that could potentially override something in the forum folder.

      Contact me on discord if you want further help 🙂