<previous | top | next> Pyro Manual

9. Errors and Troubleshooting

The Pyro Errors section describes the various errors that can occur when using Pyro. It only describes Pyro's custom exceptions - other Python exceptions may occur due to other runtime problems.

The Troubleshooting section provides various hints and tips when you can't get things to work as expected.

Pyro Errors

Pyro Exception Hierarchy

Initialization

OSError-- is raised when Pyro can't create or open the storage directory specified by PYRO_STORAGE.

Naming Server

NamingError-- The naming service responds with the following kinds of NamingError exceptions (raised by the remote NS object):
Error stringraised bydescription
name already existsregisterThe name you're trying to register is already present in the NS database
name not foundunregisterYou're trying to unregister an unknown name.
name not foundresolveThe name you're trying to resolve is unknown by the NS.
invalid namevarious methodsThe object name is invalid. It must be a string with no whitespaces and only 7-bit ASCII characters.
invalid URIvarious methodsThe object URI that was passed is invalid.
parent is no groupregisterA new name can only be registered within a group. The name is not in a correct group.
attempt to resolve groupnameresolveA resolve was done on a group name, only object names can be resolved.
group not foundvarious methodsThe name contains an unknown group.
is no groupdeleteGroup, listAn operation was done that can only be performed on a group, not on an object name.
(parent)group not foundvarious methodsThe name contains an unknown (parent) group.
name is not absolutenearly all methodsObject names have to be absolute (i.e. fully specified in the namespace).
default group name is not absolutenearly all methodsThe default group name has to be absolute (i.e. fully specified in the namespace).

PyroError-- The NameServerLocator raises PyroError "Naming Service not responding" if it failed to discover the naming service (via the getNS method).

Also, the PYROAdapter raises NoModuleError "No module named XYZ" if it cannot import a Python module. See below in the table.

Also, the startup code in configuration.py raises PyroError "Error reading config file" if Pyro's configuration file cannot be read.

Pyro Core

URIError-- The PyroURI object raises URIError "illegal URI format" when you try to create a PyroURI object from an illegal URI. Also "unknown host" means that you supplied an unknown hostname or IP address for the URI.

DaemonError-- The Daemon object raises DaemonError "Couldn't start Pyro daemon" if it was unable to start. This usually means that the required network port (socket) is temporarily unavailable because another Pyro daemon is already running on it.

PYRO Protocol adapter

Various exceptions may be raised by the PYRO protocol code:
ExceptionError stringraised bydescription
SocketClosedErrorconnection lostreceive codeThe network connection was lost while receiving data.
SocketClosedErrorconnection lostsend codeThe network connection was lost while sending data.
ProtocolErrorincompatible protocol in URIbindToURI method of PYROAdapterYou supplied an incompatible protocol ID. Use 'PYRO'.
ProtocolErrorconnection failedbindToURI method of PYROAdapterNetwork problems caused the connection to fail. Also the Pyro server may have crashed.
ProtocolErrorinvalid headerreceive codeA message with an invalid header has been received.
ProtocolErrorincompatible versionreceive codeA message from an incompatible Pyro version has been received.
ProtocolErrorunsupported protocolgetProtocolAdapterYou tried to get a protocol adapter for an unsupported protocol. Currently only the 'PYRO' protocol is supported.
ProtocolErrorcompression not supportedreceive codeAn incoming message used compression, which this Pyro setup doesn't support (most likely you don't have the zlib module).
ProtocolErrorunknown object IDreceive codeIncoming method call for an unknown object (i.e. the object ID was not found in the Daemon's list of active objects).
NoModuleErrorNo module named XYZremote method call codeThe Pyro server cannot import the Python module XYZ that contains the code for an object that was passed in a remote call. If you don't use mobile code, the Pyro server must have all .py files available.
PyroErrorattempt to supply code deniedremote method call codeEither a client tried to submit code to a server that hasn't enabled mobile code, or the server had enabled mobile code but the codeValidator refused to accept it.
ConnectionDeniedErrorunspecified reasonbindToURI method of PYROAdapterNo specific reason given for denying the connection
ConnectionDeniedErrorserver too busybindToURI method of PYROAdapterThe Pyro server has too many connections at this time so your request for another connection was denied.
ConnectionDeniedErrorhost blockedbindToURI method of PYROAdapterThe server blocks your host/IP address.
ConnectionDeniedErrorsecurity reasonsbindToURI method of PYROAdapterGeneral security issue prevented a connection.

Util

KeyError-- The ArgParser will raise KeyError "no such option" if you try to getOpt an option that has not been detected in the option string and you have not supplied a default value to getOpt (otherwise that default value is returned).

Troubleshooting

ProblemPossible causeHint/tip
The naming service or my own Pyro server refuses to start, aborts with DaemonError The daemon can't set up the network port (socket), probably because another daemon is already running, or another process occupies the resource. Wait a little while and try again (sometimes it takes a while for resources to become available again). If this doesn't work, find the other daemon that is probably running and shut it down, or specify another port for the new daemon. Sorry, but your new process can't yet use the daemon of another running process - perhaps in a future Pyro version.
Pyro refuses to initialize, aborts with IOError and/or things saying 'permission denied' or similar You probably specified a wrong location for Pyro's storage directory and/or logfiles. Perhaps you don't have permission to write in those locations.Fix those locations by changing the configuration items. Make sure you have permission to write to those locations. Usually PYRO_STORAGE must be changed to point to a correct directory.
My code can't find the Naming Service, it aborts with "Naming Service not responding" The Pyro Naming Service is not running or it can't be discovered automatically. The latter may be the case if your network doesn't support broadcasts or if the NS is running on a different subnet that cannot be reached by a broadcast. Start the NS if it's not running. If the problem persists, you have to help the NameServerLocator by specifying the host and perhaps even the port number where the NS is running. You can also try to obtain the NS' URI string and create a proxy directly from this string, bypassing the NameServerLocator.
Naming server responds with 'group not found', 'no group', 'name not found' or 'name not absolute' errors but I'm sure that the names are correct.You probably have reconfigured the special name characters for the group separator and root character (PYRO_NS_GROUPSEP, PYRO_NS_ROOTCHAR) wrong, or the Name Server uses a different configuration as your current process.Check the log to see the configuration that is used by Pyro. Make sure the special characters are indeed a valid character, different from each other, and the same in your current program and in the Name Server.
'name not absolute' errors after changing default namespace group.The default group name for the PYRO_NS_DEFAULTGROUP config item must be an absolute name (starting with the root char).Change it to an absolute name.
Pyro crashes.Most likely a bug.Contact me.