IQSS / IQSS/dataverse

File Metadata API: Adding or updating file metadata doesn't create a dataset draft, rather it fails with filename exists.

Open
#10,035 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type: Bug
Dominant language
Java
Stars
1.1k
Forks
564
Avg merge
2d 2h
Merged PRs (30d)
29

Description

If I try setting the file metadata of a particular file on a published dataset, it fails with

curl -H "X-Dataverse-key:XXX" -X POST -F 'jsonData={"description":"My description bbb.","provFreeform":"Test prov freeform","categories":["Data"],"dataFileTags":["Survey"],"restrict":false}' "http://localhost:8080/api/files/:persistentId/metadata?persistentId=doi:10.70122/FK2/HF27IA/FHGZJM"

{"status":"ERROR","message":"Filename already exists at 50by1000.tab"}

But if I first create a draft of the published datasets and rerun the command, it works. It's my expectation based on experience and UI behavior that updating any metadata should create a new dataset draft if one doesn't yet exist.

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 File Metadata API endpoint shown in the curl example and reproduce the request against a published dataset without an existing draft. Trace how metadata updates handle the dataset version and filename conflict; done means the update creates a draft instead of returning the filename-exists error.

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.