ropensci / elastic

R client for the Elasticsearch HTTP API
https://docs.ropensci.org/elastic
Other
245 stars 58 forks source link

Error: Client error: (401) Unauthorized when using docs_bulk() on RStudio #221

Closed paramiyer closed 6 years ago

paramiyer commented 6 years ago
{ "name" : "urDx7BV", "cluster_name" : "elasticsearch", "cluster_uuid" : "mrnOSeExQGKVA0nI_a7QSA", "version" : { "number" : "6.2.4", "build_hash" : "ccec39f", "build_date" : "2018-04-12T20:37:28.497551Z", "build_snapshot" : false, "lucene_version" : "7.2.1", "minimum_wire_compatibility_version" : "5.6.0", "minimum_index_compatibility_version" : "5.0.0" }, "tagline" : "You Know, for Search" }
Session Info ```Session info -------------------------------------------------------------------- setting value version R version 3.4.3 (2017-11-30) system x86_64, mingw32 ui RStudio (1.0.143) language (EN) collate English_United States.1252 tz Europe/London date 2018-04-23 Packages ------------------------------------------------------------------------ package * version date source base * 3.4.3 2017-12-06 local compiler 3.4.3 2017-12-06 local curl 3.1 2017-12-12 CRAN (R 3.4.3) datasets * 3.4.3 2017-12-06 local devtools 1.13.4 2017-11-09 CRAN (R 3.4.3) digest 0.6.15 2018-01-28 CRAN (R 3.4.3) elastic * 0.8.0 2017-09-14 CRAN (R 3.4.4) graphics * 3.4.3 2017-12-06 local grDevices * 3.4.3 2017-12-06 local httr 1.3.1 2017-08-20 CRAN (R 3.4.2) jsonlite 1.5 2017-06-01 CRAN (R 3.4.2) memoise 1.1.0 2017-04-21 CRAN (R 3.4.3) methods * 3.4.3 2017-12-06 local R6 2.2.2 2017-06-17 CRAN (R 3.4.2) stats * 3.4.3 2017-12-06 local tools 3.4.3 2017-12-06 local utils * 3.4.3 2017-12-06 local withr 2.1.1 2017-12-19 CRAN (R 3.4.3) ```

Pls find details of elasticSearch & session info included above. Post installation I tried running the basic commands

library(elastic) connect() shakespeare <- system.file("examples", "shakespeare_data.json", package = "elastic") docs_bulk(shakespeare)

I get the following error Error: Client error: (401) Unauthorized

I am working on a proxy env. All my http/https proxies are all set well using library(httr) Any pointers if this is an issue?

Param

sckott commented 6 years ago

have you tried passing httr::use_proxy(your settings) to the function calls? e.g., Search(parameters, config = httr::use_proxy())

paramiyer commented 6 years ago

@sckott, no I haven't -will give it a shot & report. Should I be passing the config params in creating the index too? In my example & error reported I am not able to create the index in the first place

paramiyer commented 6 years ago

I still get the same error. I investigated further with httr::verbose() & looks like my proxy is failing. Please close this ticket as this issue isnt related to elastic

sckott commented 6 years ago

okay, thanks