JabRef / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
3.63k stars 2.58k forks source link

Can't fecth from DOI/Crossref, but browser and CLI works. #8643

Open tautomer opened 2 years ago

tautomer commented 2 years ago

JabRef version

Latest development branch build (please note build date below)

Operating system

macOS

Details on version and operating system

macOS 11.6.2

Checked with the latest development build

Steps to reproduce the behaviour

I'm using JabRef behind my organization's proxy.

Running ./JabRef --debug --nogui --fetch=Crossref:"Representation independent algorithms for molecular response calculations in time-dependent self-consistent field theories" from CLI, it returns

Apr 04, 2022 4:10:11 PM com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'module org.jabref.merged.module', isAutomatic: false, isOpen: true
2022-04-04 16:10:12 [JavaFX Application Thread] org.jabref.logic.net.ssl.TrustStoreManager.createTruststoreFileIfNotExist()
INFO: Trust store path: /Users/lix/Library/Application Support/ssl/truststore.jks
use java property -Dtinylog.level=debug
Running query 'Representation independent algorithms for molecular response calculations in time-dependent self-consistent field theories' with fetcher 'Crossref'.
Please wait...2022-04-04 16:10:12 [JavaFX Application Thread] org.jabref.cli.ArgumentProcessor.fetch()
ERROR: Error while fetching: org.jabref.logic.importer.FetcherException: A network error occurred while fetching from https://api.crossref.org/works?query=Representation+independent+algorithms+for+molecular+response+calculations+in+time-dependent+self-consistent+field+theories
    at org.jabref@5.6.142/org.jabref.logic.importer.SearchBasedParserFetcher.getBibEntries(Unknown Source)
    at org.jabref@5.6.142/org.jabref.logic.importer.SearchBasedParserFetcher.performSearch(Unknown Source)
    at org.jabref@5.6.142/org.jabref.logic.importer.SearchBasedFetcher.performSearch(Unknown Source)
    at org.jabref@5.6.142/org.jabref.cli.ArgumentProcessor.fetch(Unknown Source)
    at org.jabref@5.6.142/org.jabref.cli.ArgumentProcessor.processArguments(Unknown Source)
    at org.jabref@5.6.142/org.jabref.cli.ArgumentProcessor.<init>(Unknown Source)
    at org.jabref@5.6.142/org.jabref.gui.JabRefMain.start(Unknown Source)
    at org.jabref.merged.module@5.6.142/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown Source)
    at org.jabref.merged.module@5.6.142/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(Unknown Source)
    at org.jabref.merged.module@5.6.142/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at org.jabref.merged.module@5.6.142/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(Unknown Source)
    at org.jabref.merged.module@5.6.142/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
Caused by: java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 403 Forbidden"
    at java.base/sun.net.www.protocol.http.HttpURLConnection.doTunneling0(Unknown Source)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.doTunneling(Unknown Source)
    at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at java.base/java.net.HttpURLConnection.getResponseCode(Unknown Source)
    at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source)
    at org.jabref@5.6.142/org.jabref.logic.net.URLDownload.openConnection(Unknown Source)
    at org.jabref@5.6.142/org.jabref.logic.net.URLDownload.asInputStream(Unknown Source)
    ... 13 more
2022-04-04 16:10:15 [JavaFX Application Thread] org.jabref.gui.JabRefMain.handleMultipleAppInstances()
INFO: Arguments passed on to running JabRef instance. Shutting down.

I understand that Proxy returns "HTTP/1.1 403 Forbidden" sounds like a problem of the proxy server itself. I can, however, get the json from https://api.crossref.org/works?query=Representation+independent+algorithms+for+molecular+response+calculations+in+time-dependent+self-consistent+field+theories in my browser or CLI (curl/wget). For example, with wget

wget https://api.crossref.org/works\?query\=Representation+independent+algorithms+for+molecular+response+calculations+in+time-dependent+self-consistent+field+theories                                                                                     miniforge3
--2022-04-04 16:16:23--  https://api.crossref.org/works?query=Representation+independent+algorithms+for+molecular+response+calculations+in+time-dependent+self-consistent+field+theories
Resolving ___ (___)... ___
Connecting to ____ (____)|___|:8080... connected.
Proxy request sent, awaiting response... 200 OK
Length: unspecified [application/json]
Saving to: ‘works?query=Representation+independent+algorithms+for+molecular+response+calculations+in+time-dependent+self-consistent+field+theories’

works?query=Representation+independent+algorithms+for+molecular+re     [ <=>                                                                                                                                                            ] 105.39K  --.-KB/s    in 0.1s

2022-04-04 16:16:25 (980 KB/s) - ‘works?query=Representation+independent+algorithms+for+molecular+response+calculations+in+time-dependent+self-consistent+field+theories’ saved [107921]

Setting proxy maunally in the preference doesn't do anything. In fact, setting the proxy or not, the Check connection button returns success.

Appendix

...

Log File ``` Paste an excerpt of your log file here ```
tautomer commented 2 years ago

Update:

I tried again at home (no firewall). With proxy set, jabref reports Caused by: java.net.UnknownHostException. Disabling the proxy setting in jabref, I can fetch from DOI or Crossref.

So indeed my organization's firewall blocked the fetcher, but anyone knows why only jabref's fetcher is blocked? Even JabRef's check connection button works...