Bug 24835

Summary: Bad PCDATA explodes search with a Software ERROR.
Product: Koha Reporter: Lisa Beinhoff <Lisa.Beinhoff>
Component: SearchingAssignee: Bugs List <koha-bugs>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: jonathan.druart
Version: 19.11   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

Description Lisa Beinhoff 2020-03-09 22:08:19 UTC
Searching in the public library catalog for a record with bad PCDATA, causes the following error to appear:

Software error:
Invalid data, cannot decode object (id=75430, format=marcxml, schema=MARC21, decoding_error=':94: parser error : PCDATA invalid Char value 27
construction of the Metacarpal Hand -- 21. The Mutilated Wrist -- 22. Krukenberg
                                                                                ^
:94: parser error : PCDATA invalid Char value 27
struction of the Metacarpal Hand -- 21. The Mutilated Wrist -- 22. Krukenbergb2
                                                                                ^')
For help, please send mail to the webmaster ([no address given]), giving this error message and the time and date of the error.


Error generated in staff view is:

There is an error with this bibliographic record, the view may be degraded.
Error: Invalid data, cannot decode object (id=75430, format=marcxml, schema=MARC21, decoding_error=':94: parser error : PCDATA invalid Char value 27 construction of the Metacarpal Hand -- 21. The Mutilated Wrist -- 22. Krukenberg ^ :94: parser error : PCDATA invalid Char value 27 struction of the Metacarpal Hand -- 21. The Mutilated Wrist -- 22. Krukenbergb2 ^')


Editing the record and saving the bibliographic error seems to clear the error, for some unknown reason.  But I need a way to identify the bad records, so they can be corrected.  About 1 in 20 records in our databases is generating this error.
Comment 1 Jonathan Druart 2020-03-10 12:17:45 UTC
Hi Lisa,

Which exact version of Koha are you using?

Since bug 23846 you should see the "degraded view" at the staff interface, with the message you see. And the error correctly handled OPAC-side (which means no crash).

The patches from bug 23846 also add a new check to the misc/maintenance/search_for_data_inconsistencies.pl script. If you run it it will tell you which records are affected.
Comment 2 Lisa Beinhoff 2020-03-10 13:45:42 UTC
We are running 19.05.05.000.
Comment 3 Katrin Fischer 2024-01-06 15:48:50 UTC
(In reply to Lisa Beinhoff from comment #2)
> We are running 19.05.05.000.

19.05.05 is no longer maintained, but newer versions have much improved handling for bad records.