Closed Bug 1904645 Opened 4 months ago Closed 3 months ago

gcs-cli.py can't delete buckets if there are more than 256 objects

Categories

(Socorro :: General, defect, P2)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: willkg, Assigned: relud)

Details

Attachments

(1 file)

In a local dev environment, if you try to delete a gcs bucket that has more than 256 objects in the gcs emulator with bin/gcs-cli.py, it kicks up this error:

  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/bin/gcs_cli.py", line 77, in delete_bucket
    bucket.delete(force=True)
  File "/usr/local/lib/python3.11/site-packages/google/cloud/storage/bucket.py", line 1585, in delete
    raise ValueError(message)
ValueError: Refusing to delete bucket with more than 256 objects. If you actually want to delete this bucket, please delete the objects yourself before calling Bucket.delete().

There's no way to delete individual objects with gcs-cli.py.

It should probably delete all the objects and then delete the bucket.

Making this a P2 because without this, we can't rebuild the local dev environment without wiping out docker state for the gcs emulator container.

Priority: -- → P2
Assignee: nobody → dthorn
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: