Error on fab restart_services

I'm receiving this error on the fab restart_services command:

(ansible) ccc@monolith:~/commcare-cloud$ cchq monolith fab restart_services
fab -f /home/ccc/commcare-cloud/src/commcare_cloud/fabfile.py monolith restart_services --disable-known-hosts --system-known-hosts /home/ccc/environments/monolith/known_hosts
Traceback (most recent call last):
  File "/home/ccc/.virtualenvs/ansible/local/lib/python2.7/site-packages/fabric/main.py", line 743, in main
    *args, **kwargs
  File "/home/ccc/.virtualenvs/ansible/local/lib/python2.7/site-packages/fabric/tasks.py", line 427, in execute
    results['<local-only>'] = task.run(*args, **new_kwargs)
  File "/home/ccc/.virtualenvs/ansible/local/lib/python2.7/site-packages/fabric/tasks.py", line 174, in run
    return self.wrapped(*args, **kwargs)
  File "/home/ccc/commcare-cloud/src/commcare_cloud/fab/fabfile.py", line 190, in _setup_env
    execute(env_common)
  File "/home/ccc/.virtualenvs/ansible/local/lib/python2.7/site-packages/fabric/tasks.py", line 427, in execute
    results['<local-only>'] = task.run(*args, **new_kwargs)
  File "/home/ccc/.virtualenvs/ansible/local/lib/python2.7/site-packages/fabric/tasks.py", line 174, in run
    return self.wrapped(*args, **kwargs)
  File "/home/ccc/commcare-cloud/src/commcare_cloud/fab/fabfile.py", line 248, in env_common
    env.deploy_metadata = DeployMetadata(env.code_branch, env.deploy_env)
  File "/home/ccc/.virtualenvs/ansible/local/lib/python2.7/site-packages/fabric/utils.py", line 213, in __getattr__
    raise AttributeError(key)
AttributeError: code_branch

I seem to recall reading a message about fab commands being deprecated, but I could have misread. If that's the case, what is the new command for restarting all services, can I just use supervisorctl restart all?

Hi Ed

I think that error is related to moving more of our deploy commands directly under commcare-cloud.

You can use the following command to restart all CommCare processes:

commcare-cloud <env> service commcare restart
1 Like

Thanks Simon. Are these documented somewhere?
Cheers
Ed

These are documented here: https://dimagi.github.io/commcare-cloud/commcare-cloud/commands/#service

1 Like

Awesome, thanks Simon!