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

PutObjectLegalHold: 500 during switching status to off #868

Closed
evgeniiz321 opened this issue Oct 19, 2023 · 2 comments · Fixed by #889
Closed

PutObjectLegalHold: 500 during switching status to off #868

evgeniiz321 opened this issue Oct 19, 2023 · 2 comments · Fixed by #889
Assignees
Labels
bug Something isn't working
Milestone

Comments

@evgeniiz321
Copy link

def test_object_lock_get_legal_hold():
    bucket_name = get_new_bucket_name()
    client = get_client()
    client.create_bucket(Bucket=bucket_name, ObjectLockEnabledForBucket=True)
    key = "file1"
    client.put_object(Bucket=bucket_name, Body="abc", Key=key)
    legal_hold = {"Status": "ON"}
    client.put_object_legal_hold(Bucket=bucket_name, Key=key, LegalHold=legal_hold)
    response = client.get_object_legal_hold(Bucket=bucket_name, Key=key)
    assert response["LegalHold"] == legal_hold
    legal_hold_off = {"Status": "OFF"}
    client.put_object_legal_hold(Bucket=bucket_name, Key=key, LegalHold=legal_hold_off)
    response = client.get_object_legal_hold(Bucket=bucket_name, Key=key)
    assert response["LegalHold"] == legal_hold_off

Second put_object_legal_hold with {"Status": "OFF"} results in 500:

2023-10-19T23:19:02.176Z        error   handler/util.go:29      call method     {"status": 500, "request_id": "b58bf023-c37b-4c02-85c1-5baa25a9fa54", "method": "PutObjectLegalHold", "bucket": "yournamehere-q2bte72e99rpkueh-1", "object": "file1", "description": "couldn't head put legal hold", "error": "couldn't delete lock object 'CLdPcpKkxqLuyho2qiBYtDDSFW3x1WdTQ4pjyxW8wBHS' to remove legal hold: mark object removal via connection pool: status: code = 1024 message = incomplete object PUT by placement: could not close object stream: (*putsvc.remoteTarget) could not put object to [/dns4/s01.neofs.devenv/tcp/8080]: finish object stream: status: code = 1024 message = incomplete object PUT by placement: could not close object stream: could not delete objects from tombstone locally: lock object removal"}

If this action is not supported - then NotImplemented should be returned

@evgeniiz321 evgeniiz321 added bug Something isn't working triage labels Oct 19, 2023
@roman-khimov roman-khimov added this to the v0.30.0 milestone Oct 20, 2023
@smallhive smallhive self-assigned this Oct 30, 2023
smallhive added a commit that referenced this issue Oct 31, 2023
@smallhive
Copy link
Contributor

After some investigation and @carpawell help I should say, setting OFF with PutObjectLegalHold is not supported by the gate.
This was mentioned in docs but I consider It was not clear enough to understand. In PR #889, I've added a clean error and extended docs.

@carpawell
Copy link
Member

Refs nspcc-dev/neofs-contract#247.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants