IQSS / IQSS/dataverse

Strange error response when deleting replaced file via API

Open
#10,419 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature: API Feature: File Upload & Handling Original size: 20 Type: Bug
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?

  1. Create dataset
  2. Upload file
  3. Get and store ID of the uploaded file
  4. Publish dataset
  5. Replace file https://guides.dataverse.org/en/latest/api/native-api.html#replacing-files
  6. Try to delete file using the old file ID (from step 3) https://guides.dataverse.org/en/latest/api/native-api.html#deleting-files
  7. Receive error message: status code 400 + {'status': 'ERROR', 'message': 'Delete failed for file ID 95 (CommandException): Command edu.harvard.iq.dataverse.engine.command.impl.UpdateDatasetVersionCommand@263fcde5 failed: Object: null is not a known Entity type.'}
  • To whom does it occur (all users, curators, superusers)?

    API users

  • What did you expect to happen?

    I expected to receive a readable error message telling me why the file cannot be deleted (it has already been published and subsequently replaced)

Which version of Dataverse are you using?

6.1

Any related open or closed issues to this bug report?

not aware of any

Screenshots:

/

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 by reproducing the documented replacing-files and deleting-files API sequence in Dataverse 6.1, using the old file ID after replacement. Trace the delete-file API handling and error response; done means the request returns a readable explanation that the published, replaced file cannot be deleted instead of the Entity type exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.