Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: empty datasets can be created resulting in 502 errors #6752

Closed
MYF95 opened this issue Mar 19, 2020 · 5 comments · Fixed by #8088
Closed

API: empty datasets can be created resulting in 502 errors #6752

MYF95 opened this issue Mar 19, 2020 · 5 comments · Fixed by #8088

Comments

@MYF95
Copy link

MYF95 commented Mar 19, 2020

Hi!

As written in the title, we can create "empty" datasets which in turn returns 502 when we try to access them via the dataverse page.

How to reproduce

The endpoint used is the one described here http://guides.dataverse.org/en/latest/api/native-api.html#id47

curl -H X-Dataverse-key:$dataverse-key-value https://demo.dataverse.org/api/dataverses/${dataverse}/datasets --upload-file example.json

The contents of example.json are as follows:

{
  "datasetVersion": {
    "metadataBlocks": {
      "citation": {
        "fields": [
        ]
      }
    }
  }
}

Which is the bare minimum amount of data allowed to create the dataset.

Current behaviour

This results in the following dataset being created:

image

And consequently when trying to enter the dataset page

image

Expected behaviour

Dataset is not created in the first place because the required minimum information is not there

or

The dataset page is able to load with no initial information (maybe using some default values if not set?)

We are not really actively using the endpoint, but just wanted to let you guys know since I found this when testing some of our endpoints using dataverse.

@djbrooke
Copy link
Contributor

Thanks @MYF95 for the report. We'd want the behavior to be that the dataset would not be created.

@akio-sone
Copy link
Contributor

Hi all, I guess this issue is related to #6739 (Multistore: If no files are uploaded to published dataset, export fails).

@djbrooke
Copy link
Contributor

Thanks @akio-sone. @MYF95 and the team usually work against demo.dataverse.org, which is running 4.19 and does not have have the multiple stores changes. I think this is unrelated, but could be wrong.

@djbrooke
Copy link
Contributor

djbrooke commented Aug 5, 2020

  • We'd want to not allow creation if the required fields are not passed and provide a message over the API.
  • The solution here should include the validation and not just fail if it's empty (why doesn't the DB constraint get applied?)
  • This may be just a Solr record being created
  • We should make sure this condition cannot be achieved through editing as well

@djbrooke djbrooke added the Medium label Aug 5, 2020
@poikilotherm
Copy link
Contributor

I just came across this issue and I think this is (at least) related to my IQSS/dataverse-pm#26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants