4

I'm trying to update a package in CRAN and I get these errors:

Found the following (possibly) invalid URLs:
  URL: https://doi.org/10.1175/1520-0469(1985)042<0217:OTTDPO>2.0.CO;2
    From: man/EPflux.Rd
    Status: Error
    Message: libcurl error code 35:
        schannel: next InitializeSecurityContext failed: SEC_E_ILLEGAL_MESSAGE (0x80090326) - This error usually occurs when a fatal SSL/TLS alert is received (e.g. handshake failed).

The URLs are valid and are actually created with the \doi{} macro (e.g. \doi{10.1175/1520-0469(1985)042<0217:OTTDPO>2.0.CO;2})

Even using encoded URLs (per stevec's suggestion)fail with the same error:

Found the following (possibly) invalid URLs:
  URL: https://doi.org/10.1175/1520-0469(1985)042%3C0217:OTTDPO%3E2.0.CO;2
    From: man/EPflux.Rd
    Status: Error
    Message: libcurl error code 35:
        schannel: next InitializeSecurityContext failed: SEC_E_ILLEGAL_MESSAGE (0x80090326) - This error usually occurs when a fatal SSL/TLS alert is received (e.g. handshake failed).

Any advice on how to solve this?

Elio Campitelli
  • 1,408
  • 1
  • 10
  • 20
  • Do you get that error every time you run CRAN checks? The reason I ask is because first time I visited `https://doi.org/10.1175/1520-0469(1985)042<0217:OTTDPO>2.0.CO;2` it took a long time to load, and it may have timed out during the check. But second and third time it was fast. So the checks may think it's not loading and therefore invalid – stevec Feb 06 '21 at 15:01
  • I also notice the page doesn't load properly when retrieved with `xml2::read_html("https://doi.org/10.1175/1520-0469(1985)042<0217:OTTDPO>2.0.CO;2")`. Although CRAN check probably uses something other than `xml2::read_html()`, it could be having a similar difficulty accessing the page – stevec Feb 06 '21 at 15:05
  • The error suggests it's a server-side SSL error (https://curl.se/libcurl/c/libcurl-errors.html#CURLESSLCONNECTERROR), rather than anything to do with the URL encoding. I could reproduce it from the command line with `curl -L 'https://doi.org/10.1175/1520-0469(1985)042<0217:OTTDPO>2.0.CO;2'`, but only 1 time out of 5. – Joe Roe Feb 06 '21 at 16:55
  • I'm trying that and cannot get an error. It always load the webpage. – Elio Campitelli Feb 06 '21 at 18:02

2 Answers2

2

I think the reason this is happening is because

https://doi.org/10.1175/1520-0469(1985)042<0217:OTTDPO>2.0.CO;2

is redirecting to

https://journals.ametsoc.org/view/journals/atsc/42/3/1520-0469_1985_042_0217_ottdpo_2_0_co_2.xml

Can you try changing the URL to https://journals.ametsoc.org/view/journals/atsc/42/3/1520-0469_1985_042_0217_ottdpo_2_0_co_2.xml and see if that passes the check?

Another possibility

From here):

some (DOIs) require encoding so that the DOI works correctly when used in URL form

So you perhaps you can encode the url first

URLencode("https://doi.org/10.1175/1520-0469(1985)042<0217:OTTDPO>2.0.CO;2")
[1] "https://doi.org/10.1175/1520-0469(1985)042%3C0217:OTTDPO%3E2.0.CO;2"

Also note:

We strongly recommend that only the following characters are used within a DOI name: “0–9”, “a–z”, and “-._/”.

So perhaps the < characters are causing this issue? (possibly ( too)

Another idea

Noting this from the error message:

This error usually occurs when a fatal SSL/TLS alert is received (e.g. handshake failed).

If we try again not worrying about ssl, that may work.

In otherwords, try using this url instead: http://doi.org/10.1175/1520-0469(1985)042<0217:OTTDPO>2.0.CO;2

stevec
  • 41,291
  • 27
  • 223
  • 311
  • 1
    Yeah, as a last resource I would, but I the "proper" way of linking to the document is via the DOI, because the journal link might change in the future. I have other doi links in my package that don't fail ️ – Elio Campitelli Feb 06 '21 at 15:10
  • @ElioCampitelli would you be able to post a link to a similar link that doesn't fail so we can compare them – stevec Feb 06 '21 at 15:11
  • Yes, This one, for example: https://doi.org/10.1080/01621459.2015.1062383 – Elio Campitelli Feb 06 '21 at 15:12
  • @ElioCampitelli I found some more info, please see in the answer. – stevec Feb 06 '21 at 15:20
  • 1
    Unfortunately the encoded URLs throw other error: `E> Unexpected end of input (in " quoted string opened at waves.Rd:141:204)` – Elio Campitelli Feb 06 '21 at 15:40
  • @ElioCampitelli is it possible to double check all syntax, as the unexpected end of input error might indicate a missing bracket somewhere? https://stackoverflow.com/q/44952780/5783745 – stevec Feb 06 '21 at 15:43
  • Can you include the code where you provide the URL, in the question and ping me here with a comment? (it would be useful to see that code, understand the input format etc) – stevec Feb 06 '21 at 15:44
  • But my guess is if you go back to the last working version of your code, and simply replace "https://doi.org/10.1175/1520-0469(1985)042<0217:OTTDPO>2.0.CO;2" with "https://doi.org/10.1175/1520-0469(1985)042%3C0217:OTTDPO%3E2.0.CO;2" then it should work – stevec Feb 06 '21 at 15:45
  • Also, you won't lose any information that way, because you can always get the original URL with `URLdecode()` – stevec Feb 06 '21 at 15:46
  • It didn't work. :'( (Updated my question accordingly) – Elio Campitelli Feb 06 '21 at 16:58
  • @ElioCampitelli I had another idea (see answer), please try – stevec Feb 06 '21 at 17:05
  • Nope, same issue. :( – Elio Campitelli Feb 06 '21 at 18:01
  • @ElioCampitelli and to be absolutely sure, can you try `http://doi.org/10.1175/1520-0469(1985)042%3C0217:OTTDPO%3E2.0.CO;2` (that's encoded *and* without tsl) – stevec Feb 06 '21 at 18:03
  • Yes, I was using the encoded version with http. – Elio Campitelli Feb 06 '21 at 18:08
  • 1
    @ElioCampitelli Perhaps CRAN checks force ssl. I'm completely out of ideas.. – stevec Feb 06 '21 at 18:10
  • 1
    Thanks for the ideas you had, though :) I might need to check with CRAN. ‍♀️️ – Elio Campitelli Feb 06 '21 at 18:14
2

Hadley suggested that those notes can be safely ignored. I sent the package to CRAN and was accepted.

The answer, then, is to just ignore these Notes.

Elio Campitelli
  • 1,408
  • 1
  • 10
  • 20