View Issue Details

IDProjectCategoryView StatusLast Update
0007148Talermerchant backend API (C)public2022-03-01 15:35
Reportersebasjm Assigned ToChristian Grothoff  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Product Versiongit (master) 
Target Version0.9Fixed in Version0.9 
Summary0007148: crash con kyc check
Descriptionin my current setup, the exchange doesn't have KYC configuration and I have some orders already paid

running a simple query make the merchant-backend crash
curl -H "Authorization: Bearer secret-token:..." localhost:9966/instances/default/private/kyc


more info from the core dump:

Core was generated by `taler-merchant-httpd -l log.merchant -L INFO'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 exchange_check_cb (cls=0x556c478b6a50, ks=0x7fff96b05ca0) at taler-merchant-httpd_private-get-instances-ID-kyc.c:435


I have pushed an integration test test_merchant_kyc.sh but failed to reproduce it, it seems that it is related to the order creation. Please check test_merchant_order_creation.sh which does reproduce the crash.
TagsNo tags attached.

Relationships

related to 0007108 assignedsebasjm add kyc status notification 

Activities

Christian Grothoff

2022-01-19 09:45

manager   ~0018638

Does not crash for me, likely because it first fails to pay:

$ ./test_merchant_order_creation.sh
Testing for jq FOUND
Testing for taler FOUND
Testing for taler-bank-manage FOUND
Testing for taler-wallet-cli FOUND
Generating Taler auditor, exchange and merchant configurations ... OK
Setting up exchange ... OK
Launching taler services ... OK
Waiting for the bank.... OK
Waiting for taler services ..OK
Wait the exchange for gather its keys . OK
Setting up keys ..... OK
Setting up auditor signatures ... OK
First prepare wallet with coins... OK
2022-01-19T08:44:55.178Z taler-wallet-cli.ts INFO operation with wallet finished, stopping
Configuring merchant instance ...OK
Creating order without TOKEN...OK
Checking created order without TOKEN...OK
Creating order without TOKEN and fullfilment URL...OK
Creating order with non-inventory products...OK
Creating product...OK
Creating order with inventory products...OK
Creating order to be paid...OK
Pay first order ... OK (took 4 secs )
order should be paid. got: claimed { "contract_terms": { "amount": "TESTKUDOS:1", "summary": "payme", "products": [ { "description": "product with id 2 and price :15", "description_i18n": {}, "unit": "", "price": "TESTKUDOS:15", "taxes": [], "image": "data:image/png;base64,abcdefg", "quantity": 1 } ], "h_wire": "ZED9BX1CPXWV8T3CWX4KR5XWPGARPKKAWWFBR5A9AD5JVP9YKCRECA0DCBFZRWH80PRWRWVWQ8AR6RPA4F2QZA69Q28BNAW4FR3Y3AR", "wire_method": "x-taler-bank", "order_id": "2022.019-01M5VVVSPJQFE", "timestamp": { "t_s": 1642581895, "t_ms": 1642581895000 }, "refund_deadline": { "t_s": 1642581895, "t_ms": 1642581895000 }, "pay_deadline": { "t_s": 1642581955, "t_ms": 1642581955000 }, "wire_transfer_deadline": { "t_s": 1642581945, "t_ms": 1642581945000 }, "max_wire_fee": "TESTKUDOS:1", "max_fee": "TESTKUDOS:1", "wire_fee_amortization": 1, "merchant_base_url": "http://localhost:9966/", "merchant": { "name": "default", "address": {}, "jurisdiction": {} }, "exchanges": [ { "url": "http://localhost:8081/", "master_pub": "XV9RSNE95NP27CS78X18NX6TMA30TVH0QX9C4FTV0YC62WKQKJ5G" } ], "auditors": [], "merchant_pub": "0DXXS64M2757EV4W7ZN72NMJYHP6T8K8TEEZSCG4T1AEX35ZX43G", "nonce": "ACMD2MHZXGM81Y0VMRJSSQSPS3Y95M63SH7105QC5YDPCHZ0ZY9G" }, "order_status": "claimed" }

I am using the latest wallet-core, exchange and merchant here.

Christian Grothoff

2022-01-19 09:46

manager   ~0018639

Florian: any idea why sebastian can pay and I cannot?

Christian Grothoff

2022-01-19 22:02

manager   ~0018646

I also have a problem with payments in the anastasis.git tests :-(.

sebasjm

2022-01-24 18:30

developer   ~0018651

Could you add here the content of the files wallet-pay1.err and wallet-pay1.log?

I have added the commit hash into the wallet-cli --version and the script is now printing what is running to avoid confusion. This is what I'm getting

./test_merchant_order_creation.sh
Testing for jq FOUND
Testing for taler FOUND
Testing for taler-bank-manage FOUND
Testing for taler-wallet-cli FOUND
Generating Taler auditor, exchange and merchant configurations ... OK
Printing software version...
taler-wallet-cli 0.9.0-dev.2-ec059d42
taler-exchange-httpd v0.8.5-git-0b6ebc61
taler-merchant-httpd v0.8.4-git-152b9b98
 OK
Setting up exchange ... OK
Launching taler services ... OK
Waiting for the bank.... OK
Waiting for taler services ..OK
Wait the exchange for gather its keys . OK
Setting up keys ..... OK
Setting up auditor signatures ... OK
First prepare wallet with coins... OK
2022-01-24T14:43:05.002Z taler-wallet-cli.ts INFO operation with wallet finished, stopping
Configuring merchant instance ...OK
Creating order without TOKEN...OK
Checking created order without TOKEN...OK
Creating order without TOKEN and fullfilment URL...OK
Creating order with non-inventory products...OK
Creating product...OK
Creating order with inventory products...OK
Creating order to be paid...OK
Pay first order ... OK (took 4 secs )
waiting 46 secs for wire transfer
Perform wire transfers ... DONE
Obtaining wire transfer details from bank... OK
Notifying merchant of bogus wire transfer ...OK
Notifying merchant of bogus wire transfer AGAIN ... OK
Notifying merchant of correct wire transfer (conflicting with old data)... OK
Deleting bogus wire transfer ... OK
Notifying merchant of correct wire transfer (now working)... OK
Testing idempotence ... OK
Sending bogus WTID ...OK
Fetching wire transfers ...OK
Fetching wire transfer details of bogus WTID ... OK
Checking order status ... OK
Removing password from account 43 ... OK
Getting information about kyc ...initialize_taler_system.sh: line 47: 237 Segmentation fault (core dumped) taler-merchant-httpd -c $CONF -L DEBUG 2> taler-merchant-httpd.log

Christian Grothoff

2022-03-01 15:28

manager   ~0018755

Last edited: 2022-03-01 15:29

in private-get-instances-ID-kyc.c:

428 case MHD_HTTP_NO_CONTENT: │
│ 429 { │
│ 430 struct GNUNET_TIME_Timestamp now; │
│ 431 enum GNUNET_DB_QueryStatus qs; │
│ 432 │
│ 433 now = GNUNET_TIME_timestamp_get (); │
│ 434 qs = TMH_db->account_kyc_set_status (TMH_db->cls, │
│ >435 kc->mi->settings.id, │
│ 436 &ekr->h_wire, │
│ 437 ekr->exchange_url, │
│ 438 ekr->exchange_kyc_serial, │
│ 439 NULL, │
│ 440 NULL, │
│ 441 now, │
│ 442 true);

kc->mi is NULL => crash.

Christian Grothoff

2022-03-01 15:35

manager   ~0018756

Trivial fix. In b5612a2..79762a9

Issue History

Date Modified Username Field Change
2022-01-19 06:21 sebasjm New Issue
2022-01-19 06:21 sebasjm Status new => assigned
2022-01-19 06:21 sebasjm Assigned To => Christian Grothoff
2022-01-19 09:45 Christian Grothoff Note Added: 0018638
2022-01-19 09:45 Christian Grothoff Assigned To Christian Grothoff => Florian Dold
2022-01-19 09:45 Christian Grothoff Target Version git (master) => 0.9
2022-01-19 09:46 Christian Grothoff Note Added: 0018639
2022-01-19 17:24 sebasjm Relationship added related to 0007108
2022-01-19 22:02 Christian Grothoff Note Added: 0018646
2022-01-24 18:30 sebasjm Note Added: 0018651
2022-02-28 23:52 Christian Grothoff Assigned To Florian Dold => Christian Grothoff
2022-03-01 15:28 Christian Grothoff Note Added: 0018755
2022-03-01 15:29 Christian Grothoff Note Edited: 0018755
2022-03-01 15:35 Christian Grothoff Note Added: 0018756
2022-03-01 15:35 Christian Grothoff Status assigned => resolved
2022-03-01 15:35 Christian Grothoff Resolution open => fixed
2022-03-01 15:35 Christian Grothoff Fixed in Version => 0.9