Skip to content

session publish_array_to_public_bucket() method results in a 400 error #46

@mhearne-usgs

Description

@mhearne-usgs

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
<Response [400]>
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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions