External link creation dialog unusable

Hi!

I have a spreadsheet including values taken from some web pages. It does not work anymore. The values are replaced by “The link could not be updated”.

I went to Edit>Link to External Files…
The status of every link is “Not available”. If I clic the Modify button, I see this:

Error loading document <URL>:
Error reading data from the Internet.
Server error message: 
HEAD
=>
HTTP/1.1 403 Forbidden.

After a clic on the OK button, I see another message:

Error loading document <URL>:
Object not accessible.
The object cannot be accessed
due to insufficient user rights.

As the URL are accessible with a web browser, something is preventing LibreOffice to use internet. I allowed everything for it in MacOS firewall setting but it did not solve the problem.

What should I try?

LibreOffice 7.4.5.1
MacOS 10.15.7

You can’t do anything when the other side rejects the connection.

I can access the URL with a web browser. Is there a way to change LibreOffice userAgent?

Recently, there was a change of the library used for http(s). After that, some web servers started to reject our requests, because they disliked the UserAgent (tdf#146460). No there is no way to change it for a user (unless you re-compile), but you may file a bug report (similar to tdf#153210 filed for a similar Calc: Convert Image URLs To Actual Images - sometimes it doesn't work, listing a specific failing URL). Also you may try to use LibreOffice 7.2, which used a different library.

And IMO, the best would be to inform the web server staff about the problem.

If on a sane system, you could try using a curl command line,

curl -I https://example.com/

and

curl -I -A 'LibreOffice 7.4.5.1 denylistedbackend/8.0.1 NSS/3.89'  https://example.com/

and

curl -I -A 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0' https://example.com/

with the intended URL instead of https://example.com/ of course…

If the first fails it’s likely the curl User-Agent string triggering the website to deny access, though that is not present anymore in the LibreOffice user agent string since 7.4. If the second fails it’s either the LibreOffice string or (parts of) the string not being on an allowlist at the server. If all three fail then it’s likely the website disallowing HEAD, if it serves the page without the -I option (that does the HEAD request and without the GET request). In all three cases it’s the fault of the website, either being discriminatory against user agents, or not serving a standards complying request.

Or you just hit a misconfigured cloudflare guarded site.

2 Likes

Same answer for the 3 commands

martha@cube ~ % curl -I -A 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0' https://www.coingecko.com/en/coins/bitcoin
HTTP/2 103 
link: <https://static.coingecko.com/packs/css/application-f75deaca.chunk.css>; as=style; nopush; rel=preload

HTTP/2 403 
date: Sat, 06 May 2023 15:26:27 GMT
content-type: text/html; charset=UTF-8
cross-origin-embedder-policy: require-corp
cross-origin-opener-policy: same-origin
cross-origin-resource-policy: same-origin
permissions-policy: accelerometer=(),autoplay=(),camera=(),clipboard-read=(),clipboard-write=(),fullscreen=(),geolocation=(),gyroscope=(),hid=(),interest-cohort=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=()
referrer-policy: same-origin
x-frame-options: SAMEORIGIN
cf-mitigated: challenge
cache-control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
expires: Thu, 01 Jan 1970 00:00:01 GMT
set-cookie: __cf_bm=20pgGoXohGMoEcrY3k.R0K._QESTHiRdYiAdpBMB74Y-1683386787-0-AZIlv8CGGnD6fWnUFZxT//WxmB1K/8eBswa0JXffUT3NIZHf43VTSw1dQDF1q8cc0IZg9Mp3Q1fCyf1988Hwexs=; path=/; expires=Sat, 06-May-23 15:56:27 GMT; domain=.coingecko.com; HttpOnly; Secure; SameSite=None
server: cloudflare
cf-ray: 7c323de0c844cc62-ZRH
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400

As assumed, cloudflare… If you GET the document with

curl https://www.coingecko.com/en/coins/bitcoin | less

you’ll see that a challenge portal page is served that refuses access without JavaScript before you even get to coingecko.com. No luck and nothing LibreOffice could solve without implementing that JavaScript challenge nonsense.

Nothing to see, move on.

I think there is something in the serpent realm. :slightly_smiling_face:

Well yes, one maybe could plug together an AddOn extension using that along with a gecko driver to get around such nonsense, but really… I don’t consider that to be a task of LibreOffice.

1 Like

Indeed, putting anything into LibreOffice code that silently violates the intended usage rules of a site is a no-go :slight_smile:

1 Like

OK. Thank you all.
I guess I have to find a workaround!

Bug tdf#155164

I did:

  • Go to the web page (Firefox).
  • Sign in with a Google account.
  • Trying to modify from LibreOffice and now it works.