Cheshire3 Troubleshooting

Introduction

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...
AttributeError: x instance has no attribute 'y'
Cheshire3 Exception: 'x' referenced from 'y' has no configuration
Cheshire3 Exception: Failed to build eadProtocolMap: not well-formed (invalid token): line x, column y
No space left on device (in Apache log file, when there's plenty of hard drive space)
TypeError: some_method() takes exactly x arguments (y given)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2014' in position 38: ordinal not in range(128)
xml.sax._exceptions.SAXParseException: <unknown>:x:y: not well-formed (invalid token)

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 eadProtocolMap: 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

"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.
ACTION: Check the API for the required arguments for this method.
HINT: Cheshire 3 objects almost always require an instance of type Session the first of their arguments..

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 CharacterEntityPreParser 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.