View Issue Details

IDProjectCategoryView StatusLast Update
0009865Talermerchant backendpublic2025-05-04 22:37
ReporterFlorian Dold Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status confirmedResolutionopen 
Product Versiongit (master) 
Target Version1.1 
Summary0009865: deleting (purging) a merchant instance fails with DB constraints and/or trigger warnings
DescriptionDeletion fails when there are inventory locks.

It *also* sometimes fails in a trigger (see additional information).
Additional InformationMay 04 20:06:15 e3ae7f19a352 taler-merchant-httpd[3282]: (CFSKHFCSH2SVP6E9YM1TZYKYG4) INFO Handling request (DELETE) for URL '/instances/sandbo
x/private'
May 04 20:06:15 e3ae7f19a352 taler-merchant-httpd[3282]: (CFSKHFCSH2SVP6E9YM1TZYKYG4) ERROR Query `purge_instance' failed with result: update o
r delete on table "merchant_inventory" violates foreign key constraint "merchant_inventory_locks_product_serial_fkey" on table "merchant_invent
ory_locks"/Key (product_serial)=(67) is still referenced from table "merchant_inventory_locks"./ERROR: update or delete on table "merchant_inv
entory" violates foreign key constraint "merchant_inventory_locks_product_serial_fkey" on table "merchant_inventory_locks"
May 04 20:06:15 e3ae7f19a352 taler-merchant-httpd[3282]: DETAIL: Key (product_serial)=(67) is still referenced from table "merchant_inventory_
locks".
May 04 20:06:15 e3ae7f19a352 taler-merchant-httpd[3282]: /PGRES_FATAL_ERROR/ERROR: update or delete on table "merchant_inventory" violates for
eign key constraint "merchant_inventory_locks_product_serial_fkey" on table "merchant_inventory_locks"
May 04 20:06:15 e3ae7f19a352 taler-merchant-httpd[3282]: DETAIL: Key (product_serial)=(67) is still referenced from table "merchant_inventory_
locks".
May 04 20:06:15 e3ae7f19a352 taler-merchant-httpd[3282]: (CFSKHFCSH2SVP6E9YM1TZYKYG4) INFO Executing command `NOTIFY XDQM4Z4N0D3GX0H9JEXH70EBC2
T3KY7HC0TJB0Z60D2H781RXR6AG, '''
May 04 20:06:15 e3ae7f19a352 taler-merchant-httpd[3282]: (CFSKHFCSH2SVP6E9YM1TZYKYG4) INFO Request for `/instances/sandbox/private' completed w
ith HTTP status 500 (0)


------

taler-merchant=# delete from merchant.merchant_instances where merchant_id='sandbox';
ERROR: relation "merchant_webhook" does not exist
LINE 6: FROM merchant_webhook
                   ^
QUERY: SELECT webhook_serial,
             merchant_serial,
         url,
         http_method,
         body_template
      FROM merchant_webhook
      WHERE event_type = 'category_deleted'
        AND merchant_serial = my_merchant_serial
CONTEXT: PL/pgSQL function merchant.handle_category_changes() line 104 at FOR over SELECT rows
TagsNo tags attached.

Activities

Christian Grothoff

2025-05-04 22:37

manager   ~0024761

Looks like a CASCADE is missing on some constraints (on DELETE CASCADE)?

Issue History

Date Modified Username Field Change
2025-05-04 22:35 Florian Dold New Issue
2025-05-04 22:37 Christian Grothoff Note Added: 0024761
2025-05-04 22:37 Christian Grothoff Status new => confirmed
2025-05-04 22:37 Christian Grothoff Product Version => git (master)