#486 — [Bug]: unstable errors about merchant submission violates constraint for fee configs

Repo: Twill-AI/facade State: closed | Status: done Assignee: Unassigned

Created: 2025-08-12 · Updated: 2025-09-15

Description

Steps to reproduce

  1. In staging open OpenAPI UI and login under partner user
  2. Try to submit merchant multiple times with not all fields ready on PE side.

Expected behavior

200 response with PE errors.

Actual behavior

500 with: Error: duplicate key value violates unique constraint "fee_config_name_key" DETAIL: Key (name)=(a12e63ed-59a2-45f8-9705-e808f3428678) already exists.

Investigation details

By logs and db content everything was right until the error.

Second repro was 500 but with different: Error: insert or update on table "merchant" violates foreign key constraint "merchant_fee_config_id_fkey" DETAIL: Key (fee_config_id)=(99) is not present in table "fee_config".

Bad thing is that there is a chance that once error started it is keeping reproducing after - first error was “one time” but the second stays until it is fixed in database.

In [last 24 hours](https://portal.azure.com#@ca84ad29-936a-41a9-a523-35c3760c1302/blade/Microsoft_OperationsManagementSuite_Workspace/Logs.ReactView/resourceId/%2Fsubscriptions%2F9fada0e8-ad9d-4af4-ae3e-c50dadb7296c%2Fresourcegroups%2Frg-staging-twill-eastus%2Fproviders%2Fmicrosoft.operationalinsights%2Fworkspaces%2Fworkspacergstagingtwilleastusad9c/source/LogsBlade.AnalyticsShareLinkToQuery/q/H4sIAAAAAAAAA2WOvQ7CMAyEd54i6kylLowZUAaEVBgQYo2s1E2N8lPVgS48PGlBpRIePPi7852KIQEFHPZ9r2Lg6LCOlrWqNy8xdjigUCvJGTxqFlKKwkDJCSwF

Notes

Add implementation notes, blockers, and context here

Add wikilinks to related people, meetings, or other tickets