pulibrary / pdc-osti

2 stars 0 forks source link

Bug: Poster dies after submission to ELink for single records #45

Closed astrochun closed 1 year ago

astrochun commented 1 year ago

I believe the issue stems from only sending a single record. This is a rare case since we typically submit multiple records, but encountered during some PDC migration which resulted in only a single record. Here is the error:

           INFO     Posting to OSTI                                                                                                                                                                       
           INFO     Loading: data/pdc_osti.json                                                                                                                                                           
           INFO     Posting data                                                                                                                                                                          
[08:30:33] INFO     Writing: responses/test_osti_response_2023-06-06 083023.447790.json                                                                                                                   
Traceback (most recent call last):
  File "/Users/chun/codes/PPPL/pdc-osti/venv/bin/poster", line 33, in <module>
    sys.exit(load_entry_point('pdc-osti', 'console_scripts', 'poster')())
  File "/Users/chun/codes/PPPL/pdc-osti/src/pdc_osti/poster.py", line 294, in main
    p.run_pipeline()
  File "/Users/chun/codes/PPPL/pdc-osti/src/pdc_osti/poster.py", line 246, in run_pipeline
    self.post_to_osti()
  File "/Users/chun/codes/PPPL/pdc-osti/src/pdc_osti/poster.py", line 225, in post_to_osti
    if item["status"] == "SUCCESS":
TypeError: string indices must be integers