network
network copied to clipboard
Improve error observability of RPC calls
Preflight checklist
- [X] I could not find a solution in the existing issues, docs, nor discussions.
- [X] I agree to follow this project's Code of Conduct.
- [X] I have read and am following this repository's Contribution Guidelines.
- [X] This issue affects my Ory Cloud project.
- [ ] I have joined the Ory Community Slack.
- [ ] I am signed up to the Ory Security Patch Newsletter.
Describe your problem
Currently, it is not possible to understand why things fail in certain cases. A good example are custom SMTP servers. Figuring out what exactly the parameters are is no easy feat, as there are different security mechanisms (TLS, SMTPS, SMTP without any encryption, ...).
When you have access to the log, that is easy as you'll see error messages like:
{"audience":"application","error":{"message":"tls: first record does not look like a TLS handshake","stack_trace":"stack trace could not be recovered from error type tls.RecordHeaderError"},"file":"/go/pkg/mod/github.com/ory/[email protected]/courier/smtp.go:201","func":"github.com/ory/kratos/courier.(*courier).dispatchEmail","level":"error","message_from":"[email protected]","msg":"Unable to send email using SMTP connection.","service_name":"Ory Kratos","service_version":"master","smtp_server":"smtp.postmarkapp.com:587","smtp_ssl_enabled":true,"time":"2022-07-07T09:47:15Z"}
Describe your ideal solution
It should be possible to see logs related to your project in the console / API.
Workarounds or alternatives
None
Additional Context
This user had significant problems figuring out what is going on and why emails are not being sent: https://ory-community.slack.com/archives/C02MR4DEEGH/p1657187128273789
I had to go into k8s and look up the logs for the courier to help him...