Mint: When melt fails there is an sql error attempting to add proofs #391

Closed
opened 2024-10-06 20:24:12 +00:00 by thesimplekid · 1 comment
thesimplekid commented 2024-10-06 20:24:12 +00:00 (Migrated from github.com)

9639e6
2024-10-06T20:13:01.009989Z DEBUG melt:verify_melt_request: cdk::mint::melt: Verified melt quote: b27fe966-5afa-4967-9073-ebb50b869730
2024-10-06T20:13:01.147059Z ERROR melt: cdk_cln: Error attempting to pay invoice: 1e81fe1582cea3def64f6a8ea0dc36c65f2c620c38b478193ee2279e309639e6
2024-10-06T20:13:01.147194Z ERROR melt: cdk_cln: Err(RpcError { code: Some(210), message: "Ran out of routes to try after 1 attempt: see `paystatus`", data: None })
2024-10-06T20:13:01.147263Z ERROR melt: cdk::mint::melt: Error returned attempting to pay: b27fe966-5afa-4967-9073-ebb50b869730 Wrong CLN response
2024-10-06T20:13:01.148733Z  INFO melt: cdk::mint::melt: Lightning payment for quote b27fe966-5afa-4967-9073-ebb50b869730 failed.
2024-10-06T20:13:01.424414Z DEBUG process_swap_request: cdk_sqlite::mint: Attempting to add known proof. Skipping.... SQLX(Database(SqliteError { code: 1555, message: "UNIQUE constraint failed: proof.y" }))

``` 9639e6 2024-10-06T20:13:01.009989Z DEBUG melt:verify_melt_request: cdk::mint::melt: Verified melt quote: b27fe966-5afa-4967-9073-ebb50b869730 2024-10-06T20:13:01.147059Z ERROR melt: cdk_cln: Error attempting to pay invoice: 1e81fe1582cea3def64f6a8ea0dc36c65f2c620c38b478193ee2279e309639e6 2024-10-06T20:13:01.147194Z ERROR melt: cdk_cln: Err(RpcError { code: Some(210), message: "Ran out of routes to try after 1 attempt: see `paystatus`", data: None }) 2024-10-06T20:13:01.147263Z ERROR melt: cdk::mint::melt: Error returned attempting to pay: b27fe966-5afa-4967-9073-ebb50b869730 Wrong CLN response 2024-10-06T20:13:01.148733Z INFO melt: cdk::mint::melt: Lightning payment for quote b27fe966-5afa-4967-9073-ebb50b869730 failed. 2024-10-06T20:13:01.424414Z DEBUG process_swap_request: cdk_sqlite::mint: Attempting to add known proof. Skipping.... SQLX(Database(SqliteError { code: 1555, message: "UNIQUE constraint failed: proof.y" })) ```
crodas commented 2024-10-14 18:36:28 +00:00 (Migrated from github.com)

Is the same proof being added twice? Either ON CONFLICT or UPSERT should be used instead.

I think that ON CONFLICT IGNORE, since errors are not fatal, but take my point with a grain of salt. I still have very little context for the project, but I'm learning more daily.

Is the same proof being added twice? Either [ON CONFLICT](https://sqlite.org/lang_conflict.html) or [UPSERT](https://www.sqlite.org/lang_upsert.html) should be used instead. I think that `ON CONFLICT IGNORE`, since errors are not fatal, but take my point with a grain of salt. I still have very little context for the project, but I'm learning more daily.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cashubtc/cdk#391
No description provided.