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

notification log has incorrect entry for failed / successful upload of objects when create event is set #8815

Open
rkomandu opened this issue Feb 20, 2025 · 1 comment
Labels

Comments

@rkomandu
Copy link
Collaborator

Environment info

  • NooBaa Version: VERSION
  • Platform: Kubernetes 1.14.1 | minikube 1.1.1 | OpenShift 4.1 | other: specify

noobaa d/s rpm noobaa-core-5.18.0-20250218.el9.x86_64

Actual behavior

notification.json is posted for reference


{
  "TopicConfigurations": [
    {
      "Id": "notify_event",
      "TopicArn": "notify_event.json",
      "Events": [
        "s3:ObjectRemoved:Delete",
        "s3:ObjectCreated:Copy",
        "s3:ObjectCreated:Put"
      ]
    }
  ]
}


Have two buckets namely

s3u20k1 ls
urllib3/connectionpool.py:1061: InsecureRequestWarning: Unverified HTTPS request is being made to host '192.168.0.6'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
2025-02-19 07:55:07 newbucket-notify
2025-02-20 02:00:04 newbucket-notify-api

each bucket has the following files
s3u20k1 ls s3://newbucket-notify
urllib3/connectionpool.py:1061: InsecureRequestWarning: Unverified HTTPS request is being made to host '192.168.0.6'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
2025-02-20 01:27:39         44 file-1
2025-02-20 04:01:46         46 file-4
2025-02-19 09:27:20 2147483648 file_2G

s3u20k1 ls s3://newbucket-notify-api
urllib3/connectionpool.py:1061: InsecureRequestWarning: Unverified HTTPS request is being made to host '192.168.0.6'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
2025-02-20 02:04:01         44 file-1
2025-02-20 02:07:44         44 file-2
2025-02-20 04:02:42         46 file-4

two things which am discussing here in the defect, which needs to be fixed

a) copy object with an incorrect syntax, the ops fails for the S3 users, however the notification log has incorrect entry for the parameters

s3u20k1-api copy-object --bucket newbucket-notify-api --copy-source s3://newbucket-notify/file_2G --key file_2G
urllib3/connectionpool.py:1061: InsecureRequestWarning: Unverified HTTPS request is being made to host '192.168.0.6'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings

An error occurred (NoSuchBucket) when calling the CopyObject operation: The specified bucket does not exist.

for this the notification file has an entry as follows (this is unsuccessful operation) 

{"meta":{"connect":"notify_event.json","name":"notify_event","bucket":"newbucket-notify-api"},"notif":{"Records":[{"eventVersion":"2.3","eventSource":"rk523-13:s3","eventTime":"2025-02-20T07:39:16.530Z","s3":{"s3SchemaVersion":"1.0","object":{"sequencer":"195224beeb2","key":"file_2G","size":225},"bucket":{"name":"newbucket-notify-api","ownerIdentity":{"principalId":"s3user20k1"},"arn":"arn:aws:s3:::newbucket-notify-api"}},"eventName":"ObjectCreated:Copy","userIdentity":{"principalId":"s3user20k1"},"requestParameters":{"sourceIPAddress":"::ffff:192.168.0.50"},"responseElements":{"x-amz-request-id":"m7d172qy-bb4d8t-u55","x-amz-id-2":"m7d172qy-bb4d8t-u55"}}]}}

here the "size" is incorrect --> is this a valid entry in the notification or does it need some trimming ?

b) copy object which is successful , also has some parameters unmatched in the notification log

 s3u20k1-api copy-object --bucket newbucket-notify-api --copy-source newbucket-notify/file-4 --key file-4
urllib3/connectionpool.py:1061: InsecureRequestWarning: Unverified HTTPS request is being made to host '192.168.0.6'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
{
    "CopyObjectResult": {
        "ETag": "\"mtime-d7x5gu4wy5fk-ino-5vm\"",
        "LastModified": "2025-02-20T09:02:42+00:00"
    }
}

notification message in the log 

{"meta":{"connect":"notify_event.json","name":"notify_event","bucket":"newbucket-notify-api"},"notif":{"Records":[{"eventVersion":"2.3","eventSource":"rk523-13:s3","eventTime":"2025-02-20T09:02:42.673Z","s3":{"s3SchemaVersion":"1.0","object":{"sequencer":"195229851f1","key":"file-4","size":227},"bucket":{"name":"newbucket-notify-api","ownerIdentity":{"principalId":"s3user20k1"},"arn":"arn:aws:s3:::newbucket-notify-api"}},"eventName":"ObjectCreated:Copy","userIdentity":{"principalId":"s3user20k1"},"requestParameters":{"sourceIPAddress":"::ffff:192.168.0.50"},"responseElements":{"x-amz-request-id":"m7d46dfl-byfx51-15h2","x-amz-id-2":"m7d46dfl-byfx51-15h2"}}]}}


here the size is "227" which is incorrect , it should be 46 as per above listing

Expected behavior

For a) , b) the size is also mentioned incorrectly. Secondly if the ops is unsuccessful as in case a) above, still the notification is generated to the log.
Is this expected behavior of having to log all the events whether they are successful or failed on the operation ?

Steps to reproduce

Mentioned above
a) create 2 buckets, enable bucket notification
b) have notification for the Copy operation "copy object"
c) perform incorrect copy-object and check the message as in a)
d) perform correct copy-object and check the message as in b) with size value incorrect.

More information - Screenshots / Logs / Other output

@rkomandu rkomandu added the NS-FS label Feb 20, 2025
@rkomandu
Copy link
Collaborator Author

for b) when the copy-object ops is performed, the file size is incorrect, where the original file in the source bucket show correctly.

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

No branches or pull requests

1 participant