View Issue Details

IDProjectCategoryView StatusLast Update
0011082Talermerchant backendpublic2026-02-15 17:34
ReporterBohdan Assigned ToFlorian Dold  
PriorityhighSeveritycrashReproducibilityalways
Status assignedResolutionopen 
Product Versiongit (master) 
Target Version1.5 
Summary0011082: Products endpoint is broken
DescriptionFor some reason, when someone tries to create new product in taler-ops.ch or in latest master sandcastle, it will inevitably fail with next error:

{
  "error": {
    "errorDetail": {
      "code": 7005,
      "when": {
        "t_ms": 1771170089012
      },
      "hint": "Unexpected HTTP status 500 in response",
      "requestUrl": "https://my.taler-ops.ch/instances/vlada/private/products",
      "requestMethod": "POST",
      "httpStatusCode": 500,
      "errorResponse": {
        "code": 54,
        "hint": "The service encountered an unrecoverable error trying to commit a transaction to the database. The system administrator should check that the database is running and review the service logs."
      }
    }
  },
  "stack": "Error: Unexpected HTTP status 500 in response\n at e.fromDetail (https://my.taler-ops.ch/webui/index.js:12:77972)\n at G (https://my.taler-ops.ch/webui/index.js:12:126635)\n at async Object.call (https://my.taler-ops.ch/webui/index.js:15:139847)",
  "when": {
    "t_ms": 1771170089013
  }
}

Which in fact is next problem:
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: /PGRES_FATAL_ERROR/ERROR: record "new" has no field "price"
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: CONTEXT: PL/pgSQL assignment "resolved_body := replace_placeholder(resolved_body,
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: 'price',
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: NEW.price::TEXT)"
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: PL/pgSQL function handle_inventory_changes() line 44 at assignment
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: SQL statement "INSERT INTO merchant_inventory
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: (merchant_serial
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,product_id
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,product_name
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,description
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,description_i18n
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,unit
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,image
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,image_hash
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,taxes
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,price_array
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,total_stock
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,total_stock_frac
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,allow_fractional_quantity
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,fractional_precision_level
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,address
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,next_restock
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,minimum_age
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,product_group_serial
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,money_pot_serial
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,price_is_net
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ) VALUES (
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: my_merchant_id
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,in_product_id
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,in_product_name
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,in_description
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,in_description_i18n
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,in_unit
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,in_image
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,CASE
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: WHEN (in_image IS NULL) OR (in_image = '')
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: THEN NULL
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ELSE encode(public.digest(convert_to(in_image, 'UTF8'),
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: 'sha256'),
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: 'hex')
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: END
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,in_taxes
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,ina_price_list
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,in_total_stock
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,in_total_stock_frac
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,in_allow_fractional_quantity
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,in_fractional_precision_level
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,in_address
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,in_next_restock
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,in_minimum_age
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,in_product_group_id
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,in_money_pot_id
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ,in_price_is_net
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: )
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: ON CONFLICT (merchant_serial, product_id) DO NOTHING
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: RETURNING product_serial"
Feb 15 13:52:34 eae93764499c taler-merchant-httpd[3486]: PL/pgSQL function merchant_do_insert_product(text,text,text,jsonb,text,text,jsonb,taler_amount_currency[],bigint,integer,boolean,integer,jsonb,bigint,integer,bigint[],text,bigint,bigint,boolean) line 48 at SQL statement
Steps To ReproducePost a product like on the imagel, or your own
TagsNo tags attached.
Attached Files
image.png (58,403 bytes)   
image.png (58,403 bytes)   

Activities

Bohdan

2026-02-15 17:00

developer   ~0027735

The reason why tests are working normally, I guess, is because of the fact that webhooks are not set in the test suite, as a result, this function was never activated, yet it is on taler-ops + sandcastle with webhooks (which my doli thing uses)

Bohdan

2026-02-15 17:33

developer   ~0027736

As of commit 8e4fb784 fixed + tests are added to cover possible issues (inventory changes + webhooks active)

Bohdan

2026-02-15 17:34

developer   ~0027737

Florian, could you please pack and publish this commit?

Issue History

Date Modified Username Field Change
2026-02-15 16:47 Bohdan New Issue
2026-02-15 16:47 Bohdan Status new => assigned
2026-02-15 16:47 Bohdan Assigned To => Bohdan
2026-02-15 16:47 Bohdan File Added: image.png
2026-02-15 17:00 Bohdan Note Added: 0027735
2026-02-15 17:33 Bohdan Note Added: 0027736
2026-02-15 17:33 Bohdan Assigned To Bohdan => Florian Dold
2026-02-15 17:34 Bohdan Note Added: 0027737