Bug 24383

Summary: koha-create doesn't restart / empty memcached causing installer fail
Product: Koha Reporter: Joonas Kylmälä <joonas.kylmala>
Component: Installation and upgrade (command-line installer)Assignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: dcook, jonathan.druart
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 6416, 31124    
Bug Blocks:    

Description Joonas Kylmälä 2020-01-09 07:36:50 UTC
If in /etc/koha/koha-sites.conf I have defined USE_MEMCACHED="yes" and then I run "koha-create --create-db kvkoha" and after that "koha-remove kvkoha" and then again "koha-create --create-db kvkoha" then when I try to access the web installer page I get the following error:

> DBIx::Class::Storage::DBI::catch {...} (): DBI Connection failed: Access denied for user 'koha_kvkoha'@'localhost' (using password: YES) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1520. at /usr/share/koha/lib/Koha/Database.pm line 107

This seems to happen because the memcached instance still holds the database credentials from the first time koha-create was run. The solution is to clear the memcached cache:

> $ systemctl restart memcached

After this the web installer loads correctly.
Comment 1 Joonas Kylmälä 2020-01-09 08:50:51 UTC
My proposed fix for this is to clear the memcached cache in koha-create script either by restarting memcached or by using some memcached command line tool to clear the cache.
Comment 2 Jonathan Druart 2020-01-09 15:24:15 UTC
FYI bug 20116 will add misc/bin/clear_cache.pl.
Comment 3 Katrin Fischer 2023-12-31 12:33:37 UTC
(In reply to Jonathan Druart from comment #2)
> FYI bug 20116 will add misc/bin/clear_cache.pl.

It looks like this has been pushed - can this be solved now?
Comment 4 Jonathan Druart 2024-01-04 10:25:09 UTC
Once we have fixed the other koha-remove bugs, it should be trivial to fix.