ucldc / rikolti

calisphere harvester 2.0
BSD 3-Clause "New" or "Revised" License
7 stars 3 forks source link

[bug?] `AttributeError: 'NoneType' object has no attribute 'findall'` for one UCLA Samvera collection #979

Closed christinklez closed 6 months ago

christinklez commented 6 months ago

Question: Is this an OAI issue or a Rikolti issue?

Registry ID: 28191

[2024-05-31, 17:38:52 UTC] {{taskinstance.py:1824}} ERROR - Task failed with exception
Traceback (most recent call last):
  File "/usr/local/airflow/.local/lib/python3.10/site-packages/airflow/decorators/base.py", line 220, in execute
    return_value = super().execute(context)
  File "/usr/local/airflow/.local/lib/python3.10/site-packages/airflow/operators/python.py", line 181, in execute
    return_value = self.execute_callable()
  File "/usr/local/airflow/.local/lib/python3.10/site-packages/airflow/operators/python.py", line 198, in execute_callable
    return self.python_callable(*self.op_args, **self.op_kwargs)
  File "/usr/local/airflow/dags/rikolti/dags/shared_tasks/fetching_tasks.py", line 37, in fetch_collection_task
    fetched_collection = fetch_collection(collection, vernacular_version)
  File "/usr/local/airflow/dags/rikolti/metadata_fetcher/lambda_function.py", line 92, in fetch_collection
    page_status = fetcher.fetch_page()
  File "/usr/local/airflow/dags/rikolti/metadata_fetcher/fetchers/Fetcher.py", line 77, in fetch_page
    record_count = self.check_page(response)
  File "/usr/local/airflow/dags/rikolti/metadata_fetcher/fetchers/oai_fetcher.py", line 72, in check_page
    'oai2:ListRecords', NAMESPACE).findall('oai2:record', NAMESPACE)
AttributeError: 'NoneType' object has no attribute 'findall'
barbarahui commented 6 months ago

The harvest_extra_metadata field value in the registry looks like it has extra spaces in it:

metadataPrefix=oai_dpla&set= member_of_collection_ids_ssim:gvb0j200zz-89112

christinklez commented 6 months ago

Thank you!

Updated from: metadataPrefix=oai_dpla&set= member_of_collection_ids_ssim:gvb0j200zz-89112

to: metadataPrefix=oai_dpla&set=member_of_collection_ids_ssim:gvb0j200zz-89112