-
Notifications
You must be signed in to change notification settings - Fork 5
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
Clarify grpc errors for missing source collection #802
Clarify grpc errors for missing source collection #802
Conversation
@@ -214,6 +221,11 @@ func RunCmdWithErrorDetection(_ context.Context, cmd *exec.Cmd, _ log.Logger) (s | |||
if stdOutMsg != "" { | |||
errLog = stdOutMsg + errLog | |||
} | |||
|
|||
if strings.Contains(errLog, "rpc error") { | |||
errLog = clarifyGrpcErrors(errLog) |
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.
any chance stdout would be helpful here?
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.
the entirety of stdout for this error is the grpc error. So we could:
- include the grpc error along with this clarified, actionable error (in case that stdout is useful for a different, concurrent issue)
- trim the grpc error from stdout, and add it to the actionable error
- replace stdout entirely with this clarified error (current approach)
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.
ok, I landed on a middle-ground solution that gives us some flexibility. I added a log.Debug()
above when we are doing this replacing. that way, if we are debugging, we still have visibility into the full stdout, without adding more error-specific logic.
with --debug
:
~/go/src/notion-s3 main
❯ ../cli/meroxa apps deploy --debug
Validating your app.json...
✔ Checked your language is "golang"
✔ Checked your application name is "notion-s3"
Checking for uncommitted changes...
✔ No uncommitted changes!
<redacted prior steps for conciseness>
2023/08/08 15:19:27 rpc error: code = Unknown desc = invalid ProcessCollectionRequest.Collection: embedded message failed validation | caused by: invalid Collection.Name: value length must be at least 1 runes
exit status 1
Error: missing source or source collection, please ensure that you have configured your source correctly:
https://docs.meroxa.com/turbine/troubleshooting#troubleshooting-checklist"
without --debug
:
~/go/src/notion-s3 main
❯ ../cli/meroxa apps deploy
Validating your app.json...
✔ Checked your language is "golang"
✔ Checked your application name is "notion-s3"
Checking for uncommitted changes...
✔ No uncommitted changes!
Error: missing source or source collection, please ensure that you have configured your source correctly:
https://docs.meroxa.com/turbine/troubleshooting#troubleshooting-checklist"
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.
Thank you for the super quick iteration on this! I just left one more clarifying question on the error output since I'm not super familiar with the implementation myself -- if this is intended, feel free to ask me for another review and I can ✅
Co-authored-by: Janelle Tavares <janelletavares@users.noreply.github.com>
Description of change
Adds more clarity to gRPC errors from turbine-core when an app has no sources defined.
Fixes https://github.com/meroxa/product/issues/936
Type of change
How was this tested?
Demo
Before
After
Documentation updated
Will need to make an adjustment to the docs before merging this PR, to link directly to the new high-level troubleshooting checklist: https://github.com/meroxa/meroxa-docs/pull/431