在我研究pycassa API期间,我下载了一个示例项目Twissandra。
我用cassandra配置它,登录后我添加推文时发生以下错误......
Environment:
Request Method: POST
Request URL: http://127.0.0.1:8000/
Django Version: 1.3.1
Python Version: 2.7.2
Installed Applications:
['django.contrib.sessions', 'tweets', 'users']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'users.middleware.UserMiddleware')
Traceback:
File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "C:\Users\Muhammad Umair\workspace\Twissandra\src\Twissandra\tweets\views.py" in
timeline
20. 'body': form.cleaned_data['body'],
File "C:\Users\Muhammad Umair\workspace\Twissandra\src\Twissandra\cass.py" in
save_tweet
216. USERLINE.insert(str(username), {ts: str(tweet_id)})
File "C:\Python27\lib\site-packages\pycassa-1.3.0-py2.7.egg\pycassa\columnfamily.py" in insert
860. colval = self._pack_value(columns.values()[0], colname)
File "C:\Python27\lib\site-packages\pycassa-1.3.0-py2.7.egg\pycassa\columnfamily.py" in _pack_value
428. return packer(value)
File "C:\Python27\lib\site-packages\pycassa-1.3.0-py2.7.egg\pycassa\marshal.py" in pack_uuid
202. randomize=True)
File "C:\Python27\lib\site-packages\pycassa-1.3.0-py2.7.egg\pycassa\util.py" in convert_time_to_uuid
66. 'neither a UUID, a datetime, or a number')
Exception Type: ValueError at /
Exception Value: Argument for a v1 UUID column name or value was neither a UUID, a datetime, or a number
答案 0 :(得分:0)
您是修改了Cassandra列族还是自己创建它们?也许你正在使用旧版Twissandra?
这个特定的堆栈跟踪显示pycassa期望列值的UUID,但在最新版本的Twissandra中,列值都是BytesType(无类型)。