temporalio / temporalio/temporal

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

Open
#2,252 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
23.2k
Forks
1.9k
Avg merge
2d 8h
Merged PRs (30d)
228

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the cited current_executions PostgreSQL failure and cataloging the other persistence errors that produce opaque constraint messages. Define actionable wording for the affected database backends and verify that users can identify the violated constraint without knowing the schema or Temporal internals.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, postgresql
Domain
backend, databases, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.