IQSS / IQSS/dataverse

alternativeURL value with doNotValidate=true causes a 500 error with vague error message

Open
#12,114 2 comments 0 reactions 1 assignee View on GitHub

@poikilotherm is already working on this.

Since Jan 26, 2026.

Feature: API Feature: API Guide Original size: 10 Type: Bug User Role: API User
Dominant language
Java
Stars
1.1k
Forks
564
Avg merge
2d 2h
Merged PRs (30d)
29

Description

What steps does it take to reproduce the issue?

  • When does this issue occur?

When attempting to create a dataset via the API with the query-Parameter doNotValidate set to true and the following JSON body:

{
    "datasetVersion": {
        "metadataBlocks": {
            "citation": {
                "displayName": "Citation Metadata",
                "fields": [
                    {
                        "typeName": "title",
                        "multiple": false,
                        "typeClass": "primitive",
                        "value": "Example Title"
                    },
                    {
                        "typeName": "alternativeURL",
                        "multiple": false,
                        "typeClass": "primitive",
                        "value": "http://localhost:5000/objects/8"
                    },
                    {
                        "typeName": "author",
                        "multiple": true,
                        "typeClass": "compound",
                        "value": [
                            {
                                "authorName": {
                                    "typeName": "authorName",
                                    "multiple": false,
                                    "typeClass": "primitive",
                                    "value": "Example Author Name"
                                }
                            }
                        ]
                    }
                ]
            }
        }
    }
}

I'm attaching a Python script containing the example: dataverse_mwe.py

  • Which page(s) does it occurs on?

POST requests to API endpoint /api/v1/dataverses/<id>/datasets/

  • What happens?

The API returns status code 500 and the following body:

{"status":"ERROR","message":"Command [DatasetCreate dataset:null] failed: Exception thrown from bean: jakarta.validation.ConstraintViolationException: One or more Bean Validation constraints were violated while executing Automatic Bean Validation on callback event: prePersist for class: edu.harvard.iq.dataverse.DatasetFieldValue. Please refer to the embedded constraint violations for details."}

Omitting the alternativeURL field or using "http://example.com/objects/8" instead of "http://localhost:5000/objects/8" is successful.

Omitting the doNotValidate query parameter instead results in status code 403 and the following body:

{"status":"ERROR","message":"Validation Failed: PoF IV topic is required. (Invalid value:edu.harvard.iq.dataverse.DatasetField[ id=null ]), Alternative URL http://localhost:5000/objects/8  is not a valid URL. (Invalid value:edu.harvard.iq.dataverse.DatasetFieldValueValue[ id=null ]), Subject is required. (Invalid value:edu.harvard.iq.dataverse.DatasetField[ id=null ]), Institute is required. (Invalid value:edu.harvard.iq.dataverse.DatasetField[ id=null ]), Method Parameters Name is required. (Invalid value:edu.harvard.iq.dataverse.DatasetField[ id=null ]), Point of Contact E-mail is required. (Invalid value:edu.harvard.iq.dataverse.DatasetField[ id=null ]), Description Text is required. (Invalid value:edu.harvard.iq.dataverse.DatasetField[ id=null ]), Processing Methods Name is required. (Invalid value:edu.harvard.iq.dataverse.DatasetField[ id=null ]), Software Name is required. (Invalid value:edu.harvard.iq.dataverse.DatasetField[ id=null ]), Instruments Name is required. (Invalid value:edu.harvard.iq.dataverse.DatasetField[ id=null ]).java.util.stream.ReferencePipeline$3@49cf567a"}
  • To whom does it occur (all users, curators, superusers)?

Curators

  • What did you expect to happen?

Either the dataset should be created successfully, or a more specific error message should be reported on failure. The error message Alternative URL http://localhost:5000/objects/8 is not a valid URL. that occurs when doNotValidate is not set, would be clearer. I don't know whether the better error message or successful creation of the dataset is the "correct" outcome.

Which version of Dataverse are you using?

6.8

Any related open or closed issues to this bug report?

https://github.com/IQSS/dataverse/issues/4108 is about email validation, but the issue resulted in the same error message.

Related discussion: https://dataverse.zulipchat.com/#narrow/channel/378866-troubleshooting/topic/create.20dataset.20validation.20failure/near/570117371

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.