Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctrLoadQueryIntoDb works on windows but not ubuntu #19

Closed
rwillans opened this issue Apr 15, 2021 · 7 comments
Closed

ctrLoadQueryIntoDb works on windows but not ubuntu #19

rwillans opened this issue Apr 15, 2021 · 7 comments
Assignees

Comments

@rwillans
Copy link

rwillans commented Apr 15, 2021

ctrLoadQueryIntoDb works on windows machine when searching EUCTR, but fails when I try the code on a ubuntu server with the following error.

  • Found search query from EUCTR: query=2020-001921-30+OR+2020-001739-28+OR+2020-001891-14+OR+2020-001823-15
  • Checking trials in EUCTR: Error : Host https://www.clinicaltrialsregister.eu/ does not respond, cannot continue.

Similar searches with other queries don't work. Searching CTGOV works fine on both machines. I've updated R and all packages with no success, and tried the dev version of ctr data. Other API calls work from the ubuntu machine, (as does using the CTGOV registry). I've checked sed, php, cat, perl are installed on the ubuntu machine, no luck. I'm using a sqlite database if that makes any difference.

Any thoughts on what might be the issue?

@rfhb rfhb self-assigned this Apr 15, 2021
@rfhb
Copy link
Owner

rfhb commented Apr 15, 2021

Thanks. The reason underlying the reported error with EUCTR (https://www.clinicaltrialsregister.eu/) is,

<simpleError in curl::curl_fetch_memory(url, handle = handle): SSL certificate problem: unable to get local issuer certificate>

This error reports correctly that this particular register server does not deliver all certificates that would be needed for the R client to verify the certificate chain (see also https://ssl-tools.net/webservers/www.clinicaltrialsregister.eu). Since recently, R package policies prevent switching off checking SSL certificates (which had been used in some previous versions of ctrdata for this error). For this reason, only a user can chose to switch this off in order to access such servers with certificate issues.

Use the following command before running ctrdata commands to access EUCTR - I checked today that this works under Ubuntu. This setting for options applies during the duration of the R session.

httr::set_config(httr::config(ssl_verifypeer = FALSE))

I will improve the error reporting in ctrdata and include the above suggestion so that users do not get stuck here.

@rfhb
Copy link
Owner

rfhb commented Apr 15, 2021

Better user info now in 08ea0c2. One could install the latest development version with remotes::install_github("rfhb/ctrdata"), which now presents to the user the workaround above for the specific error.

@rwillans
Copy link
Author

Thanks for that. I've tried with the setting but the error message with the httr config set is now

Error in curl::curl_fetch_memory(url = paste0(queryEuRoot, queryEuType3, :
SSL certificate problem: unable to get local issuer certificate

This may be some sort of issue with certificates on my side. Unless you can suggest any other reason, I'll assume it's due to my config

@rfhb
Copy link
Owner

rfhb commented Apr 15, 2021

Yes. I will see what can be done in the package to propagate the user settings to all concerned network operations. Again, it is a problem of the register server. R packages are not permitted to circumvent checking certificates of servers. More later.

@rfhb
Copy link
Owner

rfhb commented Apr 15, 2021

Commit 80572c2 now propagates the httrsettings described above to curl calls in the concerned function of ctrdata. If you can, try with remotes::install_github("rfhb/ctrdata") and with the httr options as per above.

@rwillans
Copy link
Author

Brilliant - I've tried that and it resolves the issue perfectly. Many thanks for the fast response and quick resolution.

@rfhb
Copy link
Owner

rfhb commented Apr 15, 2021

Glad to know it works ok. Thanks for the feedback. And in particular thank you for raising the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants