From efb00062970e45e61856cb28976993d7ced8aaab Mon Sep 17 00:00:00 2001 From: Olli-Antti Kivilahti Date: Fri, 9 Oct 2015 13:05:50 +0300 Subject: [PATCH] Bug 14993 - rebuild_zebra.pl, when recreating Zebra-directory structure, mkdir doesn't fail/error/die This is due to implicit perl programming. Avoid doing this! mkdir $bdir || die "Error $!"; TO REPLICATE: 1. rm -r /home/koha/koha-dev/var/lib/zebradb (or whatever your zebradb location is) 2. run rebuild_zebra.pl -b -a -r -x -v 3. Observe how rebuild_zebra.pl tells that it has rebuilt all the missing directories. 4. cd /home/koha/koha-dev/var/lib/zebradb/biblios 5. No such directory??? 6. You wait for several hours to reindex your zebradb to find that nothing works :( AFTER THIS PATCH: 1. rm -r /home/koha/koha-dev/var/lib/zebradb (or whatever your zebradb location is) 2. run rebuild_zebra.pl -b -a -r -x -v 3. Observe how rebuild_zebra.pl tells that it couldn't create missing directories. A (possibly) better fix would be to recreate the top two directories from the path, but no point patching a dead horse, since ElasticSearch will be here soon :) --- misc/migration_tools/rebuild_zebra.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl index aa31cb2..ce80154 100755 --- a/misc/migration_tools/rebuild_zebra.pl +++ b/misc/migration_tools/rebuild_zebra.pl @@ -305,7 +305,7 @@ sub check_zebra_dirs { my $bdir = $base . $dir; if (! -d $bdir) { $needed_repairing = 1; - mkdir $bdir || die "Unable to create '$bdir': $!\n"; + mkdir($bdir) || die "Unable to create '$bdir': $!\n"; print "$0: needed to create '$bdir'\n"; } } -- 1.9.1