caltechlibrary / eprinttools

EPrintTools is a Go package, command line utilities and a service for working with EPrints 3.3.x EPrint XML and REST API
https://caltechlibrary.github.io/eprinttools
Other
2 stars 0 forks source link

eprint-import in ep3apid fails in production #42

Closed rsdoiel closed 2 years ago

rsdoiel commented 2 years ago

Some interaction with eprint__rindex table. Need to review schema. Present in 1.1.x series both main and next.

POST:

 curl -X POST -H 'Content-Type: application/xml' http://localhost:8484/caltechauthors/eprint-import --data-binary '@t2.xml'
bad request, create EPrint failed, failed to insert eprintid 112032 in eprint__rindex for caltechauthors, do not understand "eprint__rindex", eprintid, field, word

XML (before userid and eprint_status is added):

<?xml version='1.0' encoding='utf-8'?>
<eprints xmlns="http://eprints.org/ep2/data/2.0">
   <eprint>
      <type>article</type>
      <creators>
         <item>
            <name>
               <family>Askarani</family>
               <given>Mohsen Falamarzi</given>
            </name>
            <orcid>0000-0002-9571-8466</orcid>
         </item>
         <item>
            <name>
               <family>Das</family>
               <given>Antariksha</given>
            </name>
            <orcid>0000-0002-4248-087X</orcid>
         </item>
         <item>
            <name>
               <family>Davidson</family>
               <given>Jacob H.</given>
            </name>
         </item>
         <item>
            <name>
               <family>Amaral</family>
               <given>Gustavo C.</given>
            </name>
            <orcid>0000-0001-6071-7458</orcid>
         </item>
         <item>
            <name>
               <family>Sinclair</family>
               <given>Neil</given>
            </name>
         </item>
         <item>
            <name>
               <family>Slater</family>
               <given>Joshua A.</given>
            </name>
         </item>
         <item>
            <name>
               <family>Marzban</family>
               <given>Sara</given>
            </name>
         </item>
         <item>
            <name>
               <family>Thiel</family>
               <given>Charles W.</given>
            </name>
         </item>
         <item>
            <name>
               <family>Cone</family>
               <given>Rufus L.</given>
            </name>
         </item>
         <item>
            <name>
               <family>Oblak</family>
               <given>Daniel</given>
            </name>
            <orcid>0000-0002-0277-3360</orcid>
         </item>
         <item>
            <name>
               <family>Tittel</family>
               <given>Wolfgang</given>
            </name>
         </item>
      </creators>
      <title>Long-Lived Solid-State Optical Memory for High-Rate Quantum Repeaters</title>
      <ispublished>pub</ispublished>
      <date>2021-11-22</date>
      <date_type>published</date_type>
      <publication>Physical Review Letters</publication>
      <volume>127</volume>
      <number>22</number>
      <publisher>American Physical Society</publisher>
      <issn>0031-9007</issn>
      <related_url>
         <item>
            <url>https://link.aps.org/article/10.1103/PhysRevLett.127.220502</url>
         </item>
         <item>
            <url>http://harvest.aps.org/v2/journals/articles/10.1103/PhysRevLett.127.220502/fulltext</url>
         </item>
      </related_url>
      <funders>
         <item>
            <agency>Netherlands Organization for Scientific Research</agency>
         </item>
         <item>
            <agency>Horizon 2020 Framework Programme</agency>
            <grant_number>820445</grant_number>
         </item>
         <item>
            <agency>Alberta Innovates - Technology Futures</agency>
         </item>
         <item>
            <agency>Natural Sciences and Engineering Research Council of Canada</agency>
         </item>
         <item>
            <agency>Canadian Institute for Advanced Research</agency>
         </item>
         <item>
            <agency>Montana State University</agency>
         </item>
         <item>
            <agency>Air Force Research Laboratory</agency>
            <grant_number>FA8750-20-1-1004</grant_number>
         </item>
      </funders>
      <subjects>
         <item>General Physics and Astronomy</item>
      </subjects>
      <doi>10.1103/physrevlett.127.220502</doi>
   </eprint>
</eprints>
rsdoiel commented 2 years ago

Added user id to eprint-import end point. The ep3apid service now will set eprint_status to buffer and set the userid to the value passed in the URL. E.g. http://localhost:8484/lemurprints/eprint-import/6 expects a POST and will assign the imported eprint to user 6's buffer.

Also excluding tables with '__' in the table scan and /repository/{REPO_ID} end point.