View Issue Details

IDProjectCategoryView StatusLast Update
0006687libeufinnexuspublic2021-01-15 16:59
ReporterFlorian Dold Assigned ToMS  
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Summary0006687: fetch-accounts crashes with constraint violation on repeated use
Description$ libeufin-cli connections download-bank-accounts myconnection
=> works first time
$ libeufin-cli connections download-bank-accounts myconnection
=> results in error

16:45:18.927 [nioEventLoopGroup-4-3] ERROR tech.libeufin.nexus - org.jetbrains.exposed.exceptions.ExposedSQLException: org.sqlite.SQLiteException: [SQLITE_CONSTRAINT] Abort due to constraint violation (UNIQUE constraint failed: OfferedBankAccounts.offeredAccountId, OfferedBankAccounts.bankConnection)
SQL: [INSERT INTO OfferedBankAccounts (bankCode, bankConnection, holderName, iban, imported, offeredAccountId) VALUES (?, ?, ?, ?, ?, ?)]
TagsNo tags attached.

Activities

MS

2021-01-15 11:22

manager   ~0017348

Yes, every bank connection can store information about a particular bank account only once in the database. While I agree that this is a soft error, I would avoid adding more checks before storing something in the database. Downloading a bank account twice is a rare event, as opposed - for example - to downloading a bank *transaction* twice.

Florian Dold

2021-01-15 11:58

manager   ~0017350

The check should be done as part of the transaction that inserts the offered bank account. There's no reason to let a constraint violation exception happen here. It's bad user experience and might hide other errors.

Florian Dold

2021-01-15 11:58

manager   ~0017351

Also, I wouldn't say that it's uncommon to run this command twice, especially if you're working through the setup howto!

MS

2021-01-15 16:59

manager   ~0017354

Discussed privately, fixed here: 159225a..1ce76c5

Issue History

Date Modified Username Field Change
2021-01-11 16:50 Florian Dold New Issue
2021-01-11 16:50 Florian Dold Assigned To => MS
2021-01-11 16:50 Florian Dold Status new => assigned
2021-01-15 11:22 MS Note Added: 0017348
2021-01-15 11:58 Florian Dold Note Added: 0017350
2021-01-15 11:58 Florian Dold Note Added: 0017351
2021-01-15 16:59 MS Note Added: 0017354
2021-01-15 16:59 MS Status assigned => resolved
2021-01-15 16:59 MS Resolution open => fixed