Problems with initialize/prepopulate when installing on Mac
  • Been at this for a couple days, so apologies if a solution's already been posted that I haven't seen. I'm trying the manual install on a Mac with OSX El Capitan. 

    When I hit the step to initialize/prepopulate data, I always run into the following error, which appears tied to elasticsearch (command is "python3 manage.py app:initialize_data && python3 manage.py app:prepopulate"):

    INFO:superdesk.websockets_comms:Connecting to broker redis://localhost:6379
    INFO:superdesk.websockets_comms:Connected to broker redis://localhost:6379
    INFO:superdesk:got lock task=elastic host=hostid:KnarfMac.local pid:21900
    INFO:urllib3.connectionpool:Starting new HTTP connection (1): localhost
    INFO:elasticsearch:HEAD http://localhost:9200/superdesk [status:200 request:0.019s]
    WARNING:elasticsearch:PUT /superdesk/_mapping/published?ignore_conflicts=true [status:400 request:0.049s]
    WARNING:elastic:mapping error, updating settings resource=published
    INFO:elasticsearch:HEAD http://localhost:9200/superdesk [status:200 request:0.003s]
    INFO:elasticsearch:POST http://localhost:9200/superdesk/_close [status:200 request:0.043s]
    INFO:elasticsearch:PUT http://localhost:9200/superdesk/_settings [status:200 request:0.027s]
    INFO:elasticsearch:POST http://localhost:9200/superdesk/_open [status:200 request:0.026s]
    WARNING:elasticsearch:PUT /superdesk/_mapping/published?ignore_conflicts=true [status:400 request:0.017s]
    INFO:superdesk:releasing lock task=elastic host=hostid:KnarfMac.local pid:21900
    Traceback (most recent call last):
      File "/Users/brianfrank/pyvenv/superdesk/lib/python3.5/site-packages/eve_elastic/elastic.py", line 264, in put_mapping
        self.es.indices.put_mapping(**kwargs)
      File "/Users/brianfrank/pyvenv/superdesk/lib/python3.5/site-packages/elasticsearch/client/utils.py", line 69, in _wrapped
        return func(*args, params=params, **kwargs)
      File "/Users/brianfrank/pyvenv/superdesk/lib/python3.5/site-packages/elasticsearch/client/indices.py", line 289, in put_mapping
        '_mapping', doc_type), params=params, body=body)
      File "/Users/brianfrank/pyvenv/superdesk/lib/python3.5/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 "/Users/brianfrank/pyvenv/superdesk/lib/python3.5/site-packages/elasticsearch/connection/http_urllib3.py", line 93, in perform_request
        self._raise_error(response.status, raw_data)
      File "/Users/brianfrank/pyvenv/superdesk/lib/python3.5/site-packages/elasticsearch/connection/base.py", line 105, in _raise_error
        raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)
    elasticsearch.exceptions.RequestError: TransportError(400, 'illegal_argument_exception')

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "manage.py", line 18, in <module>
        app = get_app()
      File "/Users/brianfrank/coding/_code/projects-home/superdesk/server/app.py", line 53, in get_app
        app = superdesk_app(config, media_storage)
      File "/Users/brianfrank/pyvenv/superdesk/lib/python3.5/site-packages/superdesk/factory/app.py", line 121, in get_app
        app.data.init_elastic(app)
      File "/Users/brianfrank/pyvenv/superdesk/lib/python3.5/site-packages/superdesk/datalayer.py", line 48, in init_elastic
        self.elastic.init_index(app)
      File "/Users/brianfrank/pyvenv/superdesk/lib/python3.5/site-packages/eve_elastic/elastic.py", line 182, in init_index
        self.put_mapping(app, index)
      File "/Users/brianfrank/pyvenv/superdesk/lib/python3.5/site-packages/eve_elastic/elastic.py", line 268, in put_mapping
        self.es.indices.put_mapping(**kwargs)
      File "/Users/brianfrank/pyvenv/superdesk/lib/python3.5/site-packages/elasticsearch/client/utils.py", line 69, in _wrapped
        return func(*args, params=params, **kwargs)
      File "/Users/brianfrank/pyvenv/superdesk/lib/python3.5/site-packages/elasticsearch/client/indices.py", line 289, in put_mapping
        '_mapping', doc_type), params=params, body=body)
      File "/Users/brianfrank/pyvenv/superdesk/lib/python3.5/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 "/Users/brianfrank/pyvenv/superdesk/lib/python3.5/site-packages/elasticsearch/connection/http_urllib3.py", line 93, in perform_request
        self._raise_error(response.status, raw_data)
      File "/Users/brianfrank/pyvenv/superdesk/lib/python3.5/site-packages/elasticsearch/connection/base.py", line 105, in _raise_error
        raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)
    elasticsearch.exceptions.RequestError: TransportError(400, 'illegal_argument_exception')

    I'm not brand new to python and virtual environments, though I consider myself a novice. I believe I have the redis-server and elastic search running when I do this. I've started them in separate terminal tabs and see them running. Mongodb is also activated. I've also seen other threads/tickets that suggest Superdesk relies on older versions of mongodb and elasticsearch, so I've tried installing the latest versions of both but also wiping them out and going back to mongodb 2.6 and elasticsearch 1.7 (Homebrew doesn't appear to have elasticsearch 1.5, which is what a commenter said in the ticket Superdesk is supposed to be using). 

    Any feedback or other Mac users having the same trouble getting Superdesk up and running?
  • 4 Comments sorted by
  • Same, I can't get Superdesk running on Mac
  • Same, got stuck at the prepopulate stage as above. Now it seems difficult to start over.

    MacBookPro11,1
    OS X 10.10.5 (14F1912)

    Can't paste a report because the session quit when I tried to get out of pyvenv (assumed "exit" would do it).
  • Hi Brian, it looks like I have exactly the same issue (as it seems does a number of other people), same specs. Did you manage to find a root cause of the problem?

    Thank you
    Post edited by Matt Luke at 2016-11-21 20:01:25
  • I also ran into this same error on OSX. I was still able to run the client and the server even after failing to prepopulate.

    I looked through the scripts/docker-local-create-user.sh and found this line to create a new user:

    python3 manage.py users:create -u admin -p admin -e 'admin@example.com' --admin

    So i ran that and was able to log in. However, now i'm getting server 500 errors in the browser console. Could be because there's missing data from the database. Would not recommend this method currently.