View Issue Details

IDProjectCategoryView StatusLast Update
0009865Talermerchant backendpublic2025-05-10 02:10
ReporterFlorian Dold Assigned ToChristian Grothoff Resolution deadline
ImplementerReviewer 
Release signed byDeployed by 
VerifierCommunicator 
Data protection authority notification requiredNo  
CSIRT notification requiredNo  
Estimated effort (hours)Actual effort (hours)0 
Fast-trackNo
Work packagenone
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Versiongit (master) 
Target Version1.0Fixed in Version1.0 
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.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

Christian Grothoff

2025-05-04 20:37

manager   ~0024761

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

Christian Grothoff

2025-05-08 14:01

manager   ~0024836

Fix committed to master branch.

Christian Grothoff

2025-05-08 14:24

manager   ~0024838

Constraint fixed in f3ae00f1..76cb0387. Also added "merchant." in stored procedure to fix table lookup.

Issue History

Date ModifiedUsernameFieldChange
2025-05-04 20:35Florian DoldNew Issue
2025-05-04 20:37Christian GrothoffNote Added: 0024761
2025-05-04 20:37Christian GrothoffStatusnew => implementing
2025-05-04 20:37Christian GrothoffProduct Version => git (master)
2025-05-08 14:01Christian Grothoff
2025-05-08 14:01Christian GrothoffNote Added: 0024836
2025-05-08 14:01Christian GrothoffAssigned To => Christian Grothoff
2025-05-08 14:01Christian GrothoffStatusimplementing => informing
2025-05-08 14:01Christian GrothoffResolutionopen => fixed
2025-05-08 14:24Christian GrothoffNote Added: 0024838
2025-05-08 14:24Christian GrothoffFixed in Version => 1.0
2025-05-08 14:24Christian GrothoffTarget Version1.1 => 1.0
2025-05-10 02:10Christian GrothoffStatusinforming => closed