DOI-USGS / DOI-USGS/sciencebasepy
session publish_array_to_public_bucket() method results in a 400 error
- Dominant language
- Python
- Stars
- 58
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to use sciencebasepy to test automated uploading of data, and running into this error:
```
python upload_gmprocess.py /data/gmprocess/comprehensive/data/ci14383980/workspace.h5
Password:
Uploading |################################| 8/8
Failed to publish file /data/gmprocess/comprehensive/data/ci14383980/workspace.h5 to public S3 bucket
```
The code snippet that results in the error:
```
session = None
try:
session = sciencebasepy.SbSession().loginc(DEFAULT_USER)
jdict_item = session.upload_file_and_create_item(
PARENT_ITEM, str(metadata_filename)
)
item_id = jdict_item["id"]
updated_item_id = session.upload_cloud_file_to_item(
item_id, str(workspace_file)
)
assert updated_item_id["id"] == item_id
session.publish_array_to_public_bucket(item_id, [str(workspace_file)])
except Exception as e:
print(
f"Failed to login or upload file for user {DEFAULT_USER}. Error '{e}'. Exiting."
)
sys.exit(1)
finally:
if session is not None:
session.logout()
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the publish_array_to_public_bucket() entry point shown in the issue and trace the request that returns HTTP 400 after upload_cloud_file_to_item() succeeds. Reproduce the sequence with the supplied upload flow and inspect the response details to identify the rejected request. Done means publishing the uploaded file to the public S3 bucket succeeds without the 400 error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100