2009-07-07 21:34:30 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
|
2009-07-11 08:06:30 +00:00
|
|
|
<!-- $Revision$ -->
|
2009-07-07 21:34:30 +00:00
|
|
|
<phpdoc:classref xml:id="class.mongoconnectionexception" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
|
|
|
|
|
|
|
<title>The MongoConnectionException class</title>
|
|
|
|
<titleabbrev>MongoConnectionException</titleabbrev>
|
|
|
|
|
|
|
|
<partintro>
|
|
|
|
|
|
|
|
<!-- {{{ Mongoconnectionexception intro -->
|
|
|
|
<section xml:id="mongoconnectionexception.intro">
|
|
|
|
&reftitle.intro;
|
|
|
|
<para>
|
|
|
|
Thrown when the driver fails to connect to the database.
|
|
|
|
</para>
|
2009-11-06 17:47:24 +00:00
|
|
|
|
|
|
|
<para>
|
2009-11-19 23:17:53 +00:00
|
|
|
There are a number of possible error messages to help you diagnose the
|
|
|
|
connection problem. These are:
|
2009-11-06 17:47:24 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<itemizedlist>
|
2013-06-25 22:31:20 +00:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
<literal>No candidate servers found</literal>
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Thrown when the driver cannot establish a connection to MongoDB
|
|
|
|
(fulfilling the ReadPreferences, if specified).
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
|
2009-11-06 17:47:24 +00:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
<literal>No server name given.</literal>
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
This error occurs if you pass in "" as the server name,
|
|
|
|
probably because of an typo with string interpolation,
|
|
|
|
e.g., "$servr" instead of "$server".
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
<literal>
|
|
|
|
failed to get host [hostname] or port [portnum]
|
|
|
|
from [server].
|
|
|
|
</literal>
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
This indicated that the server string was malformed.
|
|
|
|
"[hostname]" and "[portnum]" will be as much as the
|
|
|
|
driver could dicipher of it.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
<literal>Operation in progress</literal>
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Connecting to the database timed out.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
2010-08-26 15:34:16 +00:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
<literal>Transport endpoint is not connected</literal>
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Generally means that the connection string isn't correct, the driver
|
|
|
|
couldn't even find the database server.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
2009-11-06 17:47:24 +00:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
<literal>couldn't determine master</literal>
|
|
|
|
</para>
|
|
|
|
<para>
|
2012-11-26 03:07:28 +00:00
|
|
|
No server in a replica set connection was identified as the primary.
|
2009-11-06 17:47:24 +00:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
<literal>couldn't get host info for [server]</literal>
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
This indicated that DNS could not resolve the server address
|
|
|
|
you gave. This could easily be caused by a typo, for example,
|
|
|
|
"server" instead of "$server".
|
|
|
|
</para>
|
|
|
|
</listitem>
|
2010-04-21 22:34:49 +00:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
<literal>Invalid Argument</literal>
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
This can be caused by attempting to connect to a machine that is up but
|
|
|
|
that the database isn't actually running on. Make sure that you've
|
|
|
|
started the database server before connecting.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
2010-02-22 19:29:54 +00:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
<literal>Permission denied</literal>
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
This means that the socket could not be opened due to permissions issues.
|
|
|
|
On Red Hat variants, this can be caused by a default setting that does not
|
|
|
|
allow Apache to create network connections. You can override this setting
|
|
|
|
by running:
|
2014-09-09 18:31:20 +00:00
|
|
|
<programlisting role="shell">
|
2010-02-22 19:29:54 +00:00
|
|
|
<![CDATA[
|
|
|
|
$ /usr/sbin/setsebool -P httpd_can_network_connect 1
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
then restarting Apache.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
2009-11-06 17:47:24 +00:00
|
|
|
</itemizedlist>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
If the error message is not listed above, it is probably an error
|
|
|
|
from the C socket, and you can search the web for its usual cause.
|
|
|
|
</para>
|
2009-07-07 21:34:30 +00:00
|
|
|
</section>
|
|
|
|
<!-- }}} -->
|
|
|
|
|
|
|
|
<section xml:id="mongoconnectionexception.synopsis">
|
|
|
|
&reftitle.classsynopsis;
|
|
|
|
|
|
|
|
<!-- {{{ Synopsis -->
|
|
|
|
<classsynopsis>
|
|
|
|
<ooclass><classname>MongoConnectionException</classname></ooclass>
|
|
|
|
|
|
|
|
<!-- {{{ Class synopsis -->
|
|
|
|
<classsynopsisinfo>
|
2012-11-29 05:37:54 +00:00
|
|
|
<ooclass>
|
|
|
|
<classname>MongoConnectionException</classname>
|
|
|
|
</ooclass>
|
2009-07-07 21:34:30 +00:00
|
|
|
<ooclass>
|
|
|
|
<modifier>extends</modifier>
|
|
|
|
<classname>MongoException</classname>
|
|
|
|
</ooclass>
|
|
|
|
</classsynopsisinfo>
|
|
|
|
<!-- }}} -->
|
|
|
|
|
|
|
|
</classsynopsis>
|
|
|
|
<!-- }}} -->
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
</partintro>
|
|
|
|
|
|
|
|
</phpdoc:classref>
|
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2009-07-07 21:34:30 +00:00
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|