Cheshire3 Troubleshooting


This page contains a list of common Python and Cheshire 3 specific errors and exceptions.

It is hoped that it also offers some enlightenment as to what these errors and exception mean in terms of your configuration/code/data, and suggests how you might go about correcting them.

Common Errors and Exceptions
AttributeError: 'NoneType' object has no attribute ...

The object the system is trying to use is null i.e. of NoneType. There are several things that can cause this:
HINT: The reported attribute might give you a clue to what type the object should be.

AttributeError: x instance has no attribute 'y'

An instance of object type x, has neither an attribute or method called y.
ACTION: Check the API documentation for the object-type, and correct your script.

Cheshire3 Exception: 'x' referenced from 'y' has no configuration

An object referred to as 'x' in the configuration for object 'y' has no configuration.
ACTION: Make sure that object 'x' is configured in subConfigs, and that all references to object x use the correct identifier string.

Cheshire3 Exception: Failed to build myProtocolMap: not well-formed ...

The zeerex_srx.xml file contains XML which is not well formed.
ACTION: Check this file at the suggested line and column and make the necessary corrections

TypeError: cannot concatenate 'str' and 'int' objects

If the error message looks like the following:

File "../../code/", line 189, in generate_id
id = self.currentId +1
TypeError: cannot concatenate 'str' and 'int' objects

... then it's likely that your recordStore is trying to create a new integer by incrementing the previous one, when the previous one is a string!
ACTION: This can easily be remedied by addind the following line to the <paths> section of the <subConfig> that defines the recordStore:

<object type="idNormalizer" ref="StringIntNormalizer"/>
"No space left on device" Apache error

If there is space left on your hard drives, then it is almost certainly that the linux kernel has run out of semaphores for mod_python or Berkeley DB.
ACTION: You need to tweak the kernel performance a little. As root, you'll need to: echo "512 32000 32 512" > /proc/sys/kernel/sem. For more information, see: Clarens FAQ

TypeError: some_method() takes exactly x arguments (y given)

The method you're trying to use requires x arguments, you only supplied y arguments.
ACTION: Check the API for the required arguments for this method.
HINT: All Cheshire3 objects require an instance of type Session as the first argument to their methods.

UnicodeEncodeError: 'ascii' codec can't encode character u'\uXXXX' ...

Oh Dear! Somewhere within one of your documents/records there is a character which cannot be encoded into ascii unicode.
ACTION: Use a UnicodeDecodePreParser or PrintableOnlyPreParser to turn the unprintable unicode character into an XML character entity.

xml.sax._exceptions.SAXParseException: <unknown>:x:y: not well-formed ...

Despite the best efforts of the preParsers there is badly formed XML within the document; possibly a malformed tag, or character entity.
ACTION: Check the document source at line x, column y.