hydroshare / hs_restclient

Python client for the https://www.hydroshare.org REST API
BSD 3-Clause "New" or "Revised" License
6 stars 8 forks source link

getResource() downloads empty .zip for particular resource #126

Open wknoben opened 3 years ago

wknoben commented 3 years ago
from hs_restclient import HydroShare, HydroShareAuthBasic

auth = HydroShareAuthBasic(username = 'user', password = 'password')
hs = HydroShare(auth=auth)
hs.getResource('1361509511e44adfba814f6950c6e742', destination = '/some/folder')

returns a 0KB zip file. It's not entirely clear to me what goes wrong as no error is returned. Output reads None. This seems to happen for this specific resource only, as a different resource (e.g. ddbe8fa5a5b84e23bb37beeaeaac714d) can be successfully downloaded as a zip file with this same code.

Downloading the main file in resource 1361509511e44adfba814f6950c6e742 with getResourceFile() seems to successfully complete. Sample code:

hs.getResourceFile('1361509511e44adfba814f6950c6e742', "usda_mode_soilclass_250m_ll.tif", destination = '/some/folder')
dtarb commented 3 years ago

This may be size related. @sblack-usu any thoughts.

sblack-usu commented 3 years ago

It sounds like the issue we saw a couple of months back. @cbcunc Here is another resource that downloads a 0 bytes bag, is this related to the replica issue we saw previously?

sblack-usu commented 3 years ago

The 0 bytes download is not unique to the rest client, I tried downloading it from the web page and got a 0 byte download there as well.