-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Trivial - P5
-
None
-
Affects Version/s: None
-
Component/s: None
In Mongoid we have some error messages that include actionable steps toward resolution, for example:
ambiguous_relationship: message: "Ambiguous associations %{candidates} defined on %{klass}." summary: "When Mongoid attempts to set an inverse document of an association in memory, it needs to know which association it belongs to. When setting %{name}, Mongoid looked on the class %{inverse} for a matching association, but multiples were found that could potentially match: %{candidates}." resolution: "On the %{name} association on %{inverse} you must add an :inverse_of option to specify the exact association on %{klass} that is the opposite of %{name}."
These are defined in `lib/config/locales/en.yml` in Mongoid.
We could do something similar for the driver. We already detect dead monitor threads and closed clients for example, and in these cases we can point to our forking guidance (https://docs.mongodb.com/ruby-driver/current/tutorials/ruby-driver-create-client/#usage-with-forking-servers) and to a new section in the docs stating that using closed clients is not supported.
It may be of value to create an entire section in the tutorial dedicated to NoServerAvailable troubleshooting as this is error probably accounts for the vast majority of all application-surfaced driver exceptions.
- duplicates
-
RUBY-2197 Include per-server ismaster errors in NoServerAvailable exception message
- Backlog