temporalio / temporal

Temporal service
https://docs.temporal.io
MIT License
11.64k stars 830 forks source link

Improve error message(s) returned when failing to meet database constraints #2252

Open Sushisource opened 2 years ago

Sushisource commented 2 years ago

Is your feature request related to a problem? Please describe. Many of the error messages returned when something can't be done b/c of database schema are very opaque.

In particular, one user ran into this message:

createOrUpdateCurrentExecution failed. Failed to insert into current_executions table. Error: pq: value too long for type character varying(255)

Because their workflow type/name was too long. There are numerous other such failure paths that result in similarly opaque error messages.

Describe the solution you'd like These messages should be actionable by users without understanding the database schema / temporal internals. The solution for this one is relatively easy to guess if you know what's going on here, but if you don't it's pretty impossible to understand.

I can see how this isn't necessarily easy to do since these messages will vary depending on the persistence backend and different backends may have slightly varying constraints, but perhaps some adapter that can interpret errors from the DB and turn them into something actionable is reasonable.

For this particular problem, ideally we'd see something like:

createOrUpdateCurrentExecution failed. The workflow type name is too long. The Postgres backend limits type names to 255 characters.

Describe alternatives you've considered Validation could be done client side but this could easily drift and presents a maintainability/coupling problem.

Additional context Add any other context or screenshots about the feature request here.

yiminc commented 2 years ago

dup of #2122