IQSS / IQSS/dataverse

Encrypted zip upload works through browser uploads but not through API uploads.

Open
#9,425 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature: File Upload & Handling Status: Needs Reproducing Type: Bug User Role: Depositor
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?
zip --encrypt test_dir.zip test_dir

export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
export FILENAME=test_dir.zip
export SERVER_URL=https://dataverse.example.org
export PERSISTENT_ID=doi:10.5072/FK2/xxxxxx


curl -H X-Dataverse-key:$API_TOKEN -X POST  -F "file=@$FILENAME" -F 'jsonData={"description":"My description.","directoryLabel":"data/subdir1","categories":["Data"], "restrict":"true", "tabIngest":"false"}' "$SERVER_URL/api/datasets/:persistentId/add?persistentId=$PERSISTENT_ID"
  • When does this issue occur?
    When uploading through the add data API

  • Which page(s) does it occurs on?
    Dataset upload

  • What happens?
    An error is returned by the API saying "Failed to unzip the file. Saving the file as is."
    However, you don't see the zip file in the dataset on the webpage.

  • What did you expect to happen?
    Similar to browser uploads, api upload should work for encrypted zips too.

Which version of Dataverse are you using?
5.11.1

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 encrypted zip upload with the provided curl command against a Dataverse 5.11.1 instance, then compare it with the browser upload path. Trace the add data API handling of encrypted archives; done means the API upload succeeds and the zip is visible in the dataset like a browser upload.

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
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.