lehmannro / pyhkal2

IRC bot with bling bling
7 stars 2 forks source link

uncaught 404 in CouchDB queries #23

Closed lehmannro closed 14 years ago

lehmannro commented 14 years ago

Issue occurs in getAuths of contrib.quakenet courtesy:

[IRCClient,client] calling getAuths view, asking for nick PyHKAL auth u'TiHKAL'
[IRCClient,client] Starting factory <HTTPClientFactory: http://localhost:5984/pyhkal/_view/quakenet/getAuths?key=%22TiHKAL%22>
[HTTPPageGetter,client] Unhandled error in Deferred:
[HTTPPageGetter,client] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.web.error.Error: 404 Object Not Found
[HTTPPageGetter,client] Stopping factory <HTTPClientFactory: http://localhost:5984/pyhkal/_view/quakenet/getAuths?key=%22TiHKAL%22>

Same for getKarma in contrib.karma:

[IRCClient,client] Starting factory <HTTPClientFactory: http://localhost:5984/pyhkal/_view/karma/getKarma?key=%22foo%22&include_docs=true>
[HTTPPageGetter,client] Unhandled error in Deferred:
[HTTPPageGetter,client] Unhandled Error
    Traceback (most recent call last):
    Failure: twisted.web.error.Error: 404 Object Not Found
[HTTPPageGetter,client] Stopping factory <HTTPClientFactory: http://localhost:5984/pyhkal/_view/karma/getKarma?key=%22foo%22&include_docs=true>

Reporter has confirmed the getAuths view is alive.

lehmannro commented 14 years ago

Solution: wrap those queries into try-except blocks. It's weird this bug hasn't popped up earlier but this might a version issue as well.

lehmannro commented 14 years ago

I think this might be due to CouchDB's HTTP responses being changed to proper error codes in recent releases (and us still running ancient versions with 200 for everything.)

lehmannro commented 14 years ago

Fixed in c815e89c447e9a014ece658fd90444ca2c1763eb. Needs further evaluation when davenport grows a complete API.