Skip to content

Include the return code only if Backend has no ReturnCode #124

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

Merged
merged 17 commits into from
Mar 14, 2025
Merged

Conversation

sameshai
Copy link
Member

No description provided.

@sameshai sameshai self-assigned this Feb 26, 2025
@sameshai sameshai force-pushed the errorcode branch 2 times, most recently from 6b31d3e to 2a0d7bb Compare February 28, 2025 08:45
Copy link
Collaborator

@arahamad arahamad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please provide actual logs with these changes

}
//If the CSIError is not empty
if msg.CSIError != "" {
return fmt.Sprintf("{RequestID: %s, Code: %s, Description: %s, Error: %s, Action: %s}", msg.RequestID, msg.Code, msg.Description, msg.CSIError, msg.Action)
}
return fmt.Sprintf("{RequestID: %s, Code: %s, Description: %s, Action: %s}", msg.RequestID, msg.Code, msg.Description, msg.Action)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When this will be used?

Copy link
Member Author

@sameshai sameshai Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be used for all existing errors we populated from cSI Driver. Check the logs from below existing CSI and new CSI error. The backend will use getCSIBackendError

https://github.ibm.com/alchemy-containers/armada-storage/issues/6171#issuecomment-106016766

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added documentation with example

userMsg.RequestID = requestID
userMsg.BackendError = backendError

logger.Error("FAILED CSI ERROR", zap.Error(userMsg))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add FIELD WITH BACKEND ERROR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok this can be done

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

if err != nil {
backendError = err.Error()
}
if strings.Contains(backendError, RC5XX) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add code comments here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -176,4 +176,7 @@ const (

// SubnetFindFailed ...
SubnetFindFailed = "SubnetFindFailed"

// RC5XX
RC5XX = "RC:5"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hope this will not cause any issue like existing string contains "RC: 500" or " RC : 501 " etc

Copy link
Member Author

@sameshai sameshai Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have 2 ways to get RC one from the RIAAS backend we know it is RC:5xx or RC:4xx and other way is via our defined messages which does not have space. So we should be good. Please check here https://github.com/IBM/ibmcloud-volume-interface/pull/48/files and example o/p
https://github.ibm.com/alchemy-containers/armada-storage/issues/6171#issuecomment-106016766

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@sameshai
Copy link
Member Author

Can you please provide actual logs with these changes

https://github.ibm.com/alchemy-containers/armada-storage/issues/6171#issuecomment-106016766

Signed-off-by: Sameer Shaikh <[email protected]>
@@ -42,9 +44,23 @@ func (msg Message) Error() string {

// Info ...
func (msg Message) Info() string {
/*If the BackendError is from library e.g BackendError: {Trace Code:920df6e8-6be9-4b4a-89e4-837ecb3f513d,
Code:volume_profile_capacity_iops_invalid,Description:The capacity or IOPS specified in the request is not valid for the custom profile,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove reference of any storage related comments ?
apart from this PR looks good

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated @arahamad

Signed-off-by: Sameer Shaikh <[email protected]>
Signed-off-by: Sameer Shaikh <[email protected]>
Signed-off-by: Sameer Shaikh <[email protected]>
Copy link
Collaborator

@arahamad arahamad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@prankulmahajan prankulmahajan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sameshai sameshai merged commit 283d55d into master Mar 14, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants