Stream: troubleshooting

Topic: create dataset validation failure


view this post on Zulip Oliver Bertuch (Jan 26 2026 at 15:09):

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?

view this post on Zulip Oliver Bertuch (Jan 26 2026 at 15:12):

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"
}

view this post on Zulip Oliver Bertuch (Jan 26 2026 at 15:12):

@Philip Durbin ๐Ÿš€ looks like 2 issues to me, right?

view this post on Zulip Oliver Bertuch (Jan 26 2026 at 15:21):

The user created an issue for us: https://github.com/IQSS/dataverse/issues/12114

view this post on Zulip Oliver Bertuch (Jan 26 2026 at 15:22):

I'm not sure if this should be split into two - these are two very independent problems.

view this post on Zulip Philip Durbin ๐Ÿš€ (Jan 26 2026 at 15:27):

Two issues is probably better.

view this post on Zulip Oliver Bertuch (Jan 26 2026 at 15:28):

There may even be a third. I see he gets an error 403.

view this post on Zulip Oliver Bertuch (Jan 26 2026 at 15:28):

Yeah me too

view this post on Zulip Oliver Bertuch (Jan 26 2026 at 15:28):

So it's three issues.

view this post on Zulip Oliver Bertuch (Jan 26 2026 at 15:32):

The error 403 was also reported by @Vera Clemens in a different issue: https://github.com/IQSS/dataverse/issues/12113

view this post on Zulip Philip Durbin ๐Ÿš€ (Jan 26 2026 at 15:40):

Yeah, I just replied on that one.


Last updated: Apr 03 2026 at 06:08 UTC