Well, I found the problem after some trying.
My client had asked me to use Lubuntu 14.04 and I innocently did.
But when I asked him why, he could give no reason.
So I tried setting up a new VM using Lubuntu 16.04, it worked fine.
Problem was python version, as someone had kindly pointed (just cannot find
the post to name you now but thank you anyway).
Now that is solved and I could run manage.py decently.
But while following with installation I got some new error:
- while bootstraping a project, I got the following error:
root@demo:~/commcare-hq# ./manage.py bootstrap demo john.doe@some-site.com
demo
corehq.util.log.HqAdminEmailHandler logger is being changed to
logging.StreamHandler
corehq.util.log.NotifyExceptionEmailer logger is being changed to
logging.StreamHandler
2016-06-24 01:43:36,967 INFO Starting new HTTP connection (1):
trk.kissmetrics.com
2016-06-24 01:43:39,006 INFO Starting new HTTP connection (1): localhost
2016-06-24 01:43:39,314 INFO Starting new HTTP connection (1): localhost
Notify Exception: Error occured while syncing user john.doe@some-site.com:
HTTPError(u'401 Client Error: Unauthorized for url:
https://api.hubapi.com/contacts/v1/contact/email/john.doe%40some-site.com/profile?hapikey=*****',)
None
2016-06-24 01:43:42,294 ERROR Notify Exception: Error occured while syncing
user john.doe@some-site.com: HTTPError(u'401 Client Error: Unauthorized for
url:
https://api.hubapi.com/contacts/v1/contact/email/john.doe%some-site.com/profile?hapikey=*****',)
None
user john.doe@some-site.com created and added to domain demo
root@demo:~/commcare-hq#
Not sure how important this is, but my client created an account in that
site, then I created a contact using curl and an example from the site. The
API responded with a user ID so it does look as it has worked ok.
If I try to run bootstrap again it serves the same error.
-
When trying to create the elasticsearch indexes I got two errors.
Not sure what they mean.
Am using 1.7.4 because the instructions I got said to do so (are they too
old?)
Thanks in advance for any help.
This is the first error:
demo@demo:~/commcare-hq$ ./manage.py run_ptop --pillow-key=core
corehq.util.log.HqAdminEmailHandler logger is being changed to
logging.StreamHandler
corehq.util.log.NotifyExceptionEmailer logger is being changed to
logging.StreamHandler
2016-06-24 01:00:21,685 INFO Starting new HTTP connection (1): localhost
2016-06-24 01:00:21,718 INFO Starting new HTTP connection (2): localhost
2016-06-24 01:00:21,719 INFO Starting new HTTP connection (3): localhost
2016-06-24 01:00:21,720 INFO Starting new HTTP connection (4): localhost
Traceback (most recent call last):
File "./manage.py", line 96, in
execute_from_command_line(sys.argv)
File
"/home/demo/.local/lib/python2.7/site-packages/django/core/management/init.py",
line 385, in execute_from_command_line
utility.execute()
File
"/home/demo/.local/lib/python2.7/site-packages/django/core/management/init.py",
line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File
"/home/demo/.local/lib/python2.7/site-packages/django/core/management/base.py",
line 288, in run_from_argv
self.execute(*args, **options.dict)
File
"/home/demo/.local/lib/python2.7/site-packages/django/core/management/base.py",
line 338, in execute
output = self.handle(*args, **options)
File
"/home/demo/.local/lib/python2.7/site-packages/django/core/management/base.py",
line 533, in handle
return self.handle_noargs(**options)
File "./corehq/ex-submodules/pillowtop/management/commands/run_ptop.py",
line 80, in handle_noargs
start_pillows(pillows=[pillow_config.get_instance() for pillow_config
in pillows_to_run])
File "./corehq/ex-submodules/pillowtop/utils.py", line 63, in get_instance
return get_pillow_instance(self.class_name)
File "./corehq/ex-submodules/pillowtop/utils.py", line 22, in
get_pillow_instance
return pillow_class()
File "./corehq/ex-submodules/pillowtop/listener.py", line 416, in init
completely_initialize_pillow_index(self)
File "./corehq/ex-submodules/pillowtop/es_utils.py", line 68, in
completely_initialize_pillow_index
return initialize_index_and_mapping(pillow.get_es_new(),
get_index_info_from_pillow(pillow))
File "./corehq/ex-submodules/pillowtop/es_utils.py", line 72, in
initialize_index_and_mapping
index_exists = es.indices.exists(index_info.index)
File
"/home/demo/.local/lib/python2.7/site-packages/elasticsearch/client/utils.py",
line 69, in _wrapped
return func(*args, params=params, **kwargs)
File
"/home/demo/.local/lib/python2.7/site-packages/elasticsearch/client/indices.py",
line 224, in exists
params=params)
File
"/home/demo/.local/lib/python2.7/site-packages/elasticsearch/transport.py",
line 307, in perform_request
status, headers, data = connection.perform_request(method, url, params,
body, ignore=ignore, timeout=timeout)
File
"/home/demo/.local/lib/python2.7/site-packages/elasticsearch/connection/http_urllib3.py",
line 89, in perform_request
raise ConnectionError('N/A', str(e), e)
elasticsearch.exceptions.ConnectionError:
ConnectionError(<urllib3.connection.HTTPConnection object at
0x7fe780bef3d0>: Failed to establish a new connection: [Errno 111]
Connection refused) caused by:
NewConnectionError(<urllib3.connection.HTTPConnection object at
0x7fe780bef3d0>: Failed to establish a new connection: [Errno 111]
Connection refused)
And this is the second error:
demo@demo:~/commcare-hq$ ./manage.py ptop_es_manage --flip_all_aliases
corehq.util.log.HqAdminEmailHandler logger is being changed to
logging.StreamHandler
corehq.util.log.NotifyExceptionEmailer logger is being changed to
logging.StreamHandler
2016-06-25 02:27:52,261 INFO Starting new HTTP connection (1): localhost
2016-06-25 02:27:52,321 INFO Starting new HTTP connection (2): localhost
2016-06-25 02:27:52,322 INFO Starting new HTTP connection (3): localhost
2016-06-25 02:27:52,322 INFO Starting new HTTP connection (4): localhost
Traceback (most recent call last):
File "./manage.py", line 96, in
execute_from_command_line(sys.argv)
File
"/home/demo/.local/lib/python2.7/site-packages/django/core/management/init.py",
line 385, in execute_from_command_line
utility.execute()
File
"/home/demo/.local/lib/python2.7/site-packages/django/core/management/init.py",
line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File
"/home/demo/.local/lib/python2.7/site-packages/django/core/management/base.py",
line 288, in run_from_argv
self.execute(*args, **options.dict)
File
"/home/demo/.local/lib/python2.7/site-packages/django/core/management/base.py",
line 338, in execute
output = self.handle(*args, **options)
File
"./corehq/ex-submodules/pillowtop/management/commands/ptop_es_manage.py",
line 57, in handle
assume_alias(es, index_info.index, index_info.alias)
File "./corehq/ex-submodules/pillowtop/es_utils.py", line 119, in
assume_alias
if es.indices.exists_alias(None, alias):
File
"/home/demo/.local/lib/python2.7/site-packages/elasticsearch/client/utils.py",
line 69, in _wrapped
return func(*args, params=params, **kwargs)
File
"/home/demo/.local/lib/python2.7/site-packages/elasticsearch/client/indices.py",
line 407, in exists_alias
name), params=params)
File
"/home/demo/.local/lib/python2.7/site-packages/elasticsearch/transport.py",
line 307, in perform_request
status, headers, data = connection.perform_request(method, url, params,
body, ignore=ignore, timeout=timeout)
File
"/home/demo/.local/lib/python2.7/site-packages/elasticsearch/connection/http_urllib3.py",
line 89, in perform_request
raise ConnectionError('N/A', str(e), e)
elasticsearch.exceptions.ConnectionError:
ConnectionError(<urllib3.connection.HTTPConnection object at
0x7f84dd49e5d0>: Failed to establish a new connection: [Errno 111]
Connection refused) caused by:
NewConnectionError(<urllib3.connection.HTTPConnection object at
0x7f84dd49e5d0>: Failed to establish a new connection: [Errno 111]
Connection refused)
demo@demo:~/commcare-hq$
*** end of post ***