Closed ParthaI closed 2 years ago
Hi @ParthaI ,
Thanks for opening this thread and engaging in the community!
After looking into this in depth I came up with these 2 conclusions:
the backup service API does not offer a flattering response when making a request to a backup vault with 0 events in it. Ideally it should return an empty array.
The V1 SDK simply returns an empty &backup.GetBackupVaultNotificationsOutput{}
object and ignores the exception given from the server.
This is why you are seeing a more flattering response in V1, but the truth is that the SDK should in fact raise an exception.
If you enable wire logs on V1 you'll see the following response:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 400 Bad Request
Content-Length: 137
Content-Type: application/json
Date: Fri, 14 Oct 2022 15:20:45 GMT
X-Amzn-Errortype: ResourceNotFoundException:http://internal.amazon.com/coral/com.amazonaws.services.cryo/
X-Amzn-Requestid: <redacted>
-----------------------------------------------------
2022/10/14 08:20:45 {"Code":"ERROR_2106","Context":"testVault","Message":"Failed reading notifications from database for Backup vault testVault","Type":null}
{
}
I have reached out to the backup service team with a feature request to try and return a more sensible response in the form of an empty array. Since the V2 SDK is behaving as expected so there is no action item for us here.
If you have any additional questions please let me know. Thanks again! Ran~
This issue has not received a response in 1 week. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.
Hi @RanVaknin, Thanks for your update, Is there an ETA when the feature request will get released?
Hi @ParthaI ,
I just heard back from the manager of that team. The feature request was already raised twice before with that team but it seems like they cannot provide a timeline (and even if they could, we are forbidden from disclosing such information publicly)
In the spirit of transparency I'll say that these things are very very slow, and can take months to get addressed with internal teams.
Since there is no action here from the SDK team, and I did get a "will implement, but without timeline" from the service team I will go ahead and close this issue.
To unblock on v2, you can simply do something like the following:
op, err := client.GetBackupVaultNotifications(context.Background(), params)
if err != nil {
if strings.Contains(err.Error(), " Failed reading notifications from database for Backup vault ") {
op = &backup.GetBackupVaultNotificationsOutput{}
}
}
I'll suggest checking the releases every couple of weeks to see if this has been implemented.
Thanks again~ Ran
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the bug
While making the
GetBackupVaultNotifications
API call with AWS SDK V1, instead of throwing an error it returns a null value if no event notification is available but the AWS SDK V2 throwing an error (Error: operation error Backup: GetBackupVaultNotifications, https response error StatusCode: 400, RequestID: ffb8c91d-b86c-426b-ad2b-3c495a4e3da0, api error ERROR_2106: Failed reading notifications from database for Backup vault aws/efs/automatic-backup-vault
) instead of returning null value.Expected Behavior
The API should not return an error if there is no event notification available for a backup vault.
Current Behavior
The API always throws an error if no data is available.
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
AWS Go SDK V2 Module Versions Used
Compiler and Version used
go version go1.19.2 darwin/arm64
Operating System and version
MacOS Big Sur - Version 11.4