View Issue Details

IDProjectCategoryView StatusLast Update
0008371Talerwallet-corepublic2024-03-07 19:51
ReporterEmmanuel Assigned Tosebasjm Resolution deadline
ImplementerReviewer 
Release signed byDeployed by 
VerifierCommunicator 
Data protection authority notification requiredNo  
CSIRT notification requiredNo  
Estimated effort (hours)Actual effort (hours)0 
Fast-trackNo
Work packagenone
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

Required notifications

Address or linkRemarkAdded byNotifiedActions

Relationships

child of 0008244 closedFlorian Dold final 0.9.4 release acceptance checks 

Activities

sebasjm

2024-02-12 17:33

developer   ~0021257

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

sebasjm

2024-02-12 19: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 20:44

developer   ~0021311

waiting for feedback

Christian Grothoff

2024-02-16 08:05

manager   ~0021317

Emmanuel, can you please try again and provide feedback?

sebasjm

2024-02-16 14: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 14:47

developer   ~0021324

related

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

Christian Grothoff

2024-02-18 12: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 11: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 14: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 17: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 19:47

developer   ~0021417

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

sebasjm

2024-02-21 20: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 16: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 15: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 15:07

developer   ~0021640

6c124075b

Christian Grothoff

2024-03-04 15: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 ModifiedUsernameFieldChange
2024-02-12 12:22EmmanuelNew Issue
2024-02-12 12:22EmmanuelStatusnew => assigned
2024-02-12 12:22EmmanuelAssigned To => Florian Dold
2024-02-12 12:22EmmanuelFile Added: Capture d’écran 2024-02-12 à 10.54.23.png
2024-02-12 15:58Christian GrothoffAssigned ToFlorian Dold => sebasjm
2024-02-12 15:59Christian GrothoffTarget Version => 0.9.4
2024-02-12 17:33sebasjmCategorywallet (WebExtension) => wallet-core
2024-02-12 17:33sebasjmSummaryIn 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 17:33sebasjmDescription Updated
2024-02-12 17:33sebasjmNote Added: 0021257
2024-02-12 17:34sebasjmStatusassigned => acknowledged
2024-02-12 19:14sebasjmNote Added: 0021259
2024-02-15 11:44sebasjmRelationship addedchild of 0008244
2024-02-15 20:44sebasjmStatusacknowledged => feedback
2024-02-15 20:44sebasjmNote Added: 0021311
2024-02-16 08:05Christian GrothoffAssigned Tosebasjm => Emmanuel
2024-02-16 08:05Christian GrothoffNote Added: 0021317
2024-02-16 14:34sebasjmNote Added: 0021323
2024-02-16 14:34sebasjmFile Added: Selection_301.png
2024-02-16 14:34sebasjmFile Added: Selection_302.png
2024-02-16 14:47sebasjmNote Added: 0021324
2024-02-18 12:41Christian GrothoffNote Added: 0021340
2024-02-18 12:41Christian GrothoffAssigned ToEmmanuel => Florian Dold
2024-02-18 12:41Christian GrothoffStatusfeedback => assigned
2024-02-20 11:12Florian DoldNote Added: 0021384
2024-02-20 11:13Florian DoldAssigned ToFlorian Dold => sebasjm
2024-02-20 14:54sebasjmNote Added: 0021385
2024-02-21 17:39sebasjmNote Added: 0021408
2024-02-21 19:47sebasjmNote Added: 0021417
2024-02-21 20:11sebasjmNote Added: 0021424
2024-02-21 20:11sebasjmFile Added: wallet-private-mode-error.txt
2024-03-01 16:52sebasjmNote Added: 0021608
2024-03-04 15:07sebasjmNote Added: 0021639
2024-03-04 15:07sebasjmFile Added: image.png
2024-03-04 15:07sebasjmStatusassigned => informing
2024-03-04 15:07sebasjmResolutionopen => fixed
2024-03-04 15:07sebasjmNote Added: 0021640
2024-03-04 15:53Christian GrothoffNote Added: 0021642
2024-03-07 19:50Christian GrothoffFixed in Version => 0.9.4
2024-03-07 19:51Christian GrothoffStatusinforming => closed