Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bucket deletion when using keyPrefix #102

Merged
merged 1 commit into from
Jun 21, 2020

Conversation

josephnle
Copy link
Contributor

Background

When using the keyPrefix option along with having bucket deletion enabled, the following error occurs if the key prefix does not already exist:

ServerlessError: The XML you provided was not well-formed or did not validate against our published schema

Closes #85

Proposed changes

The issue was with the emptyBucket function. With no items containing the keyPrefix, the keyPrefix logic resulted in an empty array of S3 objects being passed to the deleteObjects S3 request. This fix resolves the promise if there are no objects to delete.

@jamesmbourne
Copy link

@fernando-mc would you be able to take a look at this please? We're currently seeing the same The XML you provided was not well-formed or did not validate against our published schema error due to this.

@fernando-mc fernando-mc merged commit fa66fde into fernando-mc:master Jun 21, 2020
@fernando-mc
Copy link
Owner

Just cut a new release. This should be included in v2.6.0 @jamesmbourne @josephnle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using keyPrefix results in an XML not well-formed or not validated error
3 participants