You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The client provides several options for logging that can help when things go wrong. Check out the extensive documentation on <<logging>>.
4
+
Use the information in this section to troubleshoot common problems and find
5
+
answers for frequently asked questions.
5
6
6
-
If you are having trouble sending a request to {es} with the client, we suggest enabling `tracing` on the client and testing the cURL command that appears in your terminal:
7
+
8
+
[discrete]
9
+
[[ruby-ts-logging]]
10
+
=== Logging
11
+
12
+
The client provides several options for logging that can help when things go
13
+
wrong. Check out the extensive documentation on <<logging>>.
14
+
15
+
If you are having trouble sending a request to {es} with the client, we suggest
16
+
enabling `tracing` on the client and testing the cURL command that appears in
17
+
your terminal:
7
18
8
19
[source,rb]
9
20
----------------------------
@@ -13,25 +24,43 @@ curl -X GET -H 'x-elastic-client-meta: es=8.9.0,rb=3.2.2,t=8.2.1,fd=2.7.4,nh=0.3
13
24
ransport-ruby/8.2.1 (RUBY_VERSION: 3.2.2; linux x86_64; Faraday v2.7.4), Content-Type: application/json' 'http://localhost:9200//?pretty'
14
25
----------------------------
15
26
16
-
Testing the cURL command can help find out if there's a connection issue or if the issue is in the client code.
27
+
Testing the cURL command can help find out if there's a connection issue or if
28
+
the issue is in the client code.
29
+
17
30
18
31
[discrete]
19
-
=== Connection
20
-
When working with multiple hosts, you might want to enable the `retry_on_failure` or `retry_on_status` options to perform a failed request on another node (refer to <<retry-failures>>).
32
+
[[ruby-ts-connection]]
33
+
=== Troubleshooting connection issues
34
+
35
+
When working with multiple hosts, you might want to enable the
36
+
`retry_on_failure` or `retry_on_status` options to perform a failed request on
37
+
another node (refer to <<retry-failures>>).
38
+
39
+
For optimal performance, use a HTTP library which supports persistent
40
+
("keep-alive") connections, such as https://github.com/toland/patron[patron] or
41
+
https://github.com/typhoeus/typhoeus[Typhoeus]. Require the library
42
+
(`require 'patron'`) in your code for Faraday 1.x or the adapter
43
+
(`require 'faraday/patron'`) for Faraday 2.x, and it will be automatically used.
21
44
22
-
For optimal performance, use a HTTP library which supports persistent ("keep-alive") connections, such as https://github.com/toland/patron[patron] or https://github.com/typhoeus/typhoeus[Typhoeus]. Require the library (`require 'patron'`) in your code for Faraday 1.x or the adapter (`require 'faraday/patron'`) for Faraday 2.x, and it will be automatically used.
23
45
24
46
[discrete]
47
+
[[ruby-ts-adapter]]
25
48
=== Adapter is not registered on Faraday
26
49
27
50
If you see a message like:
28
51
```
29
52
:adapter is not registered on Faraday::Adapter (Faraday::Error)
30
53
```
31
54
32
-
Then you probably need to include the adapter library in your Gemfile and require it. You might get this error when migrating from Faraday v1 to Faraday v2. The main change when using Faraday v2 is all adapters, except for the default `net_http` one, have been moved out into separate gems. This means if you're not using the default adapter and you migrate to Faraday v2, you'll need to add the adapter gems to your Gemfile.
55
+
Then you might need to include the adapter library in your Gemfile and require
56
+
it. You might get this error when migrating from Faraday v1 to Faraday v2. The
57
+
main change when using Faraday v2 is all adapters, except for the default
58
+
`net_http` one, have been moved out into separate gems. This means if you're not
59
+
using the default adapter and you migrate to Faraday v2, you'll need to add the
60
+
adapter gems to your Gemfile.
33
61
34
-
These are the gems required for the different adapters with Faraday 2, instead of the libraries on which they were based:
62
+
These are the gems required for the different adapters with Faraday 2, instead
63
+
of the libraries on which they were based:
35
64
36
65
[source,ruby]
37
66
------------------------------------
@@ -48,14 +77,21 @@ gem 'faraday-patron'
48
77
gem 'faraday-typhoeus'
49
78
------------------------------------
50
79
51
-
Things should work fine if you migrate to Faraday 2 as long as you include the adapter (unless you're using the default one `net-http`), but worst case scenario, you can always lock the version of Faraday in your project to 1.x:
80
+
Migrating to Faraday 2 solves the issue as long as the adapter is included
81
+
(unless you're using the default one `net-http`). Alternatively, you can lock
82
+
the version of Faraday in your project to 1.x:
52
83
`gem 'faraday', '~> 1'`
53
84
54
-
Be aware if migrating to Faraday v2 that it requires at least Ruby `2.6`, unlike Faraday v1 which requires `2.4`.
85
+
IMPORTANT: Migrating to Faraday v2 requires at least Ruby `2.6`. Faraday v1
86
+
requires `2.4`.
55
87
56
88
[discrete]
57
89
=== More Help
58
90
59
-
If you need more help, you can hop on our https://discuss.elastic.co/[Elastic community forums] and get answers from the experts in the community, including people from Elastic.
91
+
If you need more help, visit the
92
+
https://discuss.elastic.co/[Elastic community forums] and get answers from the
93
+
experts in the community, including people from Elastic.
60
94
61
-
If you find a bug, have feedback, or find any other issue using the client, please https://github.com/elastic/elasticsearch-ruby/issues/new/choose[submit an issue] on GitHub.
95
+
If you find a bug, have feedback, or find any other issue using the client,
96
+
https://github.com/elastic/elasticsearch-ruby/issues/new/choose[submit an issue]
0 commit comments