Bug 22217 - error "Connection to the memcached servers '__MEMCACHED_SERVERS__' failed" during install
Summary: error "Connection to the memcached servers '__MEMCACHED_SERVERS__' failed" du...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Installation and upgrade (command-line installer) (show other bugs)
Version: Main
Hardware: PC Linux
: P3 normal with 20 votes (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
: 22606 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-01-28 16:42 UTC by Giuseppe Ciaccio
Modified: 2020-06-08 12:18 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Giuseppe Ciaccio 2019-01-28 16:42:10 UTC
I'm trying to install Koha on a fresh Debian 9.7 32-bit, following the instructions at https://wiki.koha-community.org/wiki/Koha_on_Debian  .  I work as root so I have all privileges.

One of the installation steps consists of editing file /etc/koha/koha-sites.conf .  Inside koha-sites.con, I find the following row:

USE_MEMCACHED="yes"

1.1) start memcached in the localhost
(this action is not reported in the instructions but is needed):

root@myhost:~# service memcached start

1.2) ensure that memcached is indeed active and listening at port 11211

root@myhost:~# ps ax
  PID TTY      STAT   TIME COMMAND
...
16908 ?        S      0:00 /usr/sbin/apache2 -k start
16909 ?        S      0:00 /usr/sbin/apache2 -k start
16910 ?        S      0:00 /usr/sbin/apache2 -k start
16920 ?        Ssl    0:00 /usr/bin/memcached -m 64 -p 11211 -u memcache -l 127.
...

1.3) proceed with install procedure, get worrying error messages

root@myhost:~# koha-create --create-db mylibrary

Koha instance is empty, no staff user created.
[ ok ] Starting Koha indexing daemon for mylibrary:.

root@myhost:~# koha-translate --install it-IT

Connection to the memcached servers '__MEMCACHED_SERVERS__' failed. Are the unix socket permissions set properly? Is the host reachable?
If you ignore this warning, you will face performance issues

Connection to the memcached servers '__MEMCACHED_SERVERS__' failed. Are the unix socket permissions set properly? Is the host reachable?
If you ignore this warning, you will face performance issues
Use of uninitialized value $pref_name in concatenation (.) or string at /usr/share/koha/misc/translator/LangInstaller.pm line 197.
Use of uninitialized value $pref_name in concatenation (.) or string at /usr/share/koha/misc/translator/LangInstaller.pm line 239.

1.4) at this point, try not to use memcached and repeat the koha-translate step, get same error as before

root@myhost:~# vi /etc/koha/koha-sites.conf
...set USE_MEMCACHED="no"

root@myhost:~# koha-translate --update it-IT

Connection to the memcached servers '__MEMCACHED_SERVERS__' failed. Are the unix socket permissions set properly? Is the host reachable?
If you ignore this warning, you will face performance issues

Connection to the memcached servers '__MEMCACHED_SERVERS__' failed. Are the unix socket permissions set properly? Is the host reachable?
If you ignore this warning, you will face performance issues
Use of uninitialized value $pref_name in concatenation (.) or string at /usr/share/koha/misc/translator/LangInstaller.pm line 197.
Use of uninitialized value $pref_name in concatenation (.) or string at /usr/share/koha/misc/translator/LangInstaller.pm line 239.


So it seems that

I) the language installer tries to connect to memcached, no matter the value of USE_MEMCACHED

II) the language installer fails to connect to memcached even if the daemon is up and listening to the right port.
Comment 1 David Cook 2019-09-02 06:21:23 UTC
These are more so warnings than errors. I think you can safely ignore them, although Koha really should be updated to prevent the warnings from showing in the first place.
Comment 2 Tomás Cohen Arazi 2020-01-28 03:12:59 UTC
This weird warning should be removed.
Comment 3 David Cook 2020-01-28 07:46:14 UTC
(In reply to Tomás Cohen Arazi from comment #2)
> This weird warning should be removed.

+1
Comment 4 Jonathan Druart 2020-05-26 13:17:17 UTC
What's happening?
debian/scripts/koha-translate set KOHA_CONF (for non-dev installs) to /etc/koha/koha-conf-site.xml.in, ecause our LangInstaller module needs some paths from there (like intrahtdoc).
The problem is that this koha-conf does not have a valid memcached config, and so we reach Koha::Cache without correct values and get the warning.

We definitively can ignore this warning, but it would be better to remove it of course. However I have no idea how to clean that.
Comment 5 David Cook 2020-05-26 23:28:08 UTC
(In reply to Jonathan Druart from comment #4)
> What's happening?
> debian/scripts/koha-translate set KOHA_CONF (for non-dev installs) to
> /etc/koha/koha-conf-site.xml.in, ecause our LangInstaller module needs some
> paths from there (like intrahtdoc).
> The problem is that this koha-conf does not have a valid memcached config,
> and so we reach Koha::Cache without correct values and get the warning.
> 
> We definitively can ignore this warning, but it would be better to remove it
> of course. However I have no idea how to clean that.

I've thought of a few strategies. The easiest is probably to add an environmental variable to koha-translate that can prevent L2 caching from being initialized in Koha::Cache.

Alternatively:
1. Remove the dependency on C4::Context in LangInstaller, and instead pass intranetdir, opacdir, intrahtdocs, and opachtdocs as arguments to the LangInstaller constructor. 
2. Customize C4::Context and Koha::Caches to pass an argument to the Koha::Cache constructor to prevent L2 (ie memcached) caching from initialising, and use this argument in koha-translate
Comment 6 Jonathan Druart 2020-06-08 12:18:18 UTC
*** Bug 22606 has been marked as a duplicate of this bug. ***