View Issue Details

IDProjectCategoryView StatusLast Update
0008913Talermerchant backendpublic2024-07-25 22:11
ReporterFlorian Dold Assigned ToFlorian Dold 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 closedResolutionno change required 
Target Version0.12Fixed in Version0.12 
Summary0008913: merchant backend has empty /transfers response despite non-empty exchange /deposits response from exchange
DescriptionThis seems to happen when the merchant has a different host configured in the payto://x-taler-bank/ URI configured than the actual account in the bank.

It looks like some components ignore the host name in the payto://x-taler-bank URI, while others don't.

That leads to:
* The transfer from the exchange arriving at the merchant's bank account
* The exchange giving a non-empty response to /deposits
* The merchant's /transfers API returning an empty response

While this is a misconfiguration, it would be very difficult to detect in practice, since non of the merchant services log anything about the problem.
Additional Informationfdold-work@sapota ~> curl 'https://exchange.regio-taler.fdold.eu/deposits/3J3708839P48NY8MTV6TK40DXYBWDEFZEVJR43SM35AGAVB1TJ6YJQTHMY45Y52KFW8EE8VH47W40SJ2SQSHECAYJBQ2T2REYSGAE48/ZSDH9R5MR98X779KEECZRFZ92NZRZJYZJRVXQ5HYXVXNS2CHY9D0/0REBC67NDXEMSYC1SSJ76Y8D4QZX7SX8NWV9T6A6Y0H4V0R6VCH61R8999GY2FJ79KTREW9SZ0C09SMA25V95S9MN7G5NYBJNCFMQEG/8KY9S7DAKQV9YKW0HNJRZA36CM8CB0FR5CQV6D73RPGWKWM66DVG?merchant_sig=T5HAGMS3CT62GDMT0QWC6FHWT4PRKCCTSA1K3QS09D95M5X4FXYN3EG6B512Q5BTHTJ9Q1AM33VJAT9TNQ3ZC50FWN2Q80VJT59XR3R'
{
  "wtid": "FNN6RK8JRRMJ30JHMP8JTZPGDPTTRW2D9PPVDB9J09SX4RKN9JA0",
  "execution_time": {
    "t_s": 1717779129
  },
  "coin_contribution": "FLODOS:1",
  "exchange_sig": "188YZWWW1SNHT5H08VGHAPPXG6VWHXMJY1CA9G4W8F8R1KKJY0653X3NT98P9PEG69E3W2JN68B39V3RQE4WRRT6RBYM4NYTF64NA30",
  "exchange_pub": "WJFB76CW0BYJ89SGHPPK4R5ZZQBBM11N25VS2GPNE3S425WGHEGG"
}

fdold-work@sapota ~> curl -H "Authorization: Bearer secret-token:test" https://backend.regio-taler.fdold.eu/private/transfers
{
  "transfers": []
}

fdold-work@sapota ~> curl -H "Authorization: Bearer secret-token:test" https://backend.regio-taler.fdold.eu/private/accounts
{
  "accounts": [
    {
      "payto_uri": "payto://x-taler-bank/bank.regiotaler.fdold.eu/mymerchant?receiver-name=My+Merchant",
      "h_wire": "3J3708839P48NY8MTV6TK40DXYBWDEFZEVJR43SM35AGAVB1TJ6YJQTHMY45Y52KFW8EE8VH47W40SJ2SQSHECAYJBQ2T2REYSGAE48"
    }
  ]
}

fdold-work@sapota ~> curl -u mymerchant:test https://bank.regio-taler.fdold.eu/accounts/mymerchant | jq .
{
  "name": "My Merchant",
  "balance": {
    "amount": "FLODOS:3",
    "credit_debit_indicator": "credit"
  },
  "payto_uri": "payto://x-taler-bank/bank.regio-taler.fdold.eu/mymerchant?receiver-name=My%20Merchant",
  "debit_threshold": "FLODOS:0",
  "contact_data": {
    "email": null,
    "phone": null
  },
  "is_public": true,
  "is_taler_exchange": false,
  "status": "active"
}


# Notice the mismatch:
# At libeufin-bank:
# payto://x-taler-bank/bank.regio-taler.fdold.eu/mymerchant?receiver-name=My%20Merchant"
# vs at the merchant backend (missing dash in hostname)
# payto://x-taler-bank/bank.regiotaler.fdold.eu/mymerchant?receiver-name=My+Merchant
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

Christian Grothoff

2024-06-16 10:46

manager   ~0022616

Are you sure? taler-merchant-wirewatch.c seems to have a warning in line 404 which SHOULD trigger if lookup_transfer failed to find the WTID after insertion returned 0, and insertion should return 0 only if the record either already existed, OR if the account doesn't yet exist. So to me (not having tried to reproduce this), the 404 line seems to log exactly the payto://-URI that would be troublesome.

Florian Dold

2024-06-16 14:33

manager   ~0022619

This was actually based on my misunderstanding of how the merchant's /transfers API works.

Issue History

Date ModifiedUsernameFieldChange
2024-06-07 17:58Florian DoldNew Issue
2024-06-07 17:58Florian DoldStatusnew => assigned
2024-06-07 17:58Florian DoldAssigned To => Christian Grothoff
2024-06-07 17:58Florian DoldAdditional Information Updated
2024-06-07 18:01Florian DoldAdditional Information Updated
2024-06-16 10:46Christian GrothoffNote Added: 0022616
2024-06-16 10:46Christian GrothoffAssigned ToChristian Grothoff => Florian Dold
2024-06-16 10:46Christian GrothoffStatusassigned => feedback
2024-06-16 14:33Florian DoldStatusfeedback => informing
2024-06-16 14:33Florian DoldResolutionopen => no change required
2024-06-16 14:33Florian DoldNote Added: 0022619
2024-07-25 22:11Christian GrothoffFixed in Version => 0.12
2024-07-25 22:11Christian GrothoffStatusinforming => closed
2025-03-22 13:09Christian GrothoffCategorymechant backend => merchant backend