419 after successful login when using memcached #1744

Closed
opened 2026-02-05 01:45:52 +03:00 by OVERLORD · 10 comments
Owner

Originally created by @Totn on GitHub (May 27, 2020).

Describe the bug
After Install the site,I change the session_driver to "memcached",
and using the defaut acount "admin@admin.com" to login,login success but the page show "419|Page Expired", I have checked the memcached and find that have no one value of the site。
When I change the session_dirver back, the login is OK,

So why my site can't drive memcached ? I have double check the memcached configure is correct.

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): branch release, v0.29.3
  • PHP Version: 7.2.30
  • Hosting Method (Nginx/Apache/Docker): Nginx

Additional context
libmemcached version => 1.0.18
memcached_host: 127.0.0.1:11211

Originally created by @Totn on GitHub (May 27, 2020). **Describe the bug** After Install the site,I change the session_driver to "memcached", and using the defaut acount "admin@admin.com" to login,login success but the page show "419|Page Expired", I have checked the memcached and find that have no one value of the site。 When I change the session_dirver back, the login is OK, So why my site can't drive memcached ? I have double check the memcached configure is correct. **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): branch release, v0.29.3 - PHP Version: 7.2.30 - Hosting Method (Nginx/Apache/Docker): Nginx **Additional context** libmemcached version => 1.0.18 memcached_host: 127.0.0.1:11211
OVERLORD added the 🔍 Pending Validation label 2026-02-05 01:45:52 +03:00
Author
Owner

@MoriarT3a commented on GitHub (Jul 7, 2020):

I've this problem if I try to open bookstack with my mobile phone. On my desktop bookstack works very well...

@MoriarT3a commented on GitHub (Jul 7, 2020): I've this problem if I try to open bookstack with my mobile phone. On my desktop bookstack works very well...
Author
Owner

@ssddanbrown commented on GitHub (Jul 10, 2020):

@MoriarT3a Are you also using the memcached session driver?

@ssddanbrown commented on GitHub (Jul 10, 2020): @MoriarT3a Are you also using the memcached session driver?
Author
Owner

@MoriarT3a commented on GitHub (Jul 17, 2020):

Nope. I don't know what I've done. But it works now. Maybe a problem in my dockercontainer....
Sorry can't help you.

@MoriarT3a commented on GitHub (Jul 17, 2020): Nope. I don't know what I've done. But it works now. Maybe a problem in my dockercontainer.... Sorry can't help you.
Author
Owner

@EpicFail113 commented on GitHub (Jan 27, 2021):

I have this same issue after upgrading, I have been looking where to find the .env file to change the session_driver but I have had no luck.

@EpicFail113 commented on GitHub (Jan 27, 2021): I have this same issue after upgrading, I have been looking where to find the .env file to change the session_driver but I have had no luck.
Author
Owner

@EpicFail113 commented on GitHub (Jan 27, 2021):

I have this same issue after upgrading, I have been looking where to find the .env file to change the session_driver but I have had no luck.

From Discord I ran php composer.phar install --no-dev with no luck but then I ran the update command once more and then the clear cache command and I was able to log back in without issue.

@EpicFail113 commented on GitHub (Jan 27, 2021): > I have this same issue after upgrading, I have been looking where to find the .env file to change the session_driver but I have had no luck. From Discord I ran `php composer.phar install --no-dev` with no luck but then I ran the update command once more and then the clear cache command and I was able to log back in without issue.
Author
Owner

@Totn commented on GitHub (Jan 27, 2021):

I think i got the cause;
When the Memcached service is unavailable, laravel's session writing will fail without reporting an error,
resulting in responding 419 where logging in;

@Totn commented on GitHub (Jan 27, 2021): I think i got the cause; When the Memcached service is unavailable, laravel's session writing will fail without reporting an error, resulting in responding 419 where logging in;
Author
Owner

@leopendas commented on GitHub (Apr 21, 2021):

I have the same issue when trying to restore a backup; @Totn could you share more details for fixing this issue?
@EpicFail113 which is the update comand you run? apt update?
thanks in advance!

@leopendas commented on GitHub (Apr 21, 2021): I have the same issue when trying to restore a backup; @Totn could you share more details for fixing this issue? @EpicFail113 which is the update comand you run? apt update? thanks in advance!
Author
Owner

@EpicFail113 commented on GitHub (Jun 8, 2021):

@leopendas I think what I did was elevated terminal with 'sudo su' and then ran the 'git pull origin release && composer install --no-dev && php artisan migrate' command.

@EpicFail113 commented on GitHub (Jun 8, 2021): @leopendas I think what I did was elevated terminal with 'sudo su' and then ran the 'git pull origin release && composer install --no-dev && php artisan migrate' command.
Author
Owner

@tacerus commented on GitHub (Sep 24, 2022):

I encounter this as well when using memcached. Is there a solution or should I open a new issue?

@tacerus commented on GitHub (Sep 24, 2022): I encounter this as well when using `memcached`. Is there a solution or should I open a new issue?
Author
Owner

@tacerus commented on GitHub (Sep 24, 2022):

Turns out, the user my BookStack PHP FPM process was running under did not have read/write access to the memcache socket. I wonder why this is not being logged as an error by Laravel.

@tacerus commented on GitHub (Sep 24, 2022): Turns out, the user my BookStack PHP FPM process was running under did not have read/write access to the memcache socket. I wonder why this is not being logged as an error by Laravel.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1744