After loading an object via http with the same attribute key values, one of the attributes is deleted. #82

Closed
opened 2025-12-28 17:36:04 +00:00 by sami · 1 comment
Owner

Originally created by @acheyda on GitHub (Oct 31, 2022).

Originally assigned to: @ir0nbee on GitHub.

After loading an object via http with the same attribute key values, one of the attributes is deleted.

Expected Behavior

4096 / 31238065 [>-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 0.01% 0s
rpc error: client failure: status: code = 1024 message = duplication of attributes detected

Current Behavior

{
"object_id": "Fqso6FXSruE53272ZpNurP2K6AYXBGrsLRxaboEwuQxA",
"container_id": "HbwGNLHh4nUN9RUeWdCPJAD98aYRkYqVpN42awQh2u2R"
}

Possible Solution

From the user's side, after loading an object with the same attribute keys, the user expects to see them, but in fact, one of the attributes will not.
Maybe we should make a notification like in grpc that it is impossible to load an object with the same attribute keys?

Steps to Reproduce (for bugs)

1.Create an object

curl -F 'file=@4mobject.sample;filename=4mobject.sample' -H 'X-Attribute-Writer: Leo Tolstoy' -H 'X-Attribute-Writer: peace' -H 'X-Attribute-peace: peace' http://172.26.160.169:8888/upload/avccont
{
"object_id": "Fqso6FXSruE53272ZpNurP2K6AYXBGrsLRxaboEwuQxA",
"container_id": "HbwGNLHh4nUN9RUeWdCPJAD98aYRkYqVpN42awQh2u2R"
}

2.Check the result:

neofs-cli --rpc-endpoint 172.26.160.169:8080 -w configuration/wallets/wallet.json object head --cid HbwGNLHh4nUN9RUeWdCPJAD98aYRkYqVpN42awQh2u2R --oid Fqso6FXSruE53272ZpNurP2K6AYXBGrsLRxaboEwuQxA
Enter password >
ID: Fqso6FXSruE53272ZpNurP2K6AYXBGrsLRxaboEwuQxA
CID: HbwGNLHh4nUN9RUeWdCPJAD98aYRkYqVpN42awQh2u2R
Owner: NQYvNqjmhjpPvae8qpiJ3vn2YCEzbjCfCn
CreatedAt: 424
Size: 4194304
HomoHash: <empty>
Checksum: cbb56feb658897756d59eeac1c2d62d0c7782be38bd037571010438e360bc4ed
Type: REGULAR
Attributes:
Writer=peace
peace=peace
FileName=4mobject.sample
Timestamp=1666769126 (2022-10-26 07:25:26 +0000 UTC)
Split Header Signature:
public key: 02f48fbee4aee649cf74ad7841f192a471e552f66d3090345368247a2df9470ddd
signature: 048f0a4561dcd7320e4497af2df75cea7c32250bd7bb261268ce816a98f07fc87800a308a924b91be442378f05e5f8d56dd6173c3760d6413c64458024691eb560

Your Environment

NeoFS HTTP Gateway
Version: v0.24.0-17-g1b172e58
GoVersion: go1.18.4

Originally created by @acheyda on GitHub (Oct 31, 2022). Originally assigned to: @ir0nbee on GitHub. After loading an object via http with the same attribute key values, one of the attributes is deleted. ## Expected Behavior 4096 / 31238065 [>-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 0.01% 0s rpc error: client failure: status: code = 1024 message = duplication of attributes detected ## Current Behavior { "object_id": "Fqso6FXSruE53272ZpNurP2K6AYXBGrsLRxaboEwuQxA", "container_id": "HbwGNLHh4nUN9RUeWdCPJAD98aYRkYqVpN42awQh2u2R" } ## Possible Solution From the user's side, after loading an object with the same attribute keys, the user expects to see them, but in fact, one of the attributes will not. Maybe we should make a notification like in grpc that it is impossible to load an object with the same attribute keys? ## Steps to Reproduce (for bugs) 1.Create an object ``` curl -F 'file=@4mobject.sample;filename=4mobject.sample' -H 'X-Attribute-Writer: Leo Tolstoy' -H 'X-Attribute-Writer: peace' -H 'X-Attribute-peace: peace' http://172.26.160.169:8888/upload/avccont { "object_id": "Fqso6FXSruE53272ZpNurP2K6AYXBGrsLRxaboEwuQxA", "container_id": "HbwGNLHh4nUN9RUeWdCPJAD98aYRkYqVpN42awQh2u2R" } ``` 2.Check the result: ``` neofs-cli --rpc-endpoint 172.26.160.169:8080 -w configuration/wallets/wallet.json object head --cid HbwGNLHh4nUN9RUeWdCPJAD98aYRkYqVpN42awQh2u2R --oid Fqso6FXSruE53272ZpNurP2K6AYXBGrsLRxaboEwuQxA Enter password > ID: Fqso6FXSruE53272ZpNurP2K6AYXBGrsLRxaboEwuQxA CID: HbwGNLHh4nUN9RUeWdCPJAD98aYRkYqVpN42awQh2u2R Owner: NQYvNqjmhjpPvae8qpiJ3vn2YCEzbjCfCn CreatedAt: 424 Size: 4194304 HomoHash: <empty> Checksum: cbb56feb658897756d59eeac1c2d62d0c7782be38bd037571010438e360bc4ed Type: REGULAR Attributes: Writer=peace peace=peace FileName=4mobject.sample Timestamp=1666769126 (2022-10-26 07:25:26 +0000 UTC) Split Header Signature: public key: 02f48fbee4aee649cf74ad7841f192a471e552f66d3090345368247a2df9470ddd signature: 048f0a4561dcd7320e4497af2df75cea7c32250bd7bb261268ce816a98f07fc87800a308a924b91be442378f05e5f8d56dd6173c3760d6413c64458024691eb560 ``` ## Your Environment NeoFS HTTP Gateway Version: v0.24.0-17-g1b172e58 GoVersion: go1.18.4
sami 2025-12-28 17:36:04 +00:00
  • closed this issue
  • added the
    bug
    U3
    labels
Author
Owner

@alexvanin commented on GitHub (Nov 3, 2022):

Native protocol returns error. Gateway should not decide which attribute is valid, so let's return an error in this case.

@alexvanin commented on GitHub (Nov 3, 2022): Native protocol returns error. Gateway should not decide which attribute is valid, so let's return an error in this case.
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-http-gw#82
No description provided.