Error on superuser creation

When creating a superuser with:
~/.commcare-cloud/repo$ commcare-cloud monolith django-manage make_superuser

I received the following error:

ssh -o UserKnownHostsFile=/home/ccc/environments/monolith/known_hosts 'sudo -u cchq bash -c "cd /home/cchq/www/monolith/current; python_env/bin/python make_superuser"'
Ubuntu 18.04.2 LTS
/home/cchq/www/monolith/releases/2019-07-04_19.32/python_env/local/lib/python2.7/site-packages/psycopg2/ UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <>.
2019-07-15 19:29:12,359 INFO Raven is not configured (logging is disabled). Please see the documentation for more information.
2019-07-15 19:29:13,130 INFO AXES: BEGIN LOG
Traceback (most recent call last):
  File "", line 207, in <module>
  File "/home/cchq/www/monolith/releases/2019-07-04_19.32/python_env/local/lib/python2.7/site-packages/django/core/management/", line 364, in execute_from_command_line
  File "/home/cchq/www/monolith/releases/2019-07-04_19.32/python_env/local/lib/python2.7/site-packages/django/core/management/", line 356, in execute
  File "/home/cchq/www/monolith/releases/2019-07-04_19.32/python_env/local/lib/python2.7/site-packages/django/core/management/", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/cchq/www/monolith/releases/2019-07-04_19.32/python_env/local/lib/python2.7/site-packages/django/core/management/", line 330, in execute
    output = self.handle(*args, **options)
  File "/home/cchq/www/monolith/releases/2019-07-04_19.32/corehq/apps/domain/management/commands/", line 35, in handle
    print("✓ User {} exists".format(couch_user.username))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2713' in position 0: ordinal not in range(128)

By editing the
file and removing the special characters (checkmarks etc.) on lines 35, 39, 50, 52, 55, 57, the script ran fine. I assume other scripts handle these special unicode characters differently? I haven’t dug into it yet, but no doubt someone on the Dimagi team will understand the issue.

Hi Ed,

We’ll work on a fix for that, but in the meantime, you can also log on to the machine and run the command directly. I believe this failure only occurs when run through commcare-cloud.

  • Ethan

Thanks Ethan, could you elaborate with a couple of steps or perhaps an online document? I’m new to the CommCare cloud environment.

Hi Ed

There are some basic instructions for running management commands here:

1 Like

Hi Ed,

The command to run once you’re in the appropriate environment as described in Simon’s link is:

$ ./ make_superuser

A fix for that issue is now available in the latest version of the commcare-hq code, so you should also be able to run it via commcare-cloud after your next code deploy. Thanks for reporting the issue.

1 Like

Nice! Thanks for the quick response!