-
Notifications
You must be signed in to change notification settings - Fork 18
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
fix: show bacalhau id error #192
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hunjixin thank you for the changes, can you provide a video recording of how this changes affect the POW process?
7a802d0
to
402da7b
Compare
add a new commit to resolve this problem, cmd output some odd error log. just parse the last line @AquiGorka |
if err != nil { | ||
return "", fmt.Errorf("error calling get id results %s", err.Error()) | ||
} | ||
|
||
splitOutputs := strings.Split(strings.Trim(string(runOutputRaw), " \t\n"), "\n") | ||
runOutput := splitOutputs[len(splitOutputs)-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errOutput = splitOutputs[1:]
if errOutput != nil {
return "", fmt.Errorf("error unmarshalling job JSON %s %s", err.Error(), errOutput)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are getting errors, it means there is something wrong, you also need to trim, I added a similar change recently, here: https://github.com/Lilypad-Tech/lilypad/pull/175/files
Let's make sure we also capture errors if there are errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AquiGorka I've updated to add logging for error output.
@hunjixin Looks like we want splitOutputs[:len(splitOutputs)-1]
(i.e. everything but the last line).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change seem to make things not work.the output in my comment
1 line: error log
1 line: id result
1 line: empty line
this is why add a trim to make sure the empty line is removed
split by \n, 4 lines, with 2 empty line in last
402da7b
to
91a12b4
Compare
91a12b4
to
8e82923
Compare
In discussing with @taoshengshi - if we can get this merged, he can do testing in the morning (china time) with RPs to confirm this unblocks the issue. |
Review Type Requested (choose one):
show error in "bacalhau id" command.
Summary
Provide a one line summary and link to any relevant references
Task/Issue reference
Re: https://github.com/Lilypad-Tech/hni/issues/7
Details (optional)
Add any additional details that might help Code Reviewers digest this PR
How to test this code? (optional)
Anything else? (optional)