jabref icon indicating copy to clipboard operation
jabref copied to clipboard

403 for "lookup fulltext"

Open jiucenglou opened this issue 2 years ago • 6 comments

JabRef version

5.13 (latest release)

Operating system

Windows

Details on version and operating system

No response

Checked with the latest development build (copy version output from About dialog)

  • [X] I made a backup of my libraries before testing the latest development version.
  • [X] I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

  1. open https://pubs.acs.org/doi/10.1021/ja010365z in browser
  2. click jabref browser extension to import
  3. the error occurs
    Error message: org.jabref.logic.importer.FetcherClientException: Encountered HTTP Status code 403 
    URL: https://pubs.acs.org/doi/pdf/10.1021/ja010365z 
    Please check the URL and try again.
    
  4. pdf can be viewed or downloaded in browser

Appendix

...

Log File
2024-06-07 11:45:50 [JabRef - Remote Listener Server on port 6050] org.jabref.gui.remote.CLIMessageHandler.handleCommandLineArguments()
INFO: Processing message [-importToOpen, C:\Users\HiWin10\AppData\Local\Temp\tmp244C.tmp]
2024-06-07 11:45:55 [JavaFX Application Thread] org.jabref.gui.fieldeditors.LinkedFileViewModel.download()
INFO: Downloading file from 
2024-06-07 11:45:55 [JavaFX Application Thread] org.jabref.gui.linkedfile.DownloadLinkedFileAction.execute()
INFO: Downloading file from https://pubs.acs.org/doi/pdf/10.1021/ja010365z
2024-06-07 11:45:55 [JavaFX Application Thread] org.jabref.gui.linkedfile.DownloadLinkedFileAction.onFailure()
ERROR: Error downloading from URL: URLDownload{source=https://pubs.acs.org/doi/pdf/10.1021/ja010365z}: java.io.IOException: org.jabref.logic.importer.FetcherClientException: Encountered HTTP Status code 403
	at [email protected]/org.jabref.logic.net.URLDownload.openConnection(Unknown Source)
	at [email protected]/org.jabref.logic.net.URLDownload.asInputStream(Unknown Source)
	at [email protected]/org.jabref.gui.linkedfile.DownloadLinkedFileAction$FileDownloadTask.call(Unknown Source)
	at [email protected]/org.jabref.gui.linkedfile.DownloadLinkedFileAction$FileDownloadTask.call(Unknown Source)
	at [email protected]/org.jabref.gui.util.BackgroundTask$3.call(Unknown Source)
	at [email protected]/org.jabref.gui.util.DefaultTaskExecutor$1.call(Unknown Source)
	at [email protected]/javafx.concurrent.Task$TaskCallable.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: org.jabref.logic.importer.FetcherClientException: Encountered HTTP Status code 403
	... 13 more

jiucenglou avatar Jun 07 '24 03:06 jiucenglou

/assign-me

laky241 avatar Jan 12 '25 18:01 laky241

👋 Hey @laky241, thank you for your interest in this issue! 🎉

We're excited to have you on board. Start by exploring our Contributing guidelines, and don't forget to check out our workspace setup guidelines to get started smoothly.

In case you encounter failing tests during development, please check our developer FAQs!

Having any questions or issues? Feel free to ask here on GitHub. Need help setting up your local workspace? Join the conversation on JabRef's Gitter chat. And don't hesitate to open a (draft) pull request early on to show the direction it is heading towards. This way, you will receive valuable feedback.

Happy coding! 🚀

⏳ Please note, you will be automatically unassigned if the issue isn't closed within 90 days (by 12 April 2025). A maintainer can also add the "📌 Pinned"" label to prevent automatic unassignment.

github-actions[bot] avatar Jan 12 '25 18:01 github-actions[bot]

👋 Hey @laky241, you've been automatically unassigned from this issue due to inactivity.

[!NOTE] If you'd like to be re-assigned, just leave another comment or ask a maintainer to assign you again. If you're still actively working on the issue, let us know by commenting, and we can pin it to prevent automatic unassignment.

github-actions[bot] avatar Feb 27 '25 12:02 github-actions[bot]

I tried to reproduce it but it works as expected the import succeeds in jabref, so i don't think this issue is there anymore.

RishabhRawat9 avatar Jul 06 '26 11:07 RishabhRawat9

The issue is a bit differnet today:

Image
  1. "Files and links"

  2. "+ File"

  3. Click "Lookup"

Image
  1. see
Image

and

Image

Action point: Fix Download

  1. AI Service should not ingest online links
  2. Download should work
  3. Download should THEN Trigger AI (maybe already done by observable)

koppor avatar Jul 06 '26 22:07 koppor

Hey @koppor, I traced the 403 during full-text lookup.

The error shown in JabRef is Access denied. You do not have permission to access this resource, and the response body contains:

Access denied. You do not have permission to access this resource. Please contact the administrator for assistance or try a different action.

URL: https://pubs.acs.org/doi/suppl/10.1021/acs.inorgchem.2c02170/suppl_file/ic2c02170_si_001.pdf
HTTP 403 Forbidden
<!DOCTYPE html><html lang="en-US"><head><title>Just a moment...</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="robots" content="noindex,nofollow"><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="content-security-policy" content="default-src &#39;none&#39;; script-src &#39;nonce-5ZsvUR9qFJy2wYXYw7p05q&#39; &#39;unsafe-eval&#39; https://challenges.cloudflare.com; script-src-attr &#39;none&#39;; style-src &#39;unsafe-inline&#39;; img-src &#39;self&#39; https://challenges.cloudflare.com; connect-src &#39;self&#39; https://challenges.cloudflare.com; frame-src &#39;self&#39; https://challenges.cloudflare.com blob:; child-src &#39;self&#39; https://challenges.cloudflare.com blob:; worker-src blob:; form-action http: https:; base-uri &#39;self&#39;"><style>*{box-sizing:border-box;margin:0;padding:0}html{line-height:1.15;-webkit-text-size-adjust:100%;color:#313131;font-family:system-ui,-apple... (truncated)

I also reproduced the same 403 using curl. The response contains cf-mitigated: challenge and requires JavaScript/cookies, while the URL opens normally in a browser.

The same issue also occurs with another ACS resource (maybe it's for all of the acs resources): https://pubs.acs.org/doi/10.1021/acs.inorgchem.2c02170

Is there an intended fallback for publisher URLs protected by such browser challenges, or should these downloads be treated as unsupported?

Also, regarding embeddings, should AI ingestion simply be skipped when the download fails, since ingestion is intended to operate on a successfully downloaded file?

RishabhRawat9 avatar Jul 12 '26 19:07 RishabhRawat9