Closed citizenrich closed 8 years ago
Looks like you have the wrong redis client version. You should create a virtualenv for CasePro and install everything from pip-freeze.txt, i.e.
virtualenv env
. env/bin/activate
pip install -r pip-freeze.txt
used a venv actually, but used pip-requires not pip-freeze
Ah ok. That will install the latest latest of all dependencies which is not what CasePro is expecting.
Ok, yet more fun. Swear I'm following the dev instructions perfectly, except using pip-freeze not requires:
Traceback (most recent call last):
File "manage.py", line 8, in
Hmm did you start with a clean virtualenv before installing from pip-freeze.txt?
deactivated and rm -rf the env/ dir. Not clean enough?
Seems to be working fine on fresh Ubuntu 14.4.3 x64, just may be my Mac.
Only hiccup when using a non-local dev server is that runserver has to be opened up, and getting a strange message. Prob a bad config of mine:
[2016-02-07 13:52:32,184: ERROR/MainProcess] Task casepro.cases.tasks.process_new_unsolicited[33cfc2e0-a497-4c40-a56c-7b89d745d7f4] raised unexpected: TembaConnectionError() Traceback (most recent call last): File "/home/admin/casepro/env/local/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task R = retval = fun(_args, _kwargs) File "/home/admin/casepro/env/local/lib/python2.7/site-packages/celery/app/trace.py", line 438, in protected_call return self.run(_args, _kwargs) File "/home/admin/casepro/casepro/cases/tasks.py", line 27, in process_new_unsolicited process_new_org_unsolicited(org) File "/home/admin/casepro/casepro/cases/tasks.py", line 55, in process_new_org_unsolicited after=last_time, before=this_time, pager=pager) File "/home/admin/casepro/env/src/rapidpro-python/temba_client/v1/init.py", line 370, in get_messages return Message.deserialize_list(self._get_multiple('messages', params, pager)) File "/home/admin/casepro/env/src/rapidpro-python/temba_client/clients.py", line 193, in _get_multiple return self._get_page(endpoint, params, pager) File "/home/admin/casepro/env/src/rapidpro-python/temba_client/clients.py", line 209, in _get_page response = self._request('get', url, params=params) File "/home/admin/casepro/env/src/rapidpro-python/temba_client/clients.py", line 106, in _request raise TembaConnectionError() TembaConnectionError: Unable to connect to host
Re the UUID error, seems you've run into this issue where latest CPython breaks kombu https://github.com/celery/kombu/issues/545
I actually fixed this in the refactor branch (just requires updating the kombu version) which I'm hoping to merge later today. If you're just trying to setup a local dev instance, feel free to switch to that branch.
Re the TembaConnectionError
. CasePro can't run without a RapidPro instance to connect to. By default it expects to connect to RapidPro on http://localhost:8001/.
Thanks
other than setting the api to https://app.rapidpro.io/api/v1, is there any other reason for a temba connection error (beyond blocked ports)?
Not that I can think of. If you switch to the refactor branch you should point the API setting to https://app.rapidpro.io without the api/v1 part as it will use both v1 and v2 API versions.
cheers! will check it.
Traceback (most recent call last): File "manage.py", line 8, in
execute_from_command_line(sys.argv)
File "/Users/richard/Dropbox/Code/casepro/casepro/env/lib/python2.7/site-packages/django/core/management/init.py", line 353, in execute_from_command_line
utility.execute()
File "/Users/richard/Dropbox/Code/casepro/casepro/env/lib/python2.7/site-packages/django/core/management/init.py", line 327, in execute
django.setup()
File "/Users/richard/Dropbox/Code/casepro/casepro/env/lib/python2.7/site-packages/django/init.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/richard/Dropbox/Code/casepro/casepro/env/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/Users/richard/Dropbox/Code/casepro/casepro/env/lib/python2.7/site-packages/django/apps/config.py", line 123, in create
import_module(entry)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/Users/richard/Dropbox/Code/casepro/casepro/casepro/orgs_ext/init.py", line 5, in
from dash.orgs.models import Org
File "/Users/richard/Dropbox/Code/casepro/casepro/env/src/dash-master/dash/orgs/models.py", line 7, in
from dash.api import API
File "/Users/richard/Dropbox/Code/casepro/casepro/env/src/dash-master/dash/api/init.py", line 12, in
from redis_cache import get_redis_connection
File "/Users/richard/Dropbox/Code/casepro/casepro/env/lib/python2.7/site-packages/redis_cache/init.py", line 1, in
from django_redis import get_redis_connection
File "/Users/richard/Dropbox/Code/casepro/casepro/env/lib/python2.7/site-packages/django_redis/init.py", line 3, in
from django.core.cache import get_cache
ImportError: cannot import name get_cache