Closed jgaztelu closed 8 months ago
I also had this from time to time but can no longer reproduce it (with JabRef v5.7). Can you please run the following in powershell
& 'C:\Program Files\JabRef\runtime\bin\JabRef.bat' -importToOpen "<path to a bib file>"
and then afterwards $LASTEXITCODE
and $?
while JabRef is running. For me this looks like
Moreover, once you get the error again, could you please have a look at the browser console (Ctrl + Shift + J) and the web console (Ctrl + Shift + K) and copy what you see there. Thanks!
I am having a similiar error - when running your command, this is my output:
& 'C:\Program Files\JabRef\runtime\bin\JabRef.bat' -importToOpen "\\wsl$\Ubuntu-20.04\home\xxx\projects\xxxxxxxxxx\bibliography\biblio.bib"
Okt. 04, 2022 10:51:52 AM com.sun.javafx.application.PlatformImpl startup
WARNUNG: Unsupported JavaFX configuration: classes were loaded from 'module org.jabref.merged.module', isAutomatic: false, isOpen: true
2022-10-04 10:51:53 [JavaFX Application Thread] org.jabref.logic.net.ssl.TrustStoreManager.createTruststoreFileIfNotExist()
INFO: Trust store path: C:\Users\xxxxx\AppData\Local\org.jabref\JabRef\ssl\truststore.jks
Importing in unknown format: \\wsl$\Ubuntu-20.04\home\xxxxxx\projects\xxxxxxxxxxxx\bibliography\biblio.bib
Format used: BibTeX
2022-10-04 10:51:55 [JavaFX Application Thread] org.jabref.gui.JabRefMain.handleMultipleAppInstances()
INFO: Arguments passed on to running JabRef instance. Shutting down.
I do have also a problem with my surface and its network driver, so I am trying to fix this at the same time. I will report back, if this fixes this problem too.
The error form the jabref extension is:
Error when communicating with the native messaging host.
Unknown error while sending to JabRef.
Error: Error when communicating with the native messaging host. at chrome-extension://bifehkofibaamoeaopjglfkddgkijdlh/browser-polyfill.min.js:1:6365
JabRef 5.7--2022-08-05--73c111c
Windows 10 10.0 amd64
Java 18.0.2
JavaFX 18.0.1+2
Thanks! Sadly the error message doesn't contain anything helpful, except for that the Jabref script didn't respond in the way Chrome was expecting it, see https://developer.chrome.com/docs/apps/nativeMessaging/#native-messaging-debugging.
So we have to dig deeper, if you have a bit of time. Can you please locate the powershell script (its in the same folder as the jabref exe) and uncomment the following lines https://github.com/JabRef/jabref/blob/e48ed0c8ea3238bf6feb43421c309fd2ba1e431f/buildres/windows/JabRefHost.ps1#L42-L44 (you probably need admin rights to write to the powershell script).
If you do this and then import something from the browser extension, there should be a small popup printing exactly the same output as the command above. If there is no popup at all, please use the debug statement in the powershell script also in the catch
block at the end.
If that doesn't point to anything meaningful, I have to investigate if the last point in https://developer.chrome.com/docs/apps/nativeMessaging/#native-messaging-debugging is helpful:
Windows-only: Make sure that the program's I/O mode is set to O_BINARY. By default, the I/O mode is O_TEXT, which corrupts the message format as line breaks (\n = 0A) are replaced with Windows-style line endings (\r\n = 0D 0A). The I/O mode can be set using __setmode.
Okay so, before I run any scripts just a little update. I updated some drivers and now my network problem seems to be resolved. I can upload images again and also the jabref extension did not throw any error sofar. BUT - it does now open in a new window of jabref :D So I have to copy the entry to the already open bib file manuel. But not all the time. The first import of the entry did work correctly but also opend a new window afterwards.
Now I will just finish a bit of work that way and try your comment :)
Thank you for your time
This may be the same issue: https://github.com/JabRef/jabref/issues/9196
I also had this from time to time but can no longer reproduce it (with JabRef v5.7). Can you please run the following in powershell
& 'C:\Program Files\JabRef\runtime\bin\JabRef.bat' -importToOpen "<path to a bib file>"
and then afterwards
$LASTEXITCODE
and$?
while JabRef is running. For me this looks likeMoreover, once you get the error again, could you please have a look at the browser console (Ctrl + Shift + J) and the web console (Ctrl + Shift + K) and copy what you see there. Thanks!
Hi, sorry for the late answer.
I just reproduced your steps in Powershell and this is what I get:
Everything looks fine at first glance, the only message I don't see is the "Arguments passed to Jabref instance..." one. I don't know if that's relevant at all.
Moreover, this is what I get at the browser console:
And this is what I see at the web console when I try to import the reference:
Let me know if you need more info!
Thanks!
the only message I don't see is the "Arguments passed to Jabref instance..." one. I don't know if that's relevant at all.
I think this is the culprit. The absence of this message means that JabRef cannot find the already opened instance, which leads then to the issues you observe. There are already similar issues reported at the main repo https://github.com/JabRef/jabref/issues/9196. These should be fixed with the next release of JabRef and hopefully your issue disappears then as well. Sorry for the inconvenience!
The "Error connecting to JabRef" issue remains under newest version 5.8
Brave [Version 1.46.144 Chromium: 108.0.5359.128 (Official Build) (64-bit)] JabRef 5.8--2022-12-18--b7fae4b Windows 10 Java 18.0.2.1 JavaFX 19+11
@DvP17 sorry for the late reply. Could you please follow the debug steps outlined at https://github.com/JabRef/JabRef-Browser-Extension/issues/493#issuecomment-1266677443. That hopefully allows me to find the origin of the issue.
@tobiasdiez Thank you for your answer. I followed your instructions and it simply prints out a pop-up window with the BibTeX citation (attached). It also imports successfully, but there is still the new tab showing up in the browser with the error message:
"Error when communicating with the native messaging host. at chrome-extension://bifehkofibaamoeaopjglfkddgkijdlh/browser-polyfill.min.js:1:6365"
Okay, so this means that the correct message is passed to JabRef. That's already a good start.
Could you comment again the output line, i.e. #$output = "$messageText"
and run the import again. Then the popup should show the response from JabRef.
Could you also try to replace the "return ..." line that follows by return Respond @{message="ok"; output="Test"}
So the response from JabRef looks fine, right (attached)? When I replace the return line, the same pop-up window (same message) appears.
Sorry @DvP17 for the late response. Thanks for testing it further. Yes, the response looks fine. So I'm lost. Just to make sure that I properly understand the issue: The reference is correctly added in JabRef, but you still get an error message in your browser, right?
No worries. Thank you for your reply!
The reference is correctly added in JabRef, but you still get an error message in your browser, right?
Yes, that is correct.
That's strange, and I've no idea how to fix this properly. What I can offer is to add a preference option that silences all error messages. Then you don't get these false-positives, but also no notifications something "real" is broken. Would that be a solution, or do you have any other ideas how to address this issue?
Since I'm not familiar with the code, I'm not sure what might cause the error message. What triggers the error message, where is it coming from? Is the powershell script opening the respective html connection? Yes, suppressing error messages might be helpful.
I fix this by modify the code in JabRefHost.ps1 line 39 and 40 into this:
$output = & $jabRefExe -importToOpen $tempfile *>$null
Remove-Item $tempfile *>$null
Drop all output make it works. This issue seems to caused by the unexpected output polluting the stdout
, which is directly returned to sendNativeMessage
call in extension.
This will make the output
varible empty, i thinks it is ok, because output
is send to the extension but not used at all.
Hope this will fix yours too.
Hi,
I just started using Jabref a couple of days ago and I'm seeing this issue when importing sources via the browser extension.
If I go to a website like Wikipedia or Arxiv and click on the Jabref extension, the data is sent to Jabref as I would expect and I can import it without issues, but I still get the "Error connecting to Jabref" error tab on the browser. An interesting detail is that this only happens if Jabref is already running, otherwise the extension seems to open Jabref and import the references without any issue.
Both Jabref and the extension where downloaded from the official page links, I'm not running any development version or similar.
I have tried adding the jabref-firefox.json path to the register as mentioned in the manual, but no changes.
I'm using the following versions if it helps: