IQSS / IQSS/dataverse

Code 500 when updating a field of a custom metadatablock field with controlledVocabulary via the API.

Open
#8,938 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature: API 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?

  • All the necessary steps to add a custom metadata block. The file customweather.tsv is attached to this issue.
  • generate at dataset with empty weather metadata and use the persistentid in the curl command
  • curl -H "X-Dataverse-key: $API_TOKEN" -X PUT $SERVER_URL/api/datasets/:persistentId/editMetadata?persistentId=$PERSISTENT_IDENTIFIER&replace=true --upload-file weather_source.json
  • When does this issue occur?

When trying to change the value of a field with controlledVocabulary:

curl -H "X-Dataverse-key: $API_TOKEN" -X PUT $SERVER_URL/api/datasets/:persistentId/editMetadata?persistentId=$PERSISTENT_IDENTIFIER&replace=true --upload-file weather_source.json

(json file is in the attached zip)

It works with a field without controlledVocabulary (like the weather_basic.json). It also works when using the web form.

  • Which page(s) does it occurs on?

the native API and with pyDataverse

  • What happens?

Status code 500 and and an empty response {}.

  • To whom does it occur (all users, curators, superusers)?

not tested

  • What did you expect to happen?

Update the value of the weather meta data as with the weather_basic.json

Which version of Dataverse are you using?

v. 5.11 build 1009-21ac7e1

Any related open or closed issues to this bug report?
https://groups.google.com/g/dataverse-community/c/XHqGN5D9zZs/m/b63jWEd3AAAJ

https://github.com/IQSS/dataverse/issues/8860

bug.zip

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.

Research direction

Start with the native API endpoint shown in the curl command and reproduce the failure using customweather.tsv, weather_source.json, and weather_basic.json from bug.zip. Compare updates for fields with and without controlledVocabulary, including the pyDataverse path. Done means updating the controlled-vocabulary field succeeds like the basic metadata update instead of returning status 500 and {}.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.