flathub / de.willuhn.Jameica

https://flathub.org/apps/details/de.willuhn.Jameica
0 stars 3 forks source link

Scripting plugin from Sebastian Richter generate errors #21

Open webagentur-hartmann opened 1 year ago

webagentur-hartmann commented 1 year ago

Since the last update of the flatpak, where we removed system access to d-bus, the scripting plugin from Sebastian Richter works no longer. The rest of the application, including HBCI transfers in Hibiscus work fine.

It seems that the underlying Eclipse framework has no access to requested functions of the headless browser, so it is not able to log in to the websites.

Braintoe commented 1 year ago

It took me weeks to find out the reason for this error, so here is the error message that is generated that others may find it without having to know in advance that the Flatpak version of jameica is the culprit:

Exception bei Auth.Login! Fehlernachricht: Barclays-Visa-Login fehlgeschlagen! org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.RuntimeException: org.eclipse.swt.SWTError: No more handles because there is no underlying browser available. Please ensure that WebKit with its GTK 3.x bindings is installed (WebKit2 API level is preferred). Additionally, please note that GTK4 does not currently have Browser support.

You may find the complete message log of Hibiscus in Sebastian's forum: https://scripting-forum.derrichter.de/viewtopic.php?f=34&t=1138#p7677

Edit: While my skills are not good enough to help solving the issue, I will be happy to support when it comes to testing if that helps.

tobias-hammerschmidt commented 1 year ago

Full log for reference:

[12.12.2022 17:26:07] Synchronisierung via non-HBCI (Hibiscus Mashup) läuft
[12.12.2022 17:26:07]  
[12.12.2022 17:26:07] System-Info: OS[Linux (ver. 5.15.0-56-generic) amd64]  Platform[Jameica 2.10.2 | Build: 484 vom 20220503]  Plugin[hibiscus 2.10.9 | Build: 371 vom 20221114]
[12.12.2022 17:26:07] Installierte und aktive Plugin-Versionen: [Finance.Websync ver. 0.9.49-nightly | Build: 904 vom 20221210] [Hibiscus Mashup ver. 0.9.29-nightly | Build: 527 vom 20221202]
[12.12.2022 17:26:07] Überprüfe Jameica-Version ...
[12.12.2022 17:26:07] OK: Jameica-Version 2.10.2 installiert und aktiv
[12.12.2022 17:26:07] Überprüfe Java-Version und den verwendeten Zeichensatz ...
[12.12.2022 17:26:07] OK: Java-Version 17.0.4.1 von 'Flathub' installiert, aktiv und verwendet Zeichensatz 'UTF-8' (Home: /app/jre)
[12.12.2022 17:26:07] Überprüfe Selenium-Version ...
[12.12.2022 17:26:07] OK: Selenium-Version 4.6.0 installiert und aktiv
[12.12.2022 17:26:07] Überprüfe ChromeDriver-Version ...
[12.12.2022 17:26:07] OK: ChromeDriver-Version 108.0.5359.71 installiert und aktiv
[12.12.2022 17:26:07] Überprüfe POI-Version ...
[12.12.2022 17:26:07] OK: POI-Version 5.2.2 installiert und aktiv
[12.12.2022 17:26:07]  
[12.12.2022 17:26:07] Synchronisiere Konto 'Barclaycard, IBAN DEXXXX..XXXXXX [Barclays Ba...urg Branch]' ...
[12.12.2022 17:26:07] Selenium WebDriver über ChromeDriver wird gestartet ...
[12.12.2022 17:26:08] -> Erst-Initialisierung des WebDriver nicht erfolgreich, der Start dauert daher länger:
[12.12.2022 17:26:08] -> Sie verwenden bereits den alternativen Chromium-Browser. Info: Google Chrome beschleunigt den WebDriver-Start!
[12.12.2022 17:26:08] Sicherheits-Check der Integrität des alternativen Chromium-Browser gegen Manipulation ...
[12.12.2022 17:26:09] OK. Ergebnis der Berechnung: CFEB79CA0A3DF77AB5E8F8F671186E23 (Dauer: 1 Sek.)
[12.12.2022 17:26:10] Überprüfe Chromium-Version ...
[12.12.2022 17:26:10] OK. Browser ist: chrome ver. 108
[12.12.2022 17:26:12] Web-Login mit Selenium-WebDriver-Engine mit Anmeldekennung XXXX******* auf https://banking.barclaycard.de ...
[12.12.2022 17:26:12] Fehler: Exception bei Auth.Login! Fehlernachricht: Barclays-Visa-Login fehlgeschlagen! org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.RuntimeException: org.eclipse.swt.SWTError: No more handles because there is no underlying browser available.
Please ensure that WebKit with its GTK 3.x bindings is installed (WebKit2 API level is preferred). Additionally, please note that GTK4 does not currently have Browser support.
)
    at org.eclipse.swt.SWT.error(SWT.java:4893)
    at org.eclipse.swt.SWT.error(SWT.java:4808)
    at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:262)
    at org.eclipse.swt.widgets.Display.syncExec(Display.java:5996)
    at de.derrichter.hibiscus.mashup.gui.dialogs.AbstractDialog.open(AbstractDialog.java:550)
    at de.derrichter.hibiscus.mashup.crossover.callback.WebDialogs.askPIN(WebDialogs.java:373)
    at de.derrichter.hibiscus.mashup.crossover.interact.Auth.getPasswort(Auth.java:112)
    at de.derrichter.hibiscus.mashup.crossover.interact.Auth.seleniumLogin(Auth.java:342)
    at de.derrichter.hibiscus.mashup.crossover.websync.institute.barclaysvisa.Collector.run(Collector.java:167)
    at de.derrichter.hibiscus.mashup.crossover.websync.WebSynchronizeJobKontoauszug.execute(WebSynchronizeJobKontoauszug.java:84)
    at de.derrichter.hibiscus.mashup.crossover.websync.WebSynchronizeBackend$WebSyncJobGroup.sync(WebSynchronizeBackend.java:854)
    at de.willuhn.jameica.hbci.synchronize.AbstractSynchronizeBackend$Worker.run(AbstractSynchronizeBackend.java:399)
    at de.willuhn.jameica.gui.GUI$7.run(GUI.java:1081)
Caused by: java.lang.RuntimeException: org.eclipse.swt.SWTError: No more handles because there is no underlying browser available.
Please ensure that WebKit with its GTK 3.x bindings is installed (WebKit2 API level is preferred). Additionally, please note that GTK4 does not currently have Browser support.

    at de.derrichter.hibiscus.mashup.gui.dialogs.AbstractDialog$4.run(AbstractDialog.java:564)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:5096)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4602)
    at de.willuhn.jameica.gui.GUI.loop(GUI.java:928)
    at de.willuhn.jameica.gui.GUI.init(GUI.java:331)
    at de.willuhn.jameica.system.Application.init(Application.java:145)
    at de.willuhn.jameica.system.Application.newInstance(Application.java:87)
    at de.willuhn.jameica.Main.main(Main.java:78)
Caused by: org.eclipse.swt.SWTError: No more handles because there is no underlying browser available.
Please ensure that WebKit with its GTK 3.x bindings is installed (WebKit2 API level is preferred). Additionally, please note that GTK4 does not currently have Browser support.

    at org.eclipse.swt.SWT.error(SWT.java:4919)
    at org.eclipse.swt.browser.Browser.<init>(Browser.java:120)
    at de.derrichter.hibiscus.mashup.gui.dialogs.security.PasswordDialog.paint(PasswordDialog.java:326)
    at de.derrichter.hibiscus.mashup.gui.dialogs.security.PinDialog.paint(PinDialog.java:129)
    at de.derrichter.hibiscus.mashup.gui.dialogs.AbstractDialog$4.run(AbstractDialog.java:560)
    ... 9 more
tobias-hammerschmidt commented 1 year ago

Related code change: https://github.com/flathub/de.willuhn.Jameica/commit/0a2ecf2c8ff75ed8d527905c39005b3179974624

tobias-hammerschmidt commented 1 year ago

Webkitgtk seems to be removed in gnome-platform 43 (compare https://gitlab.gnome.org/GNOME/gnome-build-meta/-/tree/gnome-42/files to https://gitlab.gnome.org/GNOME/gnome-build-meta/-/tree/gnome-43/files). Rolling back to gnome-platform 42 should fix the issue for now.

Braintoe commented 1 year ago

Thanks a lot for preparing a fix!

I tried to install the test build noted in the issue to test it but got:

Can't load uri https://dl.flathub.org/build-repo/129089/de.willuhn.Jameica.flatpakref: Server returned status 404: Not Found

Am I missing something?

tobias-hammerschmidt commented 1 year ago

Regarding webkitgtk I'm maybe on the wrong track since the missing folder mentioned in the comment above is only about some build patches. Nevertheless I'm going to merge the rollback to gnome platform 42 so we can narrow the source of the issue. If the issue persists after the rollback it has to be related to the dbus access changes and we have to dig deeper a bit.

tobias-hammerschmidt commented 1 year ago

@Braintoe Please check once the build has been published to flathub.

Braintoe commented 1 year ago

Good news: Flathub just offered me the new build - and the scripting plugin works again with it. @tobias-hammerschmidt Thank you! :-)

The only error I still get (after sync is completed) is:

[ERROR][bg-task:Worker][de.derrichter.hibiscus.mashup.crossover.callback.WebLogger.error] [SeleniumUtils] WebDriver Task-Kill fehlgeschlagen! Stacktrace: java.io.IOException: Cannot run program "killall": error=2, Datei oder Verzeichnis nicht gefunden

This tells me the Mashup script fails to kill the headless chromium browser which might be a security risk. But I do not know (yet) if this is caused by Flathub or if I should contact Sebastian Richter about this.

tobias-hammerschmidt commented 1 year ago

I think the mentioned remaining issue is caused by the flathub sandbox which most likely doesn't include the killall command. I don't know how the scripting plugin is implemented - maybe there is an alternative method for cleaning up the started processes?