The gw deletes a null object in versioned bucket from NeoFS if version is not specified in a request #259

Closed
opened 2025-12-28 17:36:46 +00:00 by sami · 6 comments
Owner

Originally created by @masterSplinter01 on GitHub (Jun 17, 2022).

Originally assigned to: @KirillovDenis on GitHub.

tree-service branch:

$ aws s3api create-bucket --bucket test7 --endpoint-url http://127.0.0.1:8084

$ aws s3api put-object --key a --body ~/cat.txt  --bucket test7 --endpoint-url http://127.0.0.1:8084 
{
  "ETag": "93d30be4ee6dd625821e8b35f93af305f3f084aa595440a5e696d11dbbc6516a"
  
$ aws s3api put-bucket-versioning --versioning-configuration Status=Enabled  --bucket test7 --endpoint-url http://127.0.0.1:8084

$ aws s3api put-object --key a --body ~/cat.txt  --bucket test7 --endpoint-url http://127.0.0.1:8084
{
  "ETag": "93d30be4ee6dd625821e8b35f93af305f3f084aa595440a5e696d11dbbc6516a",
  "VersionId": "EFf9FAJb48X1gkN5Ca4MjYzWVxkGdA7XWPa6X8d57ZD2"
}

$ neofs-cli container list-objects --wallet ~/work/neofs-dev-env/wallets/wallet.json --rpc-endpoint 192.168.130.71:8080  --cid DdPGrNVp5vu9ja7ayEp7SLKZfi8rRosMsBrqW1KN4CEo
Enter password > 
Gqb3zTbsT9aHPwtgyaHpgwGYqcup6yJmCZ12WDA87zU5
EFf9FAJb48X1gkN5Ca4MjYzWVxkGdA7XWPa6X8d57ZD2

$ aws s3api delete-object --key a --bucket test7  --endpoint-url http://127.0.0.1:8084

$ aws s3api list-object-versions --bucket test7 --endpoint-url http://127.0.0.1:8084| jq                                                      ✔ 
{
  "Versions": [
    {
      "ETag": "93d30be4ee6dd625821e8b35f93af305f3f084aa595440a5e696d11dbbc6516a",
      "Size": 110,
      "Key": "a",
      "VersionId": "EFf9FAJb48X1gkN5Ca4MjYzWVxkGdA7XWPa6X8d57ZD2",
      "IsLatest": false,
      "LastModified": "2022-06-17T23:25:04+00:00",
      "Owner": {
        "DisplayName": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM",
        "ID": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM"
      }
    }
  ],
  "DeleteMarkers": [
    {
      "Owner": {
        "DisplayName": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM",
        "ID": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM"
      },
      "Key": "a",
      "VersionId": "CTrY8CcKp1AG1AgjSUtPrxCo8zjgM4EkRraUCBauMotr",
      "IsLatest": true,
      "LastModified": "2022-06-17T23:26:35+00:00"
    }
  ]
}


$ neofs-cli container list-objects --wallet ~/work/neofs-dev-env/wallets/wallet.json --rpc-endpoint 192.168.130.71:8080  --cid DdPGrNVp5vu9ja7ayEp7SLKZfi8rRosMsBrqW1KN4CEo
Enter password > 
EFf9FAJb48X1gkN5Ca4MjYzWVxkGdA7XWPa6X8d57ZD2

Originally created by @masterSplinter01 on GitHub (Jun 17, 2022). Originally assigned to: @KirillovDenis on GitHub. `tree-service` branch: ``` $ aws s3api create-bucket --bucket test7 --endpoint-url http://127.0.0.1:8084 $ aws s3api put-object --key a --body ~/cat.txt --bucket test7 --endpoint-url http://127.0.0.1:8084 { "ETag": "93d30be4ee6dd625821e8b35f93af305f3f084aa595440a5e696d11dbbc6516a" $ aws s3api put-bucket-versioning --versioning-configuration Status=Enabled --bucket test7 --endpoint-url http://127.0.0.1:8084 $ aws s3api put-object --key a --body ~/cat.txt --bucket test7 --endpoint-url http://127.0.0.1:8084 { "ETag": "93d30be4ee6dd625821e8b35f93af305f3f084aa595440a5e696d11dbbc6516a", "VersionId": "EFf9FAJb48X1gkN5Ca4MjYzWVxkGdA7XWPa6X8d57ZD2" } $ neofs-cli container list-objects --wallet ~/work/neofs-dev-env/wallets/wallet.json --rpc-endpoint 192.168.130.71:8080 --cid DdPGrNVp5vu9ja7ayEp7SLKZfi8rRosMsBrqW1KN4CEo Enter password > Gqb3zTbsT9aHPwtgyaHpgwGYqcup6yJmCZ12WDA87zU5 EFf9FAJb48X1gkN5Ca4MjYzWVxkGdA7XWPa6X8d57ZD2 $ aws s3api delete-object --key a --bucket test7 --endpoint-url http://127.0.0.1:8084 $ aws s3api list-object-versions --bucket test7 --endpoint-url http://127.0.0.1:8084| jq  ✔ { "Versions": [ { "ETag": "93d30be4ee6dd625821e8b35f93af305f3f084aa595440a5e696d11dbbc6516a", "Size": 110, "Key": "a", "VersionId": "EFf9FAJb48X1gkN5Ca4MjYzWVxkGdA7XWPa6X8d57ZD2", "IsLatest": false, "LastModified": "2022-06-17T23:25:04+00:00", "Owner": { "DisplayName": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM", "ID": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM" } } ], "DeleteMarkers": [ { "Owner": { "DisplayName": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM", "ID": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM" }, "Key": "a", "VersionId": "CTrY8CcKp1AG1AgjSUtPrxCo8zjgM4EkRraUCBauMotr", "IsLatest": true, "LastModified": "2022-06-17T23:26:35+00:00" } ] } $ neofs-cli container list-objects --wallet ~/work/neofs-dev-env/wallets/wallet.json --rpc-endpoint 192.168.130.71:8080 --cid DdPGrNVp5vu9ja7ayEp7SLKZfi8rRosMsBrqW1KN4CEo Enter password > EFf9FAJb48X1gkN5Ca4MjYzWVxkGdA7XWPa6X8d57ZD2 ```
sami 2025-12-28 17:36:46 +00:00
Author
Owner

@KirillovDenis commented on GitHub (Jun 20, 2022):

As I understand it's expected behavior. https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html (Removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object.)

@KirillovDenis commented on GitHub (Jun 20, 2022): As I understand it's expected behavior. https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html (`Removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object.`)
Author
Owner

@masterSplinter01 commented on GitHub (Jun 20, 2022):

Amazon doesn't delete null version:

$ aws s3api list-object-versions --bucket kkekteeva12 | jq                                                                                  
{
  "Versions": [
    {
      "ETag": "\"bb285fe38300f07d7b755e3b45c0020d\"",
      "Size": 87422,
      "StorageClass": "STANDARD",
      "Key": "b",
      "VersionId": "s_sJlN890ltOKD1a9Gz0pQ5fm_vHD0Hm",
      "IsLatest": true,
      "LastModified": "2022-06-20T06:23:23+00:00",
      "Owner": {
        "DisplayName": "ops",
        "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b"
      }
    },
    {
      "ETag": "\"bb285fe38300f07d7b755e3b45c0020d\"",
      "Size": 87422,
      "StorageClass": "STANDARD",
      "Key": "b",
      "VersionId": "El2XHKZ42Z.2KPm4r79haD2HBJCbZ95D",
      "IsLatest": false,
      "LastModified": "2022-06-20T06:23:17+00:00",
      "Owner": {
        "DisplayName": "ops",
        "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b"
      }
    },
    {
      "ETag": "\"bb285fe38300f07d7b755e3b45c0020d\"",
      "Size": 87422,
      "StorageClass": "STANDARD",
      "Key": "b",
      "VersionId": "null",
      "IsLatest": false,
      "LastModified": "2022-06-20T06:22:56+00:00",
      "Owner": {
        "DisplayName": "ops",
        "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b"
      }
    }
  ]
}

$ aws s3api delete-object --key a --bucket kkekteeva12                                                                                  
{
  "DeleteMarker": true,
  "VersionId": "MgyCrFx0AaqQhUfaEIYU56Guw7zrAORP"
}

$ aws s3api list-object-versions --bucket kkekteeva12                                                                              
{
  "Versions": [
    {
      "ETag": "\"bb285fe38300f07d7b755e3b45c0020d\"",
      "Size": 87422,
      "StorageClass": "STANDARD",
      "Key": "b",
      "VersionId": "s_sJlN890ltOKD1a9Gz0pQ5fm_vHD0Hm",
      "IsLatest": true,
      "LastModified": "2022-06-20T06:23:23+00:00",
      "Owner": {
        "DisplayName": "ops",
        "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b"
      }
    },
    {
      "ETag": "\"bb285fe38300f07d7b755e3b45c0020d\"",
      "Size": 87422,
      "StorageClass": "STANDARD",
      "Key": "b",
      "VersionId": "El2XHKZ42Z.2KPm4r79haD2HBJCbZ95D",
      "IsLatest": false,
      "LastModified": "2022-06-20T06:23:17+00:00",
      "Owner": {
        "DisplayName": "ops",
        "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b"
      }
    },
    {
      "ETag": "\"bb285fe38300f07d7b755e3b45c0020d\"",
      "Size": 87422,
      "StorageClass": "STANDARD",
      "Key": "b",
      "VersionId": "null",
      "IsLatest": false,
      "LastModified": "2022-06-20T06:22:56+00:00",
      "Owner": {
        "DisplayName": "ops",
        "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b"
      }
    }
  ],
  "DeleteMarkers": [
    {
      "Owner": {
        "DisplayName": "ops",
        "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b"
      },
      "Key": "a",
      "VersionId": "MgyCrFx0AaqQhUfaEIYU56Guw7zrAORP",
      "IsLatest": true,
      "LastModified": "2022-06-20T06:24:00+00:00"
    }
  ]
}

Also, I don't see any information about deleting of null version here:
https://docs.aws.amazon.com/AmazonS3/latest/userguide/DeleteMarker.html

But in the schemes null version shouldn't be deleted after delete-marker has been placed.

@masterSplinter01 commented on GitHub (Jun 20, 2022): Amazon doesn't delete `null` version: ``` $ aws s3api list-object-versions --bucket kkekteeva12 | jq { "Versions": [ { "ETag": "\"bb285fe38300f07d7b755e3b45c0020d\"", "Size": 87422, "StorageClass": "STANDARD", "Key": "b", "VersionId": "s_sJlN890ltOKD1a9Gz0pQ5fm_vHD0Hm", "IsLatest": true, "LastModified": "2022-06-20T06:23:23+00:00", "Owner": { "DisplayName": "ops", "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b" } }, { "ETag": "\"bb285fe38300f07d7b755e3b45c0020d\"", "Size": 87422, "StorageClass": "STANDARD", "Key": "b", "VersionId": "El2XHKZ42Z.2KPm4r79haD2HBJCbZ95D", "IsLatest": false, "LastModified": "2022-06-20T06:23:17+00:00", "Owner": { "DisplayName": "ops", "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b" } }, { "ETag": "\"bb285fe38300f07d7b755e3b45c0020d\"", "Size": 87422, "StorageClass": "STANDARD", "Key": "b", "VersionId": "null", "IsLatest": false, "LastModified": "2022-06-20T06:22:56+00:00", "Owner": { "DisplayName": "ops", "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b" } } ] } $ aws s3api delete-object --key a --bucket kkekteeva12 { "DeleteMarker": true, "VersionId": "MgyCrFx0AaqQhUfaEIYU56Guw7zrAORP" } $ aws s3api list-object-versions --bucket kkekteeva12 { "Versions": [ { "ETag": "\"bb285fe38300f07d7b755e3b45c0020d\"", "Size": 87422, "StorageClass": "STANDARD", "Key": "b", "VersionId": "s_sJlN890ltOKD1a9Gz0pQ5fm_vHD0Hm", "IsLatest": true, "LastModified": "2022-06-20T06:23:23+00:00", "Owner": { "DisplayName": "ops", "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b" } }, { "ETag": "\"bb285fe38300f07d7b755e3b45c0020d\"", "Size": 87422, "StorageClass": "STANDARD", "Key": "b", "VersionId": "El2XHKZ42Z.2KPm4r79haD2HBJCbZ95D", "IsLatest": false, "LastModified": "2022-06-20T06:23:17+00:00", "Owner": { "DisplayName": "ops", "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b" } }, { "ETag": "\"bb285fe38300f07d7b755e3b45c0020d\"", "Size": 87422, "StorageClass": "STANDARD", "Key": "b", "VersionId": "null", "IsLatest": false, "LastModified": "2022-06-20T06:22:56+00:00", "Owner": { "DisplayName": "ops", "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b" } } ], "DeleteMarkers": [ { "Owner": { "DisplayName": "ops", "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b" }, "Key": "a", "VersionId": "MgyCrFx0AaqQhUfaEIYU56Guw7zrAORP", "IsLatest": true, "LastModified": "2022-06-20T06:24:00+00:00" } ] } ``` Also, I don't see any information about deleting of `null` version here: https://docs.aws.amazon.com/AmazonS3/latest/userguide/DeleteMarker.html But in the schemes `null` version shouldn't be deleted after `delete-marker` has been placed.
Author
Owner

@KirillovDenis commented on GitHub (Jun 20, 2022):

Sorry, but your output is a little odd because you tried to delete the key a though in bucket you have only key b with null version.

@KirillovDenis commented on GitHub (Jun 20, 2022): Sorry, but your output is a little odd because you tried to delete the key `a` though in bucket you have only key `b` with `null` version.
Author
Owner

@masterSplinter01 commented on GitHub (Jun 20, 2022):

Sorry, typo, tried to remove b :

$ aws s3api delete-object --key b --bucket kkekteeva12   
{
  "DeleteMarker": true,
  "VersionId": "L.VuItIBg7rDa1WWvoD5wTIK6DCo3k1k"
}

$ aws s3api list-object-versions --bucket kkekteeva12 
{
  "Versions": [
    {
      "ETag": "\"bb285fe38300f07d7b755e3b45c0020d\"",
      "Size": 87422,
      "StorageClass": "STANDARD",
      "Key": "b",
      "VersionId": "s_sJlN890ltOKD1a9Gz0pQ5fm_vHD0Hm",
      "IsLatest": false,
      "LastModified": "2022-06-20T06:23:23+00:00",
      "Owner": {
        "DisplayName": "ops",
        "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b"
      }
    },
    {
      "ETag": "\"bb285fe38300f07d7b755e3b45c0020d\"",
      "Size": 87422,
      "StorageClass": "STANDARD",
      "Key": "b",
      "VersionId": "El2XHKZ42Z.2KPm4r79haD2HBJCbZ95D",
      "IsLatest": false,
      "LastModified": "2022-06-20T06:23:17+00:00",
      "Owner": {
        "DisplayName": "ops",
        "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b"
      }
    },
    {
      "ETag": "\"bb285fe38300f07d7b755e3b45c0020d\"",
      "Size": 87422,
      "StorageClass": "STANDARD",
      "Key": "b",
      "VersionId": "null",
      "IsLatest": false,
      "LastModified": "2022-06-20T06:22:56+00:00",
      "Owner": {
        "DisplayName": "ops",
        "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b"
      }
    }
  ],
  "DeleteMarkers": [
    {
      "Owner": {
        "DisplayName": "ops",
        "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b"
      },
      "Key": "a",
      "VersionId": "MgyCrFx0AaqQhUfaEIYU56Guw7zrAORP",
      "IsLatest": true,
      "LastModified": "2022-06-20T06:24:00+00:00"
    },
    {
      "Owner": {
        "DisplayName": "ops",
        "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b"
      },
      "Key": "b",
      "VersionId": "L.VuItIBg7rDa1WWvoD5wTIK6DCo3k1k",
      "IsLatest": true,
      "LastModified": "2022-06-20T16:06:11+00:00"
    }
  ]
}

Nothing changed

@masterSplinter01 commented on GitHub (Jun 20, 2022): Sorry, typo, tried to remove `b` : ``` $ aws s3api delete-object --key b --bucket kkekteeva12 { "DeleteMarker": true, "VersionId": "L.VuItIBg7rDa1WWvoD5wTIK6DCo3k1k" } $ aws s3api list-object-versions --bucket kkekteeva12 { "Versions": [ { "ETag": "\"bb285fe38300f07d7b755e3b45c0020d\"", "Size": 87422, "StorageClass": "STANDARD", "Key": "b", "VersionId": "s_sJlN890ltOKD1a9Gz0pQ5fm_vHD0Hm", "IsLatest": false, "LastModified": "2022-06-20T06:23:23+00:00", "Owner": { "DisplayName": "ops", "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b" } }, { "ETag": "\"bb285fe38300f07d7b755e3b45c0020d\"", "Size": 87422, "StorageClass": "STANDARD", "Key": "b", "VersionId": "El2XHKZ42Z.2KPm4r79haD2HBJCbZ95D", "IsLatest": false, "LastModified": "2022-06-20T06:23:17+00:00", "Owner": { "DisplayName": "ops", "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b" } }, { "ETag": "\"bb285fe38300f07d7b755e3b45c0020d\"", "Size": 87422, "StorageClass": "STANDARD", "Key": "b", "VersionId": "null", "IsLatest": false, "LastModified": "2022-06-20T06:22:56+00:00", "Owner": { "DisplayName": "ops", "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b" } } ], "DeleteMarkers": [ { "Owner": { "DisplayName": "ops", "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b" }, "Key": "a", "VersionId": "MgyCrFx0AaqQhUfaEIYU56Guw7zrAORP", "IsLatest": true, "LastModified": "2022-06-20T06:24:00+00:00" }, { "Owner": { "DisplayName": "ops", "ID": "68e12342e5971d09ced74634fc7cc0fc5f01419d06b76353d42ce3108367183b" }, "Key": "b", "VersionId": "L.VuItIBg7rDa1WWvoD5wTIK6DCo3k1k", "IsLatest": true, "LastModified": "2022-06-20T16:06:11+00:00" } ] } ``` Nothing changed
Author
Owner

@alexvanin commented on GitHub (Jun 23, 2022):

Seems like this is correct behavior when versioning is off, but in those examples versioning is on.

@alexvanin commented on GitHub (Jun 23, 2022): Seems like this is correct behavior when versioning is off, but in those examples versioning is on.
Author
Owner

@KirillovDenis commented on GitHub (Jul 6, 2022):

Done in #554

@KirillovDenis commented on GitHub (Jul 6, 2022): Done in #554
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-s3-gw#259
No description provided.