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

Parse kopia errors #1973

Merged
merged 3 commits into from
Apr 21, 2023
Merged

Parse kopia errors #1973

merged 3 commits into from
Apr 21, 2023

Conversation

e-sumin
Copy link
Contributor

@e-sumin e-sumin commented Mar 23, 2023

Change Overview

This PR introduces generic mechanism to parse Kopia errors.

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

@e-sumin e-sumin requested a review from pavannd1 March 23, 2023 10:34
@github-actions
Copy link
Contributor

Thanks for submitting this pull request 🎉. The team will review it soon and get back to you.

If you haven't already, please take a moment to review our project contributing guideline and Code of Conduct document.

@infraq infraq added this to In Progress in Kanister Mar 23, 2023
@e-sumin e-sumin force-pushed the kopia_errors_parsing branch 2 times, most recently from 294e90e to 4efd20f Compare March 23, 2023 10:44
Copy link
Contributor

@ankitjain235 ankitjain235 left a comment

Choose a reason for hiding this comment

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

Minor question, looks good otherwise.

var kopiaErrorPattern = regexp.MustCompile(`ERROR\s+(.*)`)

// ErrorFromOutput parses the output of a kopia and returns an error, if found
func ErrorsFromOutput(output string) []error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this function only for kopia repository sub commands and not for other commands?
For example for kopia snapshot restore commands, it could be of format:

error restoring: restore error: error copying: copy file: error creating file:

Another example could be:

error setting attributes: could not change owner/group

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I added couple more cases. I went through Kopia's repo and found that they have several unstructured error logs, but they will be covered by generic "last x log lines" mechanism.

@e-sumin
Copy link
Contributor Author

e-sumin commented Apr 19, 2023

@ankitjain235 @pavannd1 do you think it's mergeable now ?

Copy link
Contributor

@ankitjain235 ankitjain235 left a comment

Choose a reason for hiding this comment

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

LGTM.

Kanister automation moved this from In Progress to Reviewer approved Apr 21, 2023
@e-sumin e-sumin added the kueue label Apr 21, 2023
@mergify mergify bot merged commit f74570f into master Apr 21, 2023
Kanister automation moved this from Reviewer approved to Done Apr 21, 2023
@mergify mergify bot deleted the kopia_errors_parsing branch April 21, 2023 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants