dataverse icon indicating copy to clipboard operation
dataverse copied to clipboard

DDI import not work, error: "Subject is required"

Open cokeBeer opened this issue 3 years ago • 0 comments

What steps does it take to reproduce the issue? post ddi to import dataverse like

POST /api/batch/import?key={your_key}
Host: demo.dataverse.org
Cookie: {your_cookie}
Content-Type: application/xml
Content-Length: 4127

<?xml version='1.0' encoding='UTF-8'?><codeBook xmlns="ddi:codebook:2_5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="ddi:codebook:2_5 https://ddialliance.org/Specification/DDI-Codebook/2.5/XMLSchema/codebook.xsd" version="2.5"><docDscr><citation><titlStmt><titl>OTC Stock Historical Data</titl><IDNo agency="DOI">doi:10.70122/FK2/YE2UKM</IDNo></titlStmt><distStmt><distrbtr source="archive">Demo Dataverse</distrbtr><distDate>2022-10-14</distDate></distStmt><verStmt source="archive"><version date="2022-10-14" type="RELEASED">1</version></verStmt><biblCit>Do, Tuan, 2022, "OTC Stock Historical Data", https://doi.org/10.70122/FK2/YE2UKM, Demo Dataverse, V1</biblCit></citation></docDscr><stdyDscr><citation><titlStmt><titl>OTC Stock Historical Data</titl><IDNo agency="DOI">doi:10.70122/FK2/YE2UKM</IDNo></titlStmt><rspStmt><AuthEnty affiliation="University of South Carolina">Do, Tuan</AuthEnty></rspStmt><prodStmt/><distStmt><distrbtr source="archive">Demo Dataverse</distrbtr><contact affiliation="University of South Carolina" email="[email protected]">Do, Tuan</contact><depositr>Do, Tuan</depositr><depDate>2022-10-14</depDate></distStmt><holdings URI="https://doi.org/10.70122/FK2/YE2UKM"/></citation><stdyInfo><subject><keyword xml:lang="en">Business and Management</keyword><keyword>Business and Management</keyword></subject><abstract>On Tuesday, a new Securities and Exchange </abstract><sumDscr/></stdyInfo><method><dataColl><sources/></dataColl><anlyInfo/></method><dataAccs><setAvail/><useStmt/></dataAccs><othrStdyMat/></stdyDscr></codeBook>
  • When does this issue occur? send the request
  • Which page(s) does it occurs on? /api/batch/import's http response
  • What happens? an error happned
HTTP/1.1 400 Bad Request
Date: Mon, 17 Oct 2022 06:42:16 GMT
Server: Apache/2.4.37 (rocky) OpenSSL/1.1.1k mod_apreq2-20101207/2.8.1
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: PUT, GET, POST, DELETE, OPTIONS
Access-Control-Allow-Headers: Accept, Content-Type, X-Dataverse-Key
Content-Type: application/json;charset=UTF-8
Content-Length: 73
Connection: close

{"status":"ERROR","message":"Error importing data: Subject is required."}
  • To whom does it occur (all users, curators, superusers)? me
  • What did you expect to happen? import dataverse success, because I've tested by https://github.com/IQSS/dataverse/blob/v5.9/src/test/java/edu/harvard/iq/dataverse/export/ddi/exportfull.xml https://github.com/IQSS/dataverse/pull/8483/files#diff-a005f7892fff597838acaabe7cb01d0309a855d8bc77d0d1dabbac08e5495fc0 the xml sample provided in ddi import docs, or even ddi file exported by dataverse, they all have this problem

Which version of Dataverse are you using? v. 5.11.1 build 1069-02e3e92(acutally I tried this function on demo website)

Any related open or closed issues to this bug report? https://github.com/IQSS/dataverse/issues/8452 https://github.com/IQSS/dataverse/issues/8209 https://github.com/IQSS/dataverse/issues/8210

cokeBeer avatar Oct 17 '22 07:10 cokeBeer