heroku-buildpack-php-tyler icon indicating copy to clipboard operation
heroku-buildpack-php-tyler copied to clipboard

Memcached::setSalsAuthData() not found

Open martijngastkemper opened this issue 12 years ago • 5 comments

I got this error and tried to solve it by enabling memcache sasl (memcached.use_sasl = On). That didn't work. I tried to compile memcached with --enable-memcached-sasl, but that didn't work to. On support/vulcan-build-php.sh line 106 (sed -i -e '21 s/no, no/yes, yes/' ./config.m4) config.m4 is modified and that seems to enable sasl during the memcached compilation.

I also tried to compile libmemcached with --with-memcached_sasl, but that didn't work to. Does somebody use this buildpack with a memcache service authenticated by sasl?

martijngastkemper avatar Apr 21 '13 18:04 martijngastkemper

While I don't currently use SASL for memcached, I suspect the following might bring us a clue on why it isn't working:

~/vendor/php/lib/php/extensions/no-debug-non-zts-20100525 $ ldd memcached.so 
        linux-vdso.so.1 =>  (0x00007fffca9e6000)
        libmemcached.so.10 => /app/local/lib/libmemcached.so.10 (0x00007fc8319ff000)
        libz.so.1 => /lib/libz.so.1 (0x00007fc8317e2000)
        libc.so.6 => /lib/libc.so.6 (0x00007fc83145e000)
        librt.so.1 => /lib/librt.so.1 (0x00007fc831256000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fc830f42000)
        libm.so.6 => /lib/libm.so.6 (0x00007fc830cbe000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007fc830aa7000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fc831e57000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00007fc83088a000)
~/local/lib $ ldd libmemcached.so.10
        linux-vdso.so.1 =>  (0x00007fff14bff000)
        librt.so.1 => /lib/librt.so.1 (0x00007f6d753b6000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f6d750a2000)
        libm.so.6 => /lib/libm.so.6 (0x00007f6d74e1e000)
        libc.so.6 => /lib/libc.so.6 (0x00007f6d74a9b000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f6d74884000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00007f6d74666000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f6d75807000)

I suspect that SASL headers/libraries were missing during compile-time and run-time. If that's the case, the SASL libraries would need to be bundled in the same way as libmemcached, before libmemcached is built.

What do you think?

iphoting avatar Apr 22 '13 01:04 iphoting

After I created the issue if found the following lines in the log file ./configure creates:

configure:21368: result: no
configure:21407: checking sasl/sasl.h usability
configure:21407: gcc -c -g -O2   conftest.c >&5
conftest.c:175:23: error: sasl/sasl.h: No such file or directory

I looked in the libmemcached source files and there are 2 sasl.h file present.

Another point: the php memcached documentation (http://www.php.net/manual/en/memcached.installation.php) says the following: "This requires that libsasl2 has been installed and that libmemcached has been built with SASL support enabled." But I don't now how to check if libsasl2 is precent on a Heroku dyno.

martijngastkemper avatar Apr 22 '13 10:04 martijngastkemper

Within your application source directory, run heroku run bash.

This way, you get a shell and can dig into the lib and include directories to see if libsasl2 exists.

iphoting avatar Apr 22 '13 10:04 iphoting

I searched for sasl.h (find / -iname sasl), but I no results. But isn't it strange that sasl.h is present in the source files and that it can't be found by the compiler?

martijngastkemper avatar Apr 22 '13 11:04 martijngastkemper

Here's what I found on a heroku run bash:

/ $ find / -iname '*sasl*'
find: `/proc/tty/driver': Permission denied
find: `/proc/1/task/1/fd': Permission denied
find: `/proc/1/task/1/fdinfo': Permission denied
find: `/proc/1/fd': Permission denied
find: `/proc/1/fdinfo': Permission denied
/usr/share/man/man3/ldap_parse_sasl_bind_result.3.gz
/usr/share/man/man3/ldap_sasl_bind.3.gz
/usr/share/man/man3/ldap_sasl_bind_s.3.gz
/usr/share/lintian/overrides/libsasl2-modules
/usr/share/doc/libsasl2-2
/usr/share/doc/libsasl2-modules
/usr/local/lib/erlang/bin/start_sasl.boot
/usr/local/lib/erlang/releases/R14B04/start_sasl.rel
/usr/local/lib/erlang/releases/R14B04/start_sasl.script
/usr/local/lib/erlang/releases/R14B04/start_sasl.boot
/usr/local/lib/erlang/lib/sasl-2.1.10
/usr/local/lib/erlang/lib/sasl-2.1.10/ebin/sasl_report.beam
/usr/local/lib/erlang/lib/sasl-2.1.10/ebin/si_sasl_supp.beam
/usr/local/lib/erlang/lib/sasl-2.1.10/ebin/sasl_report_tty_h.beam
/usr/local/lib/erlang/lib/sasl-2.1.10/ebin/sasl.beam
/usr/local/lib/erlang/lib/sasl-2.1.10/ebin/sasl.appup
/usr/local/lib/erlang/lib/sasl-2.1.10/ebin/sasl.app
/usr/local/lib/erlang/lib/sasl-2.1.10/ebin/sasl_report_file_h.beam
/usr/local/lib/erlang/lib/sasl-2.1.10/src/sasl_report.erl
/usr/local/lib/erlang/lib/sasl-2.1.10/src/sasl_report_tty_h.erl
/usr/local/lib/erlang/lib/sasl-2.1.10/src/si_sasl_supp.erl
/usr/local/lib/erlang/lib/sasl-2.1.10/src/sasl.erl
/usr/local/lib/erlang/lib/sasl-2.1.10/src/sasl_report_file_h.erl
/usr/lib/libsasl2.so.2
/usr/lib/sasl2
/usr/lib/sasl2/libsasldb.so.2
/usr/lib/sasl2/libsasldb.a
/usr/lib/sasl2/libsasldb.so.2.0.23
/usr/lib/sasl2/libsasldb.la
/usr/lib/sasl2/libsasldb.so
/usr/lib/libsasl2.so.2.0.23
find: `/lost+found': Permission denied
find: `/etc/ssl/private': Permission denied
/app/local/share/man/man3/memcached_set_sasl_callbacks.3
/app/local/share/man/man3/memcached_sasl_set_auth_data.3
/app/local/share/man/man3/memcached_get_sasl_callbacks.3
/app/local/share/man/man3/memcached_destroy_sasl_auth_data.3
/app/local/include/libmemcached-1.0/sasl.h
/app/local/include/libmemcached-1.0/struct/sasl.h
/var/lib/dpkg/info/libsasl2-modules.md5sums
/var/lib/dpkg/info/libsasl2-2.md5sums
/var/lib/dpkg/info/libsasl2-2.shlibs
/var/lib/dpkg/info/libsasl2-modules.list
/var/lib/dpkg/info/libsasl2-2.postrm
/var/lib/dpkg/info/libsasl2-2.list
/var/lib/dpkg/info/libsasl2-2.postinst

From what I can see here. The SASL libraries are installed, but they are missing headers (which should live in /usr/include/sasl/sasl.h).

It looks like a solution would be to bundle the SASL libraries and headers before compiling libmemcached.

That being said, I noticed that both libmemcached and memcached are due to be updated. However, as I have no testing infrastructure for memcache, I'm hesitant.

iphoting avatar Apr 22 '13 12:04 iphoting