Skip to content

[Bug] - REST DeleteObjects - invalid version ID error has incorrect code, missing version ID #2119

@lrm25

Description

@lrm25

Describe the bug
S3:

   <?xml version="1.0" encoding="UTF-8"?>
   <DeleteResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Error><Key>test-file-705FF5DE-9149-4702-92CD-8C485CBFDAE3</Key><VersionId>abc</VersionId><Code>NoSuchVersion</Code><Message>The specified version does not exist.</Message></Error></DeleteResult>

versitgw:

   <?xml version="1.0" encoding="UTF-8"?>
   <DeleteResult><Error><Code>InvalidArgument</Code><Key>test-file-1EE9C3CD-D9B3-43F6-9529-B48C5210727F</Key><Message>Invalid version id specified</Message></Error></DeleteResult>

To Reproduce

  1. Start versitygw, e.g.: ./versitygw --access=AKIA**** --secret=******** --region=us-east-1 --cert /Users/lukemccrone/devel/versitygw/cert.pem --key /Users/lukemccrone/devel/versitygw/versitygw.pem posix --versioning-dir /tmp/versioning /tmp/gw
  2. Create bucket, e.g.: curl -ks -w %{http_code} -X PUT https://localhost:7070/versity-gwtest-bucket-one-1-a6e79ab2-407e-4a95-b0aa-8d416958614 -H Authorization: AWS4-HMAC-SHA256 Credential=AKIA6****/20260506/us-east-1/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date,Signature=2be6ceda1cd93c0e8cecba78118de1452a3f60255b0af8c4deb58b30f1d1edad -H host: localhost:7070 -H x-amz-content-sha256: UNSIGNED-PAYLOAD -H x-amz-date: 20260506T205308Z -o /Users/lukemccrone/devel/versitygw/versity-gwtest-files/test-file-D0BD18D9-907D-48BF-BF2E-9EE2F3FBD93A
  3. Add file to bucket, e.g.: curl -ks -w %{http_code} -X PUT https://localhost:7070/versity-gwtest-bucket-one-1-a6e79ab2-407e-4a95-b0aa-8d416958614/test-file-1EE9C3CD-D9B3-43F6-9529-B48C5210727F -H Authorization: AWS4-HMAC-SHA256 Credential=AKIA6****/20260506/us-east-1/s3/aws4_request,SignedHeaders=host;x-amz-content-sha256;x-amz-date,Signature=731f2fa9bb25cf33192184584fd53975e1d210e33e7d41bee4a06a9f404f424c -H host: localhost:7070 -H x-amz-content-sha256: e3ff76570b9acc6342b78fd31606d1bbb6edf5aa10474149a04cd3c34239407e -H x-amz-date: 20260506T205308Z -T /Users/lukemccrone/devel/versitygw/versity-gwtest-files/test-file-1EE9C3CD-D9B3-43F6-9529-B48C5210727F -o /Users/lukemccrone/devel/versitygw/versity-gwtest-files/test-file-B94346CC-B771-48B8-930C-88F21FA853DA
  4. Attempt to delete with bad version ID, e.g.: curl -ksi -X POST https://localhost:7070/versity-gwtest-bucket-one-1-a6e79ab2-407e-4a95-b0aa-8d416958614?delete= -H Authorization: AWS4-HMAC-SHA256 Credential=AKIA6****/20260506/us-east-1/s3/aws4_request,SignedHeaders=content-md5;host;x-amz-content-sha256;x-amz-date;x-amz-decoded-content-length,Signature=d6198cbd69e06b6a218c73eac537bd630d15511249b68cd543e278550ebe20e6 -H Content-MD5: PP1Zy2j+9mMTTper1Oh1Mg== -H host: localhost:7070 -H x-amz-content-sha256: 53ffce8fcf3fd5a332034ff3c7477390eaf90b24c73eb671df4cac20e0327c7d -H x-amz-date: 20260506T205309Z -H x-amz-decoded-content-length: 205 -H Content-Type: application/xml --data-binary @/Users/lukemccrone/devel/versitygw/versity-gwtest-files/test-file-9F2A6DC6-B2F0-454A-8DC3-53E98EE8861E -o /Users/lukemccrone/devel/versitygw/versity-gwtest-files/test-file-616C58B0-A41E-42D5-AB7B-8042391D3A43
    payload:
<?xml version="1.0" encoding="UTF-8"?>
<Delete xmlns="https://s3.amazonaws.com/doc/2006-03-01/"><Object><Key>test-file-1EE9C3CD-D9B3-43F6-9529-B48C5210727F</Key><VersionId>abc</VersionId></Object></Delete>

Expected behavior

Server Version
Version : v1.4.1
Build : a7007bf4
BuildTime: 2026-05-04_10:52:21PM
Darwin Lukes-MacBook-Pro.local 24.6.0 Darwin Kernel Version 24.6.0: Mon Jul 14 11:28:30 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6030 arm64

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

Status
In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions