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

Memcache (also Memcached) as session handler. ~15s wait time on login and PHP notice #19189

Closed
rovexo opened this issue Dec 27, 2017 · 9 comments

Comments

@rovexo
Copy link

rovexo commented Dec 27, 2017

Steps to reproduce the issue

  • Use memcache (or memcached) as session handler in Joomla config
  • Login (either site or admin)
  • See PHP error logs

Using memcache (also memcached) as session handler seems make a delay in logins (site and admin) for about 15s but succeeds eventually. PHP notice says (immediately after hitting 'login'):

4096: session_regenerate_id(): Failed to create(read) session ID
in
/libraries/joomla/session/handler/native.php on line:151

memcache does seem work normal for Joomla's caching (and usage in another extension using the native functions).

Interestingly wait time is almost precisely the time of setting memcache.lock_timeout (15s)

The PHP notice comes immediately after hitting 'login', then the 15s, then the redirect to the backend.

I tried memcache and memcached as cache handlers, the session issue is the same in both cases.

Hope that helps!

System information

Software versions

Ubuntu 16.04 (all original repos)
nginx 1.11.10
PHP 7.0.22 via FPM SAPI
Joomla 3.8.3 (no non-joomla auth or login plugins)
memcached 1.4.25 (hosted on same box, accessed via standard port and localhost as hostname)

memcache php module: 3.0.9-dev
memcached php module: 2.2.0
libmemcached version: 1.0.18

memcache PHP info copy/paste:

memcache
memcache support enabled
Version 3.0.9-dev
Revision $Revision$
Directive Local Value Master Value
memcache.allow_failover 1 1
memcache.chunk_size 32768 32768
memcache.compress_threshold 20000 20000
memcache.default_port 11211 11211
memcache.hash_function crc32 crc32
memcache.hash_strategy consistent consistent
memcache.lock_timeout 15 15
memcache.max_failover_attempts 20 20
memcache.protocol ascii ascii
memcache.redundancy 1 1
memcache.session_redundancy 2 2

From Joomla configuration:

session_handler memcache
memcache_persist 1
memcache_compress 0
memcache_server_host localhost
memcache_server_port 11211
memcached_persist 1
memcached_compress 0
memcached_server_host localhost
memcached_server_port 11211

attached you also find the full PHP info text file.

@ghost
Copy link

ghost commented Jan 26, 2018

Anyone Experience with Memcache and can comment this Issue?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19189.

@brianteeman
Copy link
Contributor

i am going to close this as their have been a lot of changes to this part of the code base since the report. If it is still an issue with the current release it can always be reopened

@gundestrup
Copy link

gundestrup commented Apr 3, 2018

I am still having this as an issue, on 3.8.5
Getting errors like
Warning: session_start(): Unable to clear session lock record in /home/svgu/gl-oelstykke.dk/libraries/joomla/session/handler/native.php on line 260

Warning: session_start(): Failed to read session data: memcached (path: localhost:11211) in /home/svgu/gl-oelstykke.dk/libraries/joomla/session/handler/native.php on line 260
Error: Failed to start application: Failed to start the session

@PhilETaylor

This comment was marked as abuse.

@gundestrup
Copy link

gundestrup commented Jun 12, 2018 via email

@PhilETaylor

This comment was marked as abuse.

@loureirorg
Copy link

Same issue:

  • Joomla!: 3.9.3
  • PHP 7.1.28-1
  • Memcached: 3.1.3 (connected through unix socket)
  • OS: Ubuntu 16.04.1

Messages:
Warning: session_start(): Unable to clear session lock record in /var/www/mysite/staging/libraries/joomla/session/handler/native.php on line 260
Warning: session_start(): Failed to read session data: memcached (path: /tmp/memcached.sock:11211) in /var/www/mysite/staging/libraries/joomla/session/handler/native.php on line 260
Error: Failed to start application: Failed to start the session


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19189.

@ghost
Copy link

ghost commented Apr 24, 2019

@loureirorg please update on latest Version.

@HLeithner
Copy link
Member

@loureirorg could you please create a new issue because your report is unrelated to the original issue, also I think the reason is because we are unable to connect to UDS, I create a PR #24073 that is not tested so it can't be merged.

Please test the PR and mark it as successful so we can merge it into Joomla.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants