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

Memcached::set() returns false, and data delayed appearing in memcached when SASL in use #458

Open
rgagnon24 opened this issue Aug 12, 2020 · 1 comment

Comments

@rgagnon24
Copy link

rgagnon24 commented Aug 12, 2020

When running memcached server with options:
memcached -l 127.0.0.1 -U 0 -p 11211 -vvvv -u memcached -S
And then connecting with PHP 7.4 using:

$mc = new \Memcached();
$mc->addServer('127.0.0.1', 11211);
$mc->setOption(\Memcached::OPT_BINARY_PROTOCOL, true);
$mc->setSaslAuthData($username, $password);

When you set data via:
$ok = $mc->set('abc', 'value', 1800);

The value of $ok will be returned false, but the data will appear on the server some time later.

In the meantime, an immediate call to $v = $mc->get('abc'); will fail, but eventually work and return the value.

When SASL is disabled on the server (IE: no -S option), and the setOption() and setSaslAuthData() methods are not used, the value of $ok when performing the set() operation returns true, and an immediate get() call returns the data.

Is there some asynchronous operation happening that is unexpected when using SASL authentication? Is this a php_memcached bug, or a configuration problem in memcached?

I should add that the memcached server is running on CentOS 7 with the cyrus-sasl SASL library using a config file in /etc/sasl2/memcached.conf that has content:

mech_list: plain
log_level: 7
sasldb_path: /etc/sasl2/memcached-sasldb2

@m6w6
Copy link
Contributor

m6w6 commented Jan 18, 2021

Works for me. What's your memcached's output?

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

No branches or pull requests

2 participants