Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error connecting to JabRef, snap installation #543

Open
cgadal opened this issue Feb 14, 2023 · 11 comments
Open

Error connecting to JabRef, snap installation #543

cgadal opened this issue Feb 14, 2023 · 11 comments

Comments

@cgadal
Copy link

cgadal commented Feb 14, 2023

I am trying to use the Jabref Web Browser extension, but running it lead to the following tab:
image

The web console displays:
image

I did follow the instructions for the snap installation , and ran in the terminal:
snap connect jabref:hostfs-mozilla-native-messaging-jabref

Notes:

  • JabRef is installed via snap
  • I think mozilla was installed by adding their ppa repository, but I'm not sure how to check it [EDIT: wrong, it was installed from snap, see below]

Further informations:

  • Ubuntu 22.04
  • JabRef 5.9--2023-01-08--76253f1a7
  • Linux 5.15.0-60-generic amd64
  • Java 19.0.1
  • JavaFX 19+11
  • JabRef Browser Extension version 2.5
@LyzardKing
Copy link
Collaborator

Newer versions of ubuntu install the firefox snap.
At the moment that isn't supported.
To check you can run snap list and see if firefox is in the list.

There is ongoing work on native-messaging extensions in snap browsers, but I haven't looked at it in a while

@tobiasdiez
Copy link
Member

@LyzardKing thanks for looking at this. Should we add a short comment in the docs that the snap version of Firefox/Chrome? is not supported, and how to detect and fix this?

@LyzardKing
Copy link
Collaborator

Yes, although things have changed, and now native-messaging is supported in the firefox snap, although I haven't looked at how it should work.

@cgadal could you try running this code snippet?
flatpak permission-set webextensions org.jabref.jabref snap.firefox yes

I might have a go at it in the next few days

@cgadal
Copy link
Author

cgadal commented Feb 15, 2023

  • I checked and my firefox indeed comes from snap
  • flatpak permission-set webextensions org.jabref.jabref snap.firefox yes solves the problem !

@LyzardKing
Copy link
Collaborator

@cgadal Thanks for the quick test!
Great to hear it works directly!

@tobiasdiez I'll write this up in the documentation. I might not have time today, but I'll do it this week

LyzardKing added a commit to LyzardKing/user-documentation that referenced this issue Feb 25, 2023
As mentioned in JabRef/JabRef-Browser-Extension#543

This PR adds the information on how to enable the extension in the firefox snap browser (default in Ubuntu)
@da-ekchajzer
Copy link

Hello, thanks for your work !

I followed the instruction with snap (https://docs.jabref.org/collect/jabref-browser-extension#snap) and add the same issue

Error

Exception { name: "NS_ERROR_NOT_IMPLEMENTED", message: "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIAppStartup.secondsSinceLastOSRestart]", result: 2147500033, filename: "resource:///modules/BrowserGlue.sys.mjs", lineNumber: 1596, columnNumber: 0, data: null, stack: "_collectStartupConditionsTelemetry@resource:///modules/BrowserGlue.sys.mjs:1596:9\nBG__onFirstWindowLoaded@resource:///modules/BrowserGlue.sys.mjs:1702:10\nBG_observe@resource:///modules/BrowserGlue.sys.mjs:949:14\n_delayedStartup@chrome://browser/content/browser.js:2177:18\n", location: XPCWrappedNative_NoHelper }
BrowserGlue.sys.mjs:1605:15
TopSitesFeed: Failed to fetch data from Contile server: NetworkError when attempting to fetch resource. TopSitesFeed.jsm:208
TypeError: NetworkError when attempting to fetch resource. ASRouter.jsm:126:13
Structured Ingestion ping failure with error: error 2 PingCentre.jsm:129:15
TopSitesFeed: Failed to fetch data from Contile server: NetworkError when attempting to fetch resource. 5 TopSitesFeed.jsm:208
TypeError: NetworkError when attempting to fetch resource. ASRouter.jsm:126:13
Structured Ingestion ping failure with error: error 2 PingCentre.jsm:129:15
TypeError: NetworkError when attempting to fetch resource. ASRouter.jsm:126:13
Structured Ingestion ping failure with error: error 5 PingCentre.jsm:129:15
TopSitesFeed: Failed to fetch data from Contile server: NetworkError when attempting to fetch resource. TopSitesFeed.jsm:208
TypeError: NetworkError when attempting to fetch resource. ASRouter.jsm:126:13
Structured Ingestion ping failure with error: error 2 PingCentre.jsm:129:15
TopSitesFeed: Failed to fetch data from Contile server: NetworkError when attempting to fetch resource. TopSitesFeed.jsm:208
TypeError: NetworkError when attempting to fetch resource. ASRouter.jsm:126:13
TypeError: NetworkError when attempting to fetch resource. ASRouter.jsm:126:13
Structured Ingestion ping failure with error: error 5 PingCentre.jsm:129:15
<empty string> 22
AbortError: Actor 'ExtensionContent' destroyed before query 'DetectLanguage' was resolved ExtensionCommon.jsm:726
<empty string> 2
TypeError: (destructured parameter) is undefined 2 Grammarly-bg.js:2:1615207
wgc is null ExtensionContent.jsm:1167
<empty string> 2
AbortError: Native application start canceled by user NativeMessaging.jsm:185
OperationError: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Object does not exist at path “/org/freedesktop/portal/desktop/session/1_63/firefox_org_jabref_jabref_1986204212”
TypeError: (destructured parameter) is undefined Grammarly-bg.js:2:1615207

Context

Firefox 110.0 (64-bit)—snap
Ubuntu 22.04.2 LTS

JabRef 5.9--2023-01-08--76253f1a7
Linux 5.19.0-35-generic amd64
Java 19.0.1
JavaFX 19+11

Solution

flatpak permission-set webextensions org.jabref.jabref snap.firefox yes fixed the issue !

If I am not wrong, the documentation update has not been deployed yet ?

@tobiasdiez
Copy link
Member

Yes, the changes are currently only in a private branch: JabRef/user-documentation@main...LyzardKing:user-documentation:patch-9 @LyzardKing did you forgot to open a PR or did you wanted to test this further?

By the way, without the flatpak permission-set do you get the "An unexpected error occurred" message (as in the first post) or something displaying an actual error? The log you showed has "AbortError: Native application start canceled by user NativeMessaging.jsm:185" in it, but I'm not sure if the extension is getting the same level of details (good from a security viewpoint, bad from an user experience viewpoint).

At the very least, I should add a point in the error dialog pointing to the flatpak permission issue. Refs #405

@da-ekchajzer
Copy link

da-ekchajzer commented Mar 9, 2023

Yes, I got the same error page than the first post !

Note that I also had the same error with a Debian package installation. I removed my debian installation to install with snap to apply the flatpak permission-set fix.

I would indeed have appreciated a little mention of the fix in the console ;). Anyway, thanks a lot for your work! Don't hesitate if you want me to do some more tests.

@LyzardKing
Copy link
Collaborator

@tobiasdiez Sorry, I completely forgot.
I'm still testing it for a better solution, but I intended to open the PR.

Siedlerchr pushed a commit to JabRef/user-documentation that referenced this issue Mar 9, 2023
As mentioned in JabRef/JabRef-Browser-Extension#543

This PR adds the information on how to enable the extension in the firefox snap browser (default in Ubuntu)
@tobiasdiez
Copy link
Member

No worries @LyzardKing. Thanks for your continued support in this direction! This is very helpful.

@da-ekchajzer Thanks for the offer. If you have the time, can you have a look at #405 and try to break your installation, and then see if a helpful error message is displayed or not. I don't have a linux system to try this out myself, so I have to rely on the community.

@LyzardKing
Copy link
Collaborator

In theory my idea was to have the error message tell exactly what to do directly, depending on the package format.
I haven't had time to address the issue sufficiently, and I'm not sure it's doable easily.
The main issue is that without applying the flatpak permission-set or the flatpak override the browser has no way of knowing what package format jabref is installed as.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants