BitBoxSwiss / bitbox-wallet-app

The BitBoxApp for desktop and mobile.
https://bitbox.swiss/app
Apache License 2.0
255 stars 86 forks source link

v4.46.0 AppImage no UI #3061

Open nbun opened 11 hours ago

nbun commented 11 hours ago

Running the AppImage (Arch, KDE Wayland) using remote debugging gives the following errors in the console.

screencast.js:1 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'url')
    at b._requestNavigationHistory (screencast.js:1:18111)
screencast.js:1 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'url')
    at b._requestNavigationHistory (screencast.js:1:18111)

The error doesn't appear with v4.45.0. In the relevant function, the error seems to occur because e = {currentIndex = -1, entries: Array(0)}, which is not covered by the return condition.

async _requestNavigationHistory() {
        const e = this._resourceTreeModel ? await this._resourceTreeModel.navigationHistory() : null;
        if (!e)
            return;
        this._historyIndex = e.currentIndex,
        this._historyEntries = e.entries,
        this._navigationBack.disabled = 0 === this._historyIndex,
        this._navigationForward.disabled = this._historyIndex === this._historyEntries.length - 1;
        let t = this._historyEntries[this._historyIndex].url;
        const i = t.match(P);
        i && (t = i[1]),
        E.InspectorFrontendHostInstance.inspectedURLChanged(t),
        this._navigationUrl.value = decodeURI(t)
    }
benma commented 10 hours ago

Thanks. What is the symptom in the app itself, is there a problem loading it? (With and without remote debugging enabled)

Does the error appear on startup or when you navigate somewhere?

nbun commented 10 hours ago

Yes, upon starting the app I get a window with no content besides the white background. Debugging makes no difference in behavior.

benma commented 10 hours ago

What if you launch without remote debugging? screencast.js sounds like a devtool? :thinking:

nbun commented 10 hours ago

It's the same, I only used the debugging mode to search for a possible cause. The app logs the following stdout.

Loading log config from '/home/nbu/.config/bitbox/logging.json'.
Logging into '/home/nbu/.config/bitbox/log.txt' from 'debug'.
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
Sandboxing disabled by user.
qt.webenginecontext: 

GLImplementation: 
Surface Type: OpenGL
Surface Profile: CompatibilityProfile
Surface Version: 4.6
Using Default SG Backend: no
Using Software Dynamic GL: no
Using Angle: no

Init Parameters:
  *  application-name BitBoxApp 
  *  blink-settings preferredColorScheme=1 
  *  browser-subprocess-path /tmp/.mount_BitBoxfqnUC9/libexec/QtWebEngineProcess 
  *  disable-features DnsOverHttpsUpgrade,ConsolidatedMovementXY,InstalledApp,BackgroundFetch,WebOTP,WebPayments,WebUSB,PictureInPicture 
  *  disable-gpu  
  *  disable-speech-api  
  *  enable-features NetworkServiceInProcess,TracingServiceInProcess 
  *  enable-threaded-compositing  
  *  no-sandbox  
nbun commented 10 hours ago

log.txt has the following content

time="2024-11-19T18:23:25+01:00" level=info msg="BITBOXAPP_RENDER=software" group=qt-frontend
time="2024-11-19T18:23:26+01:00" level=info msg="Started Qt application" args="[/home/nbu/Downloads/BitBox-4.46.0-x86_64.AppImage]" group=server
time="2024-11-19T18:23:26+01:00" level=info msg="--------------- Started application --------------" group=server
time="2024-11-19T18:23:26+01:00" level=info msg=environment goarch=amd64 goos=linux group=server version=4.46.0
time="2024-11-19T18:23:26+01:00" level=info msg="Arguments: &{mainDirectoryPath:/home/nbu/.config/bitbox bitbox02DirectoryPath:/home/nbu/.config/bitbox/bitbox02 cacheDirectoryPath:/home/nbu/.config/bitbox/cache notesDirectoryPath:/home/nbu/.config/bitbox/notes appConfigFilename:/home/nbu/.config/bitbox/config.json accountsConfigFilename:/home/nbu/.config/bitbox/accounts.json testing:false regtest:false devservers:false gapLimits:<nil> log:0xc00034e460}" group=arguments
time="2024-11-19T18:23:26+01:00" level=info msg="backend config: {Proxy:{UseProxy:false ProxyAddress:} DeprecatedBitcoinActive:true DeprecatedLitecoinActive:true DeprecatedEthereumActive:true Authentication:false BTC:{ElectrumServers:[btc1.shiftcrypto.io:443:s btc2.shiftcrypto.io:443:s]} TBTC:{ElectrumServers:[tbtc1.shiftcrypto.io:443:s tbtc2.shiftcrypto.io:443:s]} RBTC:{ElectrumServers:[127.0.0.1:52001:p 127.0.0.1:52002:p]} LTC:{ElectrumServers:[ltc1.shiftcrypto.io:443:s ltc2.shiftcrypto.io:443:s]} TLTC:{ElectrumServers:[tltc1.shiftcrypto.io:443:s tltc2.shiftcrypto.io:443:s]} ETH:{DeprecatedActiveERC20Tokens:[]} TETH:{} RETH:{} FiatList:[USD EUR CHF] MainFiat:USD UserLanguage: BtcUnit:default}" group=backend
time="2024-11-19T18:23:26+01:00" level=info msg="frontend config: map[]" group=backend
time="2024-11-19T18:23:26+01:00" level=info msg="ReconfigureHistory: coins=[]; fiats=[\"USD\" \"EUR\" \"CHF\"]" group=rates
time="2024-11-19T18:23:26+01:00" level=error msg=updateLast error="Get \"https://exchangerates.shiftcrypto.io/api/v3/simple/price?ids=bitcoin%2Clitecoin%2Cethereum%2Cbasic-attention-token%2Cdai%2Cchainlink%2Cmaker%2Cusd-coin%2Ctether%2C0x%2Cwrapped-bitcoin%2Cpax-gold&vs_currencies=usd%2Ceur%2Cchf%2Cgbp%2Cjpy%2Ckrw%2Ccny%2Crub%2Ccad%2Caud%2Cils%2Cbtc%2Csgd%2Chkd%2Cbrl%2Cnok%2Csek%2Cpln%2Cczk\": dial tcp: lookup exchangerates.shiftcrypto.io: no such host > github.com/BitBoxSwiss/bitbox-wallet-app/backend/rates.(*RateUpdater).updateLast.func1 > /opt/go/src/github.com/BitBoxSwiss/bitbox-wallet-app/backend/rates/rates.go:283 > github.com/BitBoxSwiss/bitbox-wallet-app/util/ratelimit.(*LimitedCall).Call > /opt/go/src/github.com/BitBoxSwiss/bitbox-wallet-app/util/ratelimit/ratelimit.go:111 > github.com/BitBoxSwiss/bitbox-wallet-app/backend/rates.(*RateUpdater).updateLast > /opt/go/src/github.com/BitBoxSwiss/bitbox-wallet-app/backend/rates/rates.go:278 > github.com/BitBoxSwiss/bitbox-wallet-app/backend/rates.(*RateUpdater).lastUpdateLoop > /opt/go/src/github.com/BitBoxSwiss/bitbox-wallet-app/backend/rates/rates.go:254 > runtime.goexit > /opt/go_dist/go/src/runtime/asm_amd64.s:1700" group=rates

The last entry might be the actual culprit?

benma commented 9 hours ago

No, that last entry is not the culprit.

This might be:

qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""

There seems to be an issue with wayland :thinking: I'll get back to you.

nbun commented 9 hours ago

v4.45.0 works for me while having the same warning.

Loading log config from '/home/nbu/.config/bitbox/logging.json'.
Logging into '/home/nbu/.config/bitbox/log.txt' from 'debug'.
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
Sandboxing disabled by user.

The other stuff beginning with qt.webenginecontext: is not shown, for some reason.

benma commented 9 hours ago

Good to know, thanks. The other stuff is new due to the upgrade of Qt from 5.15 to 6.2

benma commented 9 hours ago

@nbun

could you try extracting the appimage using --appimage-extract? Then launch ./BitBox in the extracted folder.

Also pls let me know the output of ldd ./BitBox

nbun commented 9 hours ago

The window is still empty, ldd gives the following output.

        linux-vdso.so.1 (0x00007ecdbc47f000)
        libserver.so => /home/nbu/Downloads/squashfs-root/./libserver.so (0x00007ecdbb000000)
        libQt6WebEngineWidgets.so.6 => /home/nbu/Downloads/squashfs-root/./lib/libQt6WebEngineWidgets.so.6 (0x00007ecdbc427000)
        libQt6Widgets.so.6 => /home/nbu/Downloads/squashfs-root/./lib/libQt6Widgets.so.6 (0x00007ecdba800000)
        libQt6WebEngineCore.so.6 => /home/nbu/Downloads/squashfs-root/./lib/libQt6WebEngineCore.so.6 (0x00007ecdafc00000)
        libQt6Gui.so.6 => /home/nbu/Downloads/squashfs-root/./lib/libQt6Gui.so.6 (0x00007ecdaf200000)
        libQt6WebChannel.so.6 => /home/nbu/Downloads/squashfs-root/./lib/libQt6WebChannel.so.6 (0x00007ecdbc3e2000)
        libQt6Network.so.6 => /home/nbu/Downloads/squashfs-root/./lib/libQt6Network.so.6 (0x00007ecdba64b000)
        libQt6Core.so.6 => /home/nbu/Downloads/squashfs-root/./lib/libQt6Core.so.6 (0x00007ecdaea00000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007ecdae600000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007ecdbc375000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007ecdae40f000)
        libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007ecdbc36e000)
        librt.so.1 => /usr/lib/librt.so.1 (0x00007ecdbc369000)
        libresolv.so.2 => /usr/lib/libresolv.so.2 (0x00007ecdbc357000)
        /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007ecdbc481000)
        libQt6QuickWidgets.so.6 => /home/nbu/Downloads/squashfs-root/./lib/libQt6QuickWidgets.so.6 (0x00007ecdbc338000)
        libQt6Positioning.so.6 => /home/nbu/Downloads/squashfs-root/./lib/libQt6Positioning.so.6 (0x00007ecdbaf64000)
        libxkbcommon.so.0 => /home/nbu/Downloads/squashfs-root/./lib/libxkbcommon.so.0 (0x00007ecdafbbd000)
        libQt6Quick.so.6 => /home/nbu/Downloads/squashfs-root/./lib/libQt6Quick.so.6 (0x00007ecdadc00000)
        libQt6OpenGL.so.6 => /home/nbu/Downloads/squashfs-root/./lib/libQt6OpenGL.so.6 (0x00007ecdaf160000)
        libQt6QmlModels.so.6 => /home/nbu/Downloads/squashfs-root/./lib/libQt6QmlModels.so.6 (0x00007ecdaf0ad000)
        libQt6Qml.so.6 => /home/nbu/Downloads/squashfs-root/./lib/libQt6Qml.so.6 (0x00007ecdad600000)
        libQt6PrintSupport.so.6 => /home/nbu/Downloads/squashfs-root/./lib/libQt6PrintSupport.so.6 (0x00007ecdae986000)
        libGL.so.1 => /usr/lib/libGL.so.1 (0x00007ecdae900000)
        libm.so.6 => /usr/lib/libm.so.6 (0x00007ecdae320000)
        libdl.so.2 => /usr/lib/libdl.so.2 (0x00007ecdbc32f000)
        libsmime3.so => /home/nbu/Downloads/squashfs-root/./lib/libsmime3.so (0x00007ecdbaf31000)
        libnss3.so => /home/nbu/Downloads/squashfs-root/./lib/libnss3.so (0x00007ecdad49e000)
        libnssutil3.so => /home/nbu/Downloads/squashfs-root/./lib/libnssutil3.so (0x00007ecdafb88000)
        libplds4.so => /home/nbu/Downloads/squashfs-root/./lib/libplds4.so (0x00007ecdbc327000)
        libplc4.so => /home/nbu/Downloads/squashfs-root/./lib/libplc4.so (0x00007ecdbc31f000)
        libnspr4.so => /home/nbu/Downloads/squashfs-root/./lib/libnspr4.so (0x00007ecdaf069000)
        libX11.so.6 => /usr/lib/libX11.so.6 (0x00007ecdad35d000)
        libXcomposite.so.1 => /home/nbu/Downloads/squashfs-root/./lib/libXcomposite.so.1 (0x00007ecdbc317000)
        libXdamage.so.1 => /home/nbu/Downloads/squashfs-root/./lib/libXdamage.so.1 (0x00007ecdbc311000)
        libXext.so.6 => /home/nbu/Downloads/squashfs-root/./lib/libXext.so.6 (0x00007ecdba634000)
        libXfixes.so.3 => /home/nbu/Downloads/squashfs-root/./lib/libXfixes.so.3 (0x00007ecdbc308000)
        libXrender.so.1 => /home/nbu/Downloads/squashfs-root/./lib/libXrender.so.1 (0x00007ecdad000000)
        libXrandr.so.2 => /home/nbu/Downloads/squashfs-root/./lib/libXrandr.so.2 (0x00007ecdba626000)
        libXtst.so.6 => /home/nbu/Downloads/squashfs-root/./lib/libXtst.so.6 (0x00007ecdacc00000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007ecdae256000)
        libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00007ecdafb5e000)
        libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x00007ecdae8b0000)
        libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007ecdadbd5000)
        libasound.so.2 => /usr/lib/libasound.so.2 (0x00007ecdad279000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00007ecdaf050000)
        libdbus-1.so.3 => /home/nbu/Downloads/squashfs-root/./lib/libdbus-1.so.3 (0x00007ecdadb7f000)
        libxshmfence.so.1 => /home/nbu/Downloads/squashfs-root/./lib/libxshmfence.so.1 (0x00007ecdac800000)
        libxkbfile.so.1 => /home/nbu/Downloads/squashfs-root/./lib/libxkbfile.so.1 (0x00007ecdae888000)
        libEGL.so.1 => /usr/lib/libEGL.so.1 (0x00007ecdadb6d000)
        libglib-2.0.so.0 => /home/nbu/Downloads/squashfs-root/./lib/libglib-2.0.so.0 (0x00007ecdacecc000)
        libQt6DBus.so.6 => /home/nbu/Downloads/squashfs-root/./lib/libQt6DBus.so.6 (0x00007ecdacb2e000)
        libgthread-2.0.so.0 => /home/nbu/Downloads/squashfs-root/./lib/libgthread-2.0.so.0 (0x00007ecdbaf25000)
        libgssapi_krb5.so.2 => /home/nbu/Downloads/squashfs-root/./lib/libgssapi_krb5.so.2 (0x00007ecdad229000)
        libicui18n.so.56 => /home/nbu/Downloads/squashfs-root/./lib/libicui18n.so.56 (0x00007ecdac200000)
        libicuuc.so.56 => /home/nbu/Downloads/squashfs-root/./lib/libicuuc.so.56 (0x00007ecdabe00000)
        libicudata.so.56 => /home/nbu/Downloads/squashfs-root/./lib/libicudata.so.56 (0x00007ecdaa400000)
        libGLdispatch.so.0 => /usr/lib/libGLdispatch.so.0 (0x00007ecdace14000)
        libGLX.so.0 => /usr/lib/libGLX.so.0 (0x00007ecdadb3b000)
        libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007ecdad216000)
        libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007ecdacaf3000)
        libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x00007ecdac6e1000)
        libbrotlidec.so.1 => /usr/lib/libbrotlidec.so.1 (0x00007ecdacae4000)
        libXau.so.6 => /usr/lib/libXau.so.6 (0x00007ecdba61d000)
        libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007ecdafb56000)
        libsystemd.so.0 => /home/nbu/Downloads/squashfs-root/./lib/libsystemd.so.0 (0x00007ecdaca30000)
        libpcre.so.3 => /home/nbu/Downloads/squashfs-root/./lib/libpcre.so.3 (0x00007ecdaa38c000)
        libkrb5.so.3 => /home/nbu/Downloads/squashfs-root/./lib/libkrb5.so.3 (0x00007ecdaa2a9000)
        libk5crypto.so.3 => /home/nbu/Downloads/squashfs-root/./lib/libk5crypto.so.3 (0x00007ecdac6af000)
        libcom_err.so.2 => /usr/lib/libcom_err.so.2 (0x00007ecdaf04a000)
        libkrb5support.so.0 => /home/nbu/Downloads/squashfs-root/./lib/libkrb5support.so.0 (0x00007ecdaca20000)
        libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x00007ecdac1de000)
        libbrotlicommon.so.1 => /usr/lib/libbrotlicommon.so.1 (0x00007ecdac1bb000)
        liblzma.so.5 => /home/nbu/Downloads/squashfs-root/./lib/liblzma.so.5 (0x00007ecdaa27f000)
        liblz4.so.1 => /home/nbu/Downloads/squashfs-root/./lib/liblz4.so.1 (0x00007ecdaa25d000)
        libgcrypt.so.20 => /home/nbu/Downloads/squashfs-root/./lib/libgcrypt.so.20 (0x00007ecdaa13d000)
        libkeyutils.so.1 => /home/nbu/Downloads/squashfs-root/./lib/libkeyutils.so.1 (0x00007ecdae24e000)
        libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x00007ecdaa115000)
benma commented 8 hours ago

Hmm, nothing unusual there.

Could you try this build? https://drive.google.com/file/d/1zHb5Cp2Ph6SQHokN8_IZJvlsJw3yvZFw/view?usp=sharing

It's the same but compiled with

view->page()->setDevToolsPage(nullptr); 

in main.cpp. Maybe it works to disable the devtools. The other approach we could try is to update the Qt version.

By the way, we tested the app on X11 and Wayland on Fedora and Ubuntu and Debian and it worked fine everywhere, so your issue is quite puzzling.

nbun commented 7 hours ago

The custom build or switching to X11 didn't help, unfortunately. However, when I run the app as root, it works.

Loading log config from '/root/.config/bitbox/logging.json'.
Logging into '/root/.config/bitbox/log.txt' from 'debug'.
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Sandboxing disabled by user.
qt.webenginecontext: 

GLImplementation: 
Surface Type: OpenGL
Surface Profile: CompatibilityProfile
Surface Version: 4.6
Using Default SG Backend: no
Using Software Dynamic GL: no
Using Angle: no

Init Parameters:
  *  application-name BitBoxApp 
  *  blink-settings preferredColorScheme=1 
  *  browser-subprocess-path /tmp/.mount_BitBoxDtDDmU/libexec/QtWebEngineProcess 
  *  disable-features DnsOverHttpsUpgrade,ConsolidatedMovementXY,InstalledApp,BackgroundFetch,WebOTP,WebPayments,WebUSB,PictureInPicture 
  *  disable-gpu  
  *  disable-speech-api  
  *  enable-features NetworkServiceInProcess,TracingServiceInProcess 
  *  enable-threaded-compositing  
  *  no-sandbox 

The window also opens in a different size compared to running without root. I had assumed that such settings are stored in ~/.config/bitbox (which I've deleted before), but apparently something else is going on. Setting XDG_RUNTIME_DIR to be empty didn't make a difference running as non-root either.

benma commented 7 hours ago

How about trying as a different user other than root?

You could also try moving ./config/bitbox to ./config/bitbox.backup, and see if a fresh data dir fixes it. If so, something got corrupted in there.

nbun commented 7 hours ago

HOME=... ./BitBox... fixes the issue if I use a directory other than my home directory. Weirdly, the issue persists deleting .config/bitbox in my home directory. So some other configuration file must be relevant to this issue.

benma commented 6 hours ago

Very interesting. I was almost certain after your previous post that it's something in the datadir, but apparently not :sweat_smile:

What if you tried renaming these?