A user wanted to create a new dataset draft via API with incomplete metadata. I did enable dataverse.api.allow-incomplete-metadata.
curl -H "X-Dataverse-key:$API_TOKEN" -X POST "$SERVER_URL/api/dataverses/$PARENT/datasets?doNotValidate=true" -H 'Content-type:application/json' --upload-file test.json
This is the response we get:
{
"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."
}
This is what I see in the logs: server.log
Here's the JSON file: test.json
A) This response doesn't make much sense. This looks like a bug to me, as we should catch the exception and unwrap it before sending a response.
B) I don't see any obvious reasons why this should fail and the logs aren't helping. Ideas?
Ah if we do validate (drop the parameter), I think the reason may be a bug in the URL parsing for "alternativeUrl":
{
"status": "ERROR",
"message": "Validation Failed: Data Source is required. (Invalid value:edu.harvard.iq.dataverse.DatasetField[ id=null ]), Institute is required. (Invalid value:edu.harvard.iq.dataverse.DatasetField[ id=null ]), Storage Location URL is required. (Invalid value:edu.harvard.iq.dataverse.DatasetField[ id=null ]), 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 ]).java.util.stream.ReferencePipeline$3@55dfb73c"
}
@Philip Durbin ๐ looks like 2 issues to me, right?
The user created an issue for us: https://github.com/IQSS/dataverse/issues/12114
I'm not sure if this should be split into two - these are two very independent problems.
Two issues is probably better.
There may even be a third. I see he gets an error 403.
Yeah me too
So it's three issues.
The error 403 was also reported by @Vera Clemens in a different issue: https://github.com/IQSS/dataverse/issues/12113
Yeah, I just replied on that one.
Last updated: Apr 03 2026 at 06:08 UTC