Imageomics / Imageomics/dataverse-access

Data Commons JSON upload error

Open
#16 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2
Forks
1
PR merge metrics
No merged PRs in 30d

Description

I attempted to upload a 4.45GB zip file to Data Commons using
`dva upload `
After about an hour of the terminal stating `Uploading `, it printed the following error:

```
Traceback (most recent call last):
File "/opt/homebrew/Caskroom/miniforge/base/envs/dataverse/lib/python3.11/site-packages/requests/models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/dataverse/lib/python3.11/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/dataverse/lib/python3.11/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/dataverse/lib/python3.11/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/homebrew/Caskroom/miniforge/base/envs/dataverse/bin/dva", line 8, in
sys.exit(main())
^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/dataverse/lib/python3.11/site-packages/dva/cli.py", line 93, in main
cli()
File "/opt/homebrew/Caskroom/miniforge/base/envs/dataverse/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/dataverse/lib/python3.11/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/dataverse/lib/python3.11/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/dataverse/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/dataverse/lib/python3.11/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/dataverse/lib/python3.11/site-packages/dva/cli.py", line 74, in upload
api.upload_file(doi, path)
File "/opt/homebrew/Caskroom/miniforge/base/envs/dataverse/lib/python3.11/site-packages/dva/api.py", line 65, in upload_file
status = resp.json()["status"]
^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/dataverse/lib/python3.11/site-packages/requests/models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the `upload` entry point in `dva/cli.py` and `upload_file` in `dva/api.py`, then trace the response handling around `resp.json()` for the `dva upload ` command. Reproduce with a large upload if possible; the issue does not specify the intended behavior beyond avoiding the reported JSON decoding failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.