wget command to download all files in a dataset not preserving file hierarchy
Nobody has claimed this yet.
- 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?
For Dataverse installation that is using S3 storage.
When using the wget command (example pasted below) for a dataset with a file structure hierarchy (i.e., tree structure):
wget -r -e robots=off -nH --cut-dirs=3 --header "X-Dataverse-key: $API_TOKEN" --content-disposition https://borealisdata.ca/api/datasets/:persistentId/dirindex?persistentId=IDENTIFIER"
- When does this issue occur?
Every time the command is used on a dataset with a tree structure
- Which page(s) does it occurs on?
N/A
- What happens?
It downloads one directory “dirindex” and one directory with a name based on the dataset DOI. The latter contains a flat structure of the dataset files without retaining the file hierarchy of the dataset. If there are files contained in different folders that have the same name, they will get overwritten in the destination folder.
- To whom does it occur (all users, curators, superusers)?
All users
- What did you expect to happen?
I expected that the dataset should download in a file hierarchy as outlined in the documentation, “Using this API, wget --recursive (or a similar crawling client) can be used to download all the files in a dataset, preserving the file names and folder structure; without having to use the download-as-zip API.”
Which version of Dataverse are you using?
v.5.8.3
Any related open or closed issues to this bug report?
None found.
Other notes
Based on our testing, we are wondering if this is related to the file system. When using a local machine with a standard file system, the command seems to work. Borealis uses S3 emulation.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Start by reproducing the wget request against an S3-backed installation and compare the /api/datasets/:persistentId/dirindex response and download behavior with a local filesystem; done means recursive downloads preserve folder hierarchy and same-named files are not overwritten.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, java
- Domain
- api, backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100