Clarify grpc errors for missing source collection#802
Conversation
| } | ||
|
|
||
| if strings.Contains(errLog, "rpc error") { | ||
| errLog = clarifyGrpcErrors(errLog) |
There was a problem hiding this comment.
any chance stdout would be helpful here?
There was a problem hiding this comment.
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.
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"
jayjayjpg
left a comment
There was a problem hiding this comment.
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 ✅
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