dataverse icon indicating copy to clipboard operation
dataverse copied to clipboard

Error when trying to replace a file through web interface

Open bjosel opened this issue 2 months ago • 7 comments

What steps does it take to reproduce the issue?

  1. Replace a .txt file via the browser
  2. Drag-n-drop or select the new file to replace the old file.
  • When does this issue occur? When trying to replace a file through the Dataverse web interface. Tested on various file formats (text, pdf, picture)

  • Which page(s) does it occurs on? dataset.xhtml, editdatafiles.xhtml

  • What happens? An error is shown "You cannot add Tabular Data Tags to a non-tabular file" and file replacement is stopped

  • To whom does it occur (all users, curators, superusers)? all users (tested with superuser, researcher, admin)

  • What did you expect to happen? The file should be replaced successfully

Which version of Dataverse are you using? v6.8

Any related open or closed issues to this bug report? Maybe #11972 (wild guess due to the error message mentioning tags)

Screenshots:

Image

Are you thinking about creating a pull request for this issue? We are looking into it but haven't identified nor fixed the problem

bjosel avatar Nov 14 '25 07:11 bjosel

@bjosel thanks for the bug report. Are you able to reproduce the bug on https://demo.dataverse.org ?

pdurbin avatar Nov 14 '25 13:11 pdurbin

Hi @pdurbin, yes I can reproduce on demo.dataverse.org. See screenshot

Image

bjosel avatar Nov 14 '25 13:11 bjosel

@bjosel d'oh! Thanks for testing! Can you please also try it in the new UI at https://beta.dataverse.org/spa/ ?

pdurbin avatar Nov 14 '25 16:11 pdurbin

@pdurbin On the new UI there was no error. Seems to work properly

bjosel avatar Nov 14 '25 16:11 bjosel

@bjosel ok, thanks so much for testing. I'm glad there's no issue in the new UI.

pdurbin avatar Nov 14 '25 18:11 pdurbin

I'm guessing it's this commit which removed replacing an empty list with null. https://github.com/IQSS/dataverse/commit/9baf2d52f48b875e8691e4b8325289049ac11080#diff-80df39df6cfebe2044116b34839cce6c0a72c1b58a0c7e245cd2f4056b91509fL515 . That causes and error because this statement then fails to return: https://github.com/IQSS/dataverse/blob/b78060aac62d8d40cb897bbf8a35b1c97a6e5ef7/src/main/java/edu/harvard/iq/dataverse/datasetutility/OptionalFileParams.java#L614 due to https://github.com/IQSS/dataverse/blob/b78060aac62d8d40cb897bbf8a35b1c97a6e5ef7/src/main/java/edu/harvard/iq/dataverse/datasetutility/OptionalFileParams.java#L201-L203 checking for null and not empty() .

qqmyers avatar Nov 14 '25 18:11 qqmyers

@qqmyers hmm. From #11439. That would mean the bug was introduced in Dataverse 6.8.

pdurbin avatar Nov 14 '25 23:11 pdurbin