GetRecord unexpectedly returns "invalidRecordContent" error for deleted MARC Instance
Description
CSP Request Details
CSP Rejection Details
Potential Workaround
Attachments
- 29 Nov 2024, 06:19 AM
- 29 Nov 2024, 06:19 AM
- 29 Nov 2024, 06:19 AM
- 29 Nov 2024, 06:19 AM
- 29 Nov 2024, 06:18 AM
- 29 Nov 2024, 06:18 AM
- 29 Nov 2024, 06:18 AM
- 29 Nov 2024, 06:18 AM
- 29 Nov 2024, 06:18 AM
- 25 Nov 2024, 02:34 PM
- 25 Nov 2024, 02:34 PM
- 25 Nov 2024, 02:34 PM
relates to
Checklist
hideActivity
Tatsiana HryhoryevaNovember 29, 2024 at 6:19 AM
Verified on https://bugfest-ramsons.int.aws.folio.org/ environment, works as expected
In OAI-PMH settings Deleted records support set to No
Scenario 1 - Harvest MARC Instance with invalid characters
GetRecord
ListRecords
ListIdentifiers
Scenario 2 - Harvest deleted MARC Instance (LDR 05 set to “d“)
GetRecord
ListRecords
ListIdentifiers
Scenario 3 - Harvest deleted MARC Instance (Set for deletion)
GetRecord
ListRecords
ListIdentifiers
JenkinsNotificationsNovember 27, 2024 at 4:41 PM
Deployed to the Ramsons bf env. Moved status to In bugfix review from status Awaiting deployment. Please proceed with the verification.
Tatsiana HryhoryevaNovember 25, 2024 at 2:34 PM
Hi @Magda Zacharska , @Viachaslau Khandramai
Verified on https://folio-snapshot.dev.folio.org/ environment, works as expected
In OAI-PMH settings Deleted records support set to No
Scenario 1 - Harvest MARC Instance with invalid characters
GetRecord
ListRecords
ListIdentifiers
Scenario 2 - Harvest deleted MARC Instance (LDR 05 set to “d“)
GetRecord
ListRecords
ListIdentifiers
Scenario 3 - Harvest deleted MARC Instance (Set for deletion)
GetRecord
ListRecords
ListIdentifiers
Viachaslau KhandramaiNovember 25, 2024 at 1:42 PM
@Tatsiana Hryhoryeva , please, verify.
Viachaslau KhandramaiNovember 25, 2024 at 1:42 PM
Verified on https://folio-snapshot.dev.folio.org .
Make importing of two mrc files: Loading file... , Loading file....
For the first record (record-for-deletion.mrc) go to inventory and set via quickMARC status: d-deleted:
Go to Settings OAI-PMH/Behaviour and set Deleted records support to No.
Make GetRecord request for both identifiers record-for-deletion.mrc and invalid-character-record.mrc to be sure that errors are displayed correctly -
idDoesNotExist
for deleted andinvalidRecordContent
for record with invalid character in content:
GET /oai/records?metadataPrefix=marc21_withholdings&verb=GetRecord&identifier=oai:folio.org:diku/36bda3f3-44d6-4542-894f-25ca16d6155a HTTP/1.1
Accept-Encoding: identity
X-Okapi-Tenant: ${TENANT}
X-Okapi-Token: ${TOKEN}
User-Agent: PostmanRuntime/7.42.0
Accept: */*
Postman-Token: e0192a04-9110-4ab1-8a04-a5e8a1fe7e03
Host: folio-snapshot-okapi.dev.folio.org:443
Connection: keep-alive
HTTP/1.1 200 OK
Date: Mon, 25 Nov 2024 13:31:22 GMT
Content-Type: text/xml
Transfer-Encoding: chunked
Connection: keep-alive
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><OAI-PMH xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd" xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:oai-identifier="http://www.openarchives.org/OAI/2.0/oai-identifier" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><responseDate>2024-11-25T13:31:22Z</responseDate><request verb="GetRecord" identifier="oai:folio.org:diku/36bda3f3-44d6-4542-894f-25ca16d6155a" metadataPrefix="marc21_withholdings">http://folio.org/oai</request><error code="idDoesNotExist">No matching identifier in repository.</error></OAI-PMH>
GET /oai/records?metadataPrefix=marc21_withholdings&verb=GetRecord&identifier=oai:folio.org:diku/52dec540-0805-4dc8-a82a-e6bc3cea74b7 HTTP/1.1
Accept-Encoding: identity
X-Okapi-Tenant: ${TENANT}
X-Okapi-Token: ${TOKEN}
User-Agent: PostmanRuntime/7.42.0
Accept: */*
Postman-Token: 721a771b-65ab-416d-8842-f0849e00c5e7
Host: folio-snapshot-okapi.dev.folio.org:443
Connection: keep-alive
HTTP/1.1 404 Not Found
Date: Mon, 25 Nov 2024 13:32:03 GMT
Content-Type: text/xml
Transfer-Encoding: chunked
Connection: keep-alive
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><OAI-PMH xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd" xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:oai-identifier="http://www.openarchives.org/OAI/2.0/oai-identifier" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><responseDate>2024-11-25T13:32:03Z</responseDate><request verb="GetRecord" identifier="oai:folio.org:diku/52dec540-0805-4dc8-a82a-e6bc3cea74b7" metadataPrefix="marc21_withholdings">http://folio
Overview:
GetRecord unexpectedly returns "invalidRecordContent" error (instead of expected "idDoesNotExist" error) in the following case:
In OAI-PMH settings Deleted records support set to No
MARC Instance is deleted by set LDR 05 to d
Steps to recreate:
Go to “Settings“ => “OAI-PMH“ => “Behavior“
Set the following settings and clicj “Save“ button:
“Record source“ to “Source records storage“
”Deleted records support” to “No“
Go to “Inventory“ app => Find any MARC Instance and open its detailed view
Click “Actions“ => “Edit MARC bibliographic record“
In LDR field select “d - Deleted“ in “Status“
Click “Save & close“ button
send GetRecord request with identifier of the record edited above
Expected results:
GetRecord response contains <error code="idDoesNotExist">No matching identifier in repository.</error>
Actual Results:
GetRecord response contains <error code="invalidRecordContent">Invalid character in the record.</error>
Additional Information: For “Deleted records support” setting set to “Persistent” or “Transient” GetRecord response is as expected when record is marked "deleted"