View Issue Details

IDProjectCategoryView StatusLast Update
0008371Talerwallet-corepublic2024-03-07 20:51
ReporterEmmanuel Assigned Tosebasjm  
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionfixed 
PlatformMacOSOSX OS Version13.6.3 (22G436)
Product Version0.9.3 
Target Version0.9.4Fixed in Version0.9.4 
Summary0008371: problem opening DB in Firefox 122.0.1 on OS-X
Descriptionoriginal title: In the Browser wallet (Firefox 122.0.1 on OS-X) I can not get the balance

When I want to access to the balance, I got this message :

Could not load the balance
Wallet operation "getBalances" failed
wrap text
  
copy content
  
less info

{
  "context": [],
  "cause": {
    "details": {
      "code": 7011,
      "when": {
        "t_ms": 1707739541632
      },
      "hint": "wallet core not available"
    }
  }
}
Steps To ReproduceI go inside the browser, click on the extension, click on Balance, "Voila".
Additional InformationAs an attachement, you see inside the debugger, an error message about the database.
I installed a new fresh profile on the same browser and the same action works fine.
TagsNo tags attached.
Attached Files

Relationships

child of 0008244 closedFlorian Dold final 0.9.4 release acceptance checks 

Activities

sebasjm

2024-02-12 18:33

developer   ~0021257

moving to wallet-core, i will add more logging to know what's happening

sebasjm

2024-02-12 20:14

developer   ~0021259

86194c614

 * adds more log in wallet core when database open fails
 * uses the standard cause field https://developer.mozilla.org/es/docs/Web/JavaScript/Reference/Global_Objects/Error/cause
 * enhance Error.toString to print cause information in logs
 * save walletInit failure to printout in UI

we need to also implement a logging feature to export logs

sebasjm

2024-02-15 21:44

developer   ~0021311

waiting for feedback

Christian Grothoff

2024-02-16 09:05

manager   ~0021317

Emmanuel, can you please try again and provide feedback?

sebasjm

2024-02-16 15:34

developer   ~0021323

From the feedback, the error is

      "hint": "wallet core not available, last error: Error: database opening error\n Caused by: InvalidStateError: A mutation operation was attempted on a database that did not allow mutations."

We have seen this already in https://bugs.gnunet.org/view.php?id=7777

I was not able to produce this in firefox 123 (current latest) nor in 115 (my current) and 104 (the oldest i have) BUT in 122 there is a new option "always use private browsing mode" which funny enough it is not present in the latest version.

IF i'm using 122 and have this options turned on then I can reproduce the issue.
This also explain why a new profile fix the problem (the options is off by default).

Seems like a firefox problem, upgrading to 123 may help.
Selection_301.png (27,252 bytes)   
Selection_301.png (27,252 bytes)   
Selection_302.png (15,429 bytes)   
Selection_302.png (15,429 bytes)   

sebasjm

2024-02-16 15:47

developer   ~0021324

related

https://bugzilla.mozilla.org/show_bug.cgi?id=1427986

Christian Grothoff

2024-02-18 13:41

manager   ~0021340

Can we please show a proper error message? Like I think wallet-core should *start* (not fail hard), and then the first API call to wallet-core (that usually returns the version data!) needs to return a nice "private browsing mode firefox buggy database access denied" error message. The GUI should then just render the error message (whatever it is).

So wallet-core needs to
1) be modified to not exit, even on fatal errors
2) be extended with a general 'fatal error' protocol message to be returned to the GUIs

Right?

Florian Dold

2024-02-20 12:12

manager   ~0021384

Even right now, wallet-core does not "exit" on fatal errors. When any wallet-core request fails, the error is returned to the caller via an error notification. If any task fails, the result is stored in the DB (at least an attempt is made ...) and we re-try.

However in this situation, it looks like wallet-core isn't even responding to the "init" call. Sebastian, can you check why this is happening?

sebasjm

2024-02-20 15:54

developer   ~0021385

"the body cannot live without the mind" said in a famous movie, and here "wallet cannot live without a database"

initWallet is already doing database write op assuming database is ready and healthy, it needs to check and return a taler error code if there is not database, or the database is read only.

seems like the "permanent private browsing" mode in firefox will fall under "can't access to database" type

sebasjm

2024-02-21 18:39

developer   ~0021408

wallet core added more info when db is not ready

commit 8dcdcb9a7df3838e2b3ba4ef2d50e22126709ec6 (HEAD -> master, origin/master, origin/HEAD)
Author: Florian Dold <florian@dold.me>
Date: Tue Feb 20 19:57:11 2024 +0100

    wallet-core: better error handling for DB issues in init request

sebasjm

2024-02-21 20:47

developer   ~0021417

not enough, wallet breaks before trying to write... i'm still getting 7011 (wallet unavailable)

sebasjm

2024-02-21 21:11

developer   ~0021424

looks like the problems is in ensureWalletDbOpen, i will add an catch there
wallet-private-mode-error.txt (1,135 bytes)   
Uncaught (in promise) Error: database opening error
    onerror query.js:147
    openDatabase query.js:146
    openDatabase query.js:144
    openTalerDatabase db.js:758
    __async background.js:61
    __async background.js:45
    openTalerDatabase db.js:757
    ensureWalletDbOpen wallet.js:1034
    __async background.js:61
    __async background.js:45
    ensureWalletDbOpen wallet.js:1027
    handleCoreApiRequest wallet.js:974
    __async background.js:61
    __async background.js:45
    handleCoreApiRequest wallet.js:973
    reinitWallet wxBackend.ts:212
    fulfilled background.js:48
    promise callback*step background.js:60
    fulfilled background.js:48
    promise callback*step background.js:60
    __async background.js:61
    __async background.js:45
    reinitWallet wxBackend.ts:176
    wxMain wxBackend.ts:237
    __async background.js:61
    __async background.js:45
    wxMain wxBackend.ts:235
    start background.ts:13
    fulfilled background.js:48
    promise callback*step background.js:60
    __async background.js:61
    __async background.js:45
    start background.ts:11
    <anonymous> background.ts:15
wallet-private-mode-error.txt (1,135 bytes)   

sebasjm

2024-03-01 17:52

developer   ~0021608

now this can be reproduce with

FIREFOX_PATH=/path/to/firefox/122.0.1 pnpm test:firefox-private

sebasjm

2024-03-04 16:07

developer   ~0021639

now error is propagated and UI catch it.

if the problem is DB_UNAVAILABLE the shown message is "Could not open the wallet database"
but if this happen in firefox and private mode the next error will be shown
image.png (25,706 bytes)   
image.png (25,706 bytes)   

sebasjm

2024-03-04 16:07

developer   ~0021640

6c124075b

Christian Grothoff

2024-03-04 16:53

manager   ~0021642

Are you showing just an incomprehensible error, or did you
1) either figure out how to make it work despite FF in private mode, or
2) are giving a *good* actionable error message that users can work with and fix the issue?

Because merely propagating the error isn't quite fully addressing the specific issue...

Issue History

Date Modified Username Field Change
2024-02-12 13:22 Emmanuel New Issue
2024-02-12 13:22 Emmanuel Status new => assigned
2024-02-12 13:22 Emmanuel Assigned To => Florian Dold
2024-02-12 13:22 Emmanuel File Added: Capture d’écran 2024-02-12 à 10.54.23.png
2024-02-12 16:58 Christian Grothoff Assigned To Florian Dold => sebasjm
2024-02-12 16:59 Christian Grothoff Target Version => 0.9.4
2024-02-12 18:33 sebasjm Category wallet (WebExtension) => wallet-core
2024-02-12 18:33 sebasjm Summary In the Browser wallet (Firefox 122.0.1 on OS-X) I can not get the balance => problem opening DB in Firefox 122.0.1 on OS-X
2024-02-12 18:33 sebasjm Description Updated
2024-02-12 18:33 sebasjm Note Added: 0021257
2024-02-12 18:34 sebasjm Status assigned => acknowledged
2024-02-12 20:14 sebasjm Note Added: 0021259
2024-02-15 12:44 sebasjm Relationship added child of 0008244
2024-02-15 21:44 sebasjm Status acknowledged => feedback
2024-02-15 21:44 sebasjm Note Added: 0021311
2024-02-16 09:05 Christian Grothoff Assigned To sebasjm => Emmanuel
2024-02-16 09:05 Christian Grothoff Note Added: 0021317
2024-02-16 15:34 sebasjm Note Added: 0021323
2024-02-16 15:34 sebasjm File Added: Selection_301.png
2024-02-16 15:34 sebasjm File Added: Selection_302.png
2024-02-16 15:47 sebasjm Note Added: 0021324
2024-02-18 13:41 Christian Grothoff Note Added: 0021340
2024-02-18 13:41 Christian Grothoff Assigned To Emmanuel => Florian Dold
2024-02-18 13:41 Christian Grothoff Status feedback => assigned
2024-02-20 12:12 Florian Dold Note Added: 0021384
2024-02-20 12:13 Florian Dold Assigned To Florian Dold => sebasjm
2024-02-20 15:54 sebasjm Note Added: 0021385
2024-02-21 18:39 sebasjm Note Added: 0021408
2024-02-21 20:47 sebasjm Note Added: 0021417
2024-02-21 21:11 sebasjm Note Added: 0021424
2024-02-21 21:11 sebasjm File Added: wallet-private-mode-error.txt
2024-03-01 17:52 sebasjm Note Added: 0021608
2024-03-04 16:07 sebasjm Note Added: 0021639
2024-03-04 16:07 sebasjm File Added: image.png
2024-03-04 16:07 sebasjm Status assigned => resolved
2024-03-04 16:07 sebasjm Resolution open => fixed
2024-03-04 16:07 sebasjm Note Added: 0021640
2024-03-04 16:53 Christian Grothoff Note Added: 0021642
2024-03-07 20:50 Christian Grothoff Fixed in Version => 0.9.4
2024-03-07 20:51 Christian Grothoff Status resolved => closed