View Issue Details

IDProjectCategoryView StatusLast Update
0006014Talermerchant backendpublic2021-08-24 14:23
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 Version0.7.1Fixed in Version0.7.1 
Summary0006014: merchant does not forward errors from the exchange correctly
Description... for example, when the exchange gives the following response:

{
  "error": "insufficient funds",
  "code": 1200,
  "history": []
}

the merchant responds with

{ code: 1006, hint: 'invalid JSON uploaded' }

which is obviously bogus.
Steps To ReproduceDec 25 18:52:17-029247 taler-merchant-httpd-31080(ZXAJ2TFNMQXDVWBXGD6TDR1C60) DEBUG URL for deposit: `https://exchange.test.taler.net/deposit'
Dec 25 18:52:17-226848 taler-merchant-httpd-31080(ZXAJ2TFNMQXDVWBXGD6TDR1C60) DEBUG Downloaded body: {
  "error": "insufficient funds",
  "code": 1200,
  "history": []
}
Dec 25 18:52:17-226892 taler-merchant-httpd-31080(ZXAJ2TFNMQXDVWBXGD6TDR1C60) WARNING External protocol violation detected at exchange_api_common.c:56.
Dec 25 18:52:17-226910 taler-merchant-httpd-31080(ZXAJ2TFNMQXDVWBXGD6TDR1C60) WARNING External protocol violation detected at exchange_api_deposit.c:258.
Dec 25 18:52:17-226926 taler-merchant-httpd-31080(ZXAJ2TFNMQXDVWBXGD6TDR1C60) WARNING External protocol violation detected at exchange_api_deposit.c:334.
Dec 25 18:52:17-226942 taler-merchant-httpd-31080(ZXAJ2TFNMQXDVWBXGD6TDR1C60) WARNING Deposit operation failed with HTTP code 0
Dec 25 18:52:17-226964 taler-merchant-httpd-31080(ZXAJ2TFNMQXDVWBXGD6TDR1C60) DEBUG Aborting pending /deposit operations
Dec 25 18:52:17-235403 taler-merchant-httpd-31080(ZXAJ2TFNMQXDVWBXGD6TDR1C60) DEBUG Resuming /pay handling as exchange interaction is done (0)
Dec 25 18:52:17-235443 taler-merchant-httpd-31080(ZXAJ2TFNMQXDVWBXGD6TDR1C60) INFO Handling request (POST) for URL '/public/pay'
Dec 25 18:52:17-235463 taler-merchant-httpd-31080(ZXAJ2TFNMQXDVWBXGD6TDR1C60) DEBUG Looking for by-id key 2RJWVDTX of 'default' in hashmap
Dec 25 18:52:17-235478 taler-merchant-httpd-31080(ZXAJ2TFNMQXDVWBXGD6TDR1C60) DEBUG In handler for /pay.
Dec 25 18:52:17-235541 taler-merchant-httpd-31080(ZXAJ2TFNMQXDVWBXGD6TDR1C60) DEBUG Adding run_daemon select task
Dec 25 18:52:17-235596 taler-merchant-httpd-31080(ZXAJ2TFNMQXDVWBXGD6TDR1C60) INFO Handling request (POST) for URL '/public/pay'
Dec 25 18:52:17-235617 taler-merchant-httpd-31080(ZXAJ2TFNMQXDVWBXGD6TDR1C60) DEBUG Looking for by-id key 2RJWVDTX of 'default' in hashmap
Dec 25 18:52:17-235631 taler-merchant-httpd-31080(ZXAJ2TFNMQXDVWBXGD6TDR1C60) DEBUG In handler for /pay.
Dec 25 18:52:17-235647 taler-merchant-httpd-31080(ZXAJ2TFNMQXDVWBXGD6TDR1C60) WARNING Failed to parse JSON request body
Dec 25 18:52:17-235675 taler-merchant-httpd-31080(ZXAJ2TFNMQXDVWBXGD6TDR1C60) DEBUG Adding run_daemon select task
Dec 25 18:52:17-235712 taler-merchant-httpd-31080(ZXAJ2TFNMQXDVWBXGD6TDR1C60) DEBUG Adding run_daemon select task
Dec 25 18:52:17-235743 taler-merchant-httpd-31080(ZXAJ2TFNMQXDVWBXGD6TDR1C60) INFO Finished handling request for `/pay' with status 0
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

Christian Grothoff

2020-04-01 21:28

manager   ~0015485

eb494d2..1782ab3 works a bit on better error generation for /pay. Note that this changes where the exchange JSON reply is included, so we do need to update the REST specification for this already!

Christian Grothoff

2020-04-04 15:32

manager   ~0015528

Some changes still required to tip-pickup, then the protocol changes should be done.
We should likely still consider improving the taler_merchant_service.h API to expose the errors to the C client(s), and may also still review doing a better job at returning full replies in taler_exchange_service.h in general.

Christian Grothoff

2020-04-06 18:03

manager   ~0015536

I've modified both the REST and C APIs to now quite systematically return full error details from the exchange.

Issue History

Date ModifiedUsernameFieldChange
2019-12-25 17:59Florian DoldNew Issue
2019-12-25 17:59Florian DoldStatusnew => assigned
2019-12-25 17:59Florian DoldAssigned To => Marcello Stanisci
2019-12-25 18:17Florian DoldAssigned ToMarcello Stanisci => Christian Grothoff
2019-12-25 18:17Florian DoldTarget Version => 0.7.0
2020-03-31 14:15Christian GrothoffProduct Version => git (master)
2020-03-31 14:15Christian GrothoffTarget Version0.7.0 => 0.7.1
2020-04-01 21:28Christian GrothoffNote Added: 0015485
2020-04-04 15:32Christian GrothoffNote Added: 0015528
2020-04-06 18:03Christian GrothoffStatusassigned => informing
2020-04-06 18:03Christian GrothoffResolutionopen => fixed
2020-04-06 18:03Christian GrothoffFixed in Version => 0.7.1
2020-04-06 18:03Christian GrothoffNote Added: 0015536
2021-08-24 14:23Christian GrothoffStatusinforming => closed
2025-03-22 13:09Christian GrothoffCategorymechant backend => merchant backend