View Issue Details

IDProjectCategoryView StatusLast Update
0006014Talermechant backendpublic2020-04-06 20:03
ReporterFlorian DoldAssigned ToChristian Grothoff 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
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.

Activities

Christian Grothoff

2020-04-01 23: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 17: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 20: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 Modified Username Field Change
2019-12-25 18:59 Florian Dold New Issue
2019-12-25 18:59 Florian Dold Status new => assigned
2019-12-25 18:59 Florian Dold Assigned To => Marcello Stanisci
2019-12-25 19:17 Florian Dold Assigned To Marcello Stanisci => Christian Grothoff
2019-12-25 19:17 Florian Dold Target Version => 0.7.0
2020-03-31 16:15 Christian Grothoff Product Version => git (master)
2020-03-31 16:15 Christian Grothoff Target Version 0.7.0 => 0.7.1
2020-04-01 23:28 Christian Grothoff Note Added: 0015485
2020-04-04 17:32 Christian Grothoff Note Added: 0015528
2020-04-06 20:03 Christian Grothoff Status assigned => resolved
2020-04-06 20:03 Christian Grothoff Resolution open => fixed
2020-04-06 20:03 Christian Grothoff Fixed in Version => 0.7.1
2020-04-06 20:03 Christian Grothoff Note Added: 0015536