Summary: | No detailed messages provided in UI when MARC import fails due to bad item data | ||
---|---|---|---|
Product: | Koha | Reporter: | David Cook <dcook> |
Component: | MARC Bibliographic record staging/import | Assignee: | Bugs List <koha-bugs> |
Status: | NEW --- | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | andrew, eric, esther.melander, furtadojaden, mathsabypro, nick |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30739 | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: |
Description
David Cook
2023-01-16 04:32:49 UTC
Bumped into this issue again today when I was trying to import a record that contained an item with a barcode that already existed in Koha. I see in C4::ImportBatch::_batchCommitItems that duplicate barcode is the only error that will increment the items errored count... Interestingly if the barcode is too long then the whole import fails and I see the following in worker-output.log, so that's something...: DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Data too long for column 'barcode' at row 1 at /kohadevbox/koha/Koha/Object.pm line 170 Looks like the coded location qualifier will cause the whole import to fail as well now, so that's good. You can see this in the worker-output.log: DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Data too long for column 'coded_location_qualifier' at row 1 at /kohadevbox/koha/Koha/Object.pm line 170 It could be good to add something to the Web UI to ask people to consult their sysadmin so they can check the logs for more specifics... -- And maybe the duplicate barcode could be hinted at more although given the code flow I can see how that would be very difficult (without throwing a fatal error to stop the whole import) *** Bug 39621 has been marked as a duplicate of this bug. *** Here's the error when the item has a branchcode that doesn't exist in Koha: DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha_kohadev`.`items`, CONSTRAINT `items_ibfk_2` FOREIGN KEY (`homebranch`) REFER ENCES `branches` (`branchcode`) ON UPDATE CASCADE) at /kohadevbox/koha/Koha/Object.pm line 174 Broken FK constraint at /kohadevbox/koha/Koha/BackgroundJob/MARCImportCommitBatch.pm line 94. +1, this is a pain point for users as they're given no indication of the cause of the import failure. The import_records and import_items tables already have import_error fields that could hold these values. |