Bug 16867

Summary: Zebra works in marc21, but fails in unimarc
Product: Koha Reporter: pierre.genty
Component: Z39.50 / SRU / OpenSearch ServersAssignee: Galen Charlton <gmcharlt>
Status: CLOSED WORKSFORME QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: m.de.rooy, ztajoli
Version: 16.05   
Hardware: PC   
OS: Linux   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Crowdfunding committed: 0
Crowdfunding contact: Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description pierre.genty 2016-07-06 21:55:33 UTC
Hello,

After a very long search I finally decide to ask for the help of the Koha community...
To make it simple (more details below) :
I have two VM with the same system (Debian 8) and the same Koha 16.06 (one is the clone of the other). The only difference : I chose marc21 during the webinstall of Koha on the first one and unimarc on the second one (for French cataloging).
On the VM1 (marc21) the zebra indexing works (cmd for biblio : perl rebuild_zebra.pl -run-as-root -b -r -v). I can find my document in Opac.
On the VM2 (unimarc) the zebra indexing fails with the following error : Zebraidx (3608) Record didn't countain match fields in (bib1, Local-number). Search in the catalog returns nothing.  

I already saw this type of error in other forums. But nothing helped me. I also tried on different systems and different Koha version (importing or creating records) and I always end up with the same error. Any ideas would be more than appreciated. 

For details, this is what I did : 
cd /usr/share/koha/bin/migration_tools
export PERL5LIB=/usr/share/koha/lib/
export KOHA_CONF=/etc/koha/sites/labo8/koha-conf.xml
perl rebuild_zebra.pl -run-as-root -b -r -v

Here, the output of Zebra (on this case I have only one document on the database) :

Zebra configuration information
================================
Zebra biblio directory      = /var/lib/koha/labo8/biblios
Zebra authorities directory = /var/lib/koha/labo8/authorities
Koha directory              = /usr/share/koha/intranet/cgi-bin
Lockfile                    = /var/lock/koha/labo8/rebuild/rebuild..LCK
BIBLIONUMBER in :     001$@
BIBLIOITEMNUMBER in : 090$a
================================
skipping authorities
====================
exporting biblio
====================
1
Records exported: 1
====================
REINDEXING zebra
====================
21:03:11-06/07 zebraidx(3608) [warn] Record didn't contain match fields in (bib1,Local-number)
====================
CLEANING
====================

I already looked at different configuration files related to Zebra : 
- /etc/koha/koha-sites.conf was configured in marc21 (despite Koha webinstallation with unimarc option), changed to unimarc -> same error
- in /etc/koha/sites/labo8/koha-conf.xml everything was in marc21 (despite Koha webinstallation with unimarc option), all changed to unimarc -> same error
- /etc/koha/zebradb/retrieval-info-bib-dom.xml was in marc21, changed to unimarc -> same error
- seems like zebra is using the /etc/koha/zebradb/marc_defs/marc21 folder and not the /etc/koha/zebradb/marc_defs/unimarc folder (I changed the name for testing)
Comment 1 Zeno Tajoli 2016-07-07 09:48:31 UTC
Hi, this is the basic error:

>I have two VM with the same system (Debian 8) and the same Koha 16.06 (one is >the clone of the other)

You can't clone a marc21 Koha and do a web install with unimarc.
The sistem doesn't work.

You need to start an install from a fresch debian 8 and reintall koha-common package.
Reading https://wiki.koha-community.org/wiki/Koha_on_Debian.
After "sudo apt-get install koha-common"
"vi /etc/koha/koha-sites.conf" and setup unimarc.
After "sudo koha-create --create-db libraryname"
Now you can do web install and you can choose 'unimarc'.

If you want more info, writr to koha mailing-list
https://lists.katipo.co.nz/mailman/listinfo/koha
Comment 2 pierre.genty 2016-07-07 18:53:10 UTC
Zeno,

It works ! My mistake : I set /etc/koha/koha-sites.conf to unimarc after creating the database (koha-create --create-db libraryname). It has to be done just after the apt-get install koha-common.  

Thank you very much!!