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

Do not automatically remove trailing slash #285

Closed
nicolas-f opened this issue Dec 1, 2021 · 6 comments
Closed

Do not automatically remove trailing slash #285

nicolas-f opened this issue Dec 1, 2021 · 6 comments

Comments

@nicolas-f
Copy link

Session Info
> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.1 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3

locale:
 [1] LC_CTYPE=fr_FR.UTF-8       LC_NUMERIC=C               LC_TIME=fr_FR.UTF-8        LC_COLLATE=fr_FR.UTF-8     LC_MONETARY=fr_FR.UTF-8    LC_MESSAGES=fr_FR.UTF-8    LC_PAPER=fr_FR.UTF-8      
 [8] LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=fr_FR.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] elastic_1.2.0

loaded via a namespace (and not attached):
 [1] compiler_4.1.2  R6_2.5.1        tools_4.1.2     httpcode_0.3.0  curl_4.3.2      Rcpp_1.0.7      urltools_1.7.3  triebeard_0.3.0 crul_1.2.0      jsonlite_1.7.2 

The elastic search instance was only working if the trailing slash was used. But the elastic plugin automatically removes the trailing slash and fail to connect to the elastic search instance:

> library(elastic)
> es.host="x.x.x.x"
> es.port=443
> es.transport_schema="https"
> es.user="myuser"
> es.pwd="mypassword"
> es.path="elastic/"
> es.cainfo='/home/myuser/cers/mycert.crt'
> crul::set_verbose()
> conn <- connect(host = es.host, port = es.port, user = es.user, pwd = es.pwd, path=es.path, transport_schema = es.transport_schema, cainfo=es.cainfo)
Normalizing path: stripping trailing slash
> conn$info(verbose=TRUE)
Erreur : 
  Failed to connect to https://x.x.x.x:443/elastic
  Remember to start Elasticsearch before connecting

Maybe there is an option to skip the Normalizing path: stripping trailing slash step ?

Thanks

@sckott
Copy link
Contributor

sckott commented Dec 3, 2021

Thanks for the issue. Are you sure that's why it's failing? Can you try to replicate on the command line or somewhere else to see if it's the trailing slash that's the issue?

@nicolas-f
Copy link
Author

Yes I solved it by changing the configuration of the web server by accepting query without the trailing slash.

Its a specific situation where the R elastic client is accessing elastic search through an nginx or apache proxy.

@sckott
Copy link
Contributor

sckott commented Dec 3, 2021

Yes I solved it

So you're all set? does conn$info() work now?

@nicolas-f
Copy link
Author

Yes, thanks, I solved it by modifying the web server.

But I created this issue in order to help enhance the library

@maelle
Copy link
Member

maelle commented Sep 9, 2022

For info this package is looking for a new maintainer cf #292 😸

@maelle
Copy link
Member

maelle commented Jan 12, 2023

I see this had been solved by @sckott

@maelle maelle closed this as completed Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants