Creating the initial admin user
  • Hi,
    I just checked out the latest version of superdesk (Fri, January 20th) on Ubuntu 16.04.
    When I run the script I get the following stack trace:

    Traceback (most recent call last):
      File "", line 18, in <module>
        app = get_app(init_elastic=True)
      File "/opt/superdesk/", line 41, in get_app
        app = superdesk_app(config, init_elastic=init_elastic)
      File "/usr/local/lib/python3.4/dist-packages/superdesk/factory/", line 126, in get_app
      File "/usr/local/lib/python3.4/dist-packages/superdesk/", line 49, in init_elastic
      File "/usr/local/lib/python3.4/dist-packages/eve_elastic/", line 205, in init_index
        if not es.indices.exists(index):
      File "/usr/local/lib/python3.4/dist-packages/elasticsearch/client/", line 69, in _wrapped
        return func(*args, params=params, **kwargs)
      File "/usr/local/lib/python3.4/dist-packages/elasticsearch/client/", line 221, in exists
        raise ValueError("Empty value passed for a required argument 'index'.")
    ValueError: Empty value passed for a required argument 'index'.

    Are there any other ways to create the admin user? I tried bashing into the superdesk container and run "python3 users:create -u admin -p admin -e '' --admin" interactively. I get the same error.

    I would like to set up superdesk without demo data, but a still have an initial admin user to get started. What is the best way to install superdesk?

  • 4 Comments sorted by
  • Vote Up0Vote Down Grisha KostyukGrisha Kostyuk
    Posts: 52Member, Sourcefabric Team

    For clean installation(without demo data) you need to modify script a little:

    Create file "/tmp/" with this
    set -e

    apt-get update
    apt-get -y install git

    rm -rf $repo
    git clone --depth 1 $repo

    # this line is changed from original script
    cd $repo; ./fire i -e superdesk/10 --services --prepopulate --env="sample_data="

    echo "*********************************************************************************"
    echo "Installation complete!"
    echo "- Open in a bowser the address: http://your_server_address/"
    echo "- To login use default credentials:"
    echo "    Login: admin"
    echo "    Password: admin"
    echo "*********************************************************************************"

    and then run:
    $ sh /tmp/

    Good luck!
    Post edited by Grisha Kostyuk at 2017-01-22 14:08:03
  • Thank you for your quick reply. Unfortunately I could not try it immediately. Here is the response from my system:

    # ./fire i -e superdesk/10 --services --prepopulate --env="sample_data="
    usage: fire [-h]
    fire: error: invalid choice: 'i' (choose from 'gh-build', 'gh-clean', 'lxc-init', 'lxc-base', 'lxc-data', 'lxc-expose', 'lxc-copy', 'lxc-rm', 'lxc-ssh', 'lxc-wait', 'lxc-clean')

  • Here is a script that worked for me.

    SCRIPT_DIR="$(echo $(cd -P -- "$(dirname -- "$0")" && pwd -P))"
    (test -d $SCRIPT_DIR/env || virtualenv $SCRIPT_DIR/env ) &&
    . $SCRIPT_DIR/env/bin/activate
    set -ue
    pip install -r $SCRIPT_DIR/../docker/requirements.txt
    cd $SCRIPT_DIR/../docker

    docker-compose -p sddemo -f ./docker-compose-dev.yml run superdesk ./scripts/ bash -c "\
      python3 users:create -u admin -p admin -e 'email@xxx.xx' --admin ;\
      echo '+++ new user has been created'"
  • Vote Up0Vote Down Grisha KostyukGrisha Kostyuk
    Posts: 52Member, Sourcefabric Team
    Now this script is creating superdesk instance with minimal data (without demo data, only admin:admin is here):