This is the output from the django-manage shell:
ssh 197.x.x.x -t -o UserKnownHostsFile=/home/ccc/environments/monolith/known_hosts 'sudo -iu cchq bash -c '"'"'cd /home/cchq/www/monolith/current; python_env-3.6/bin/python manage.py shell'"'"''
Ubuntu 18.04.5 LTS
/home/cchq/www/monolith/releases/2020-01-13_09.37/python_env-3.6/lib/python3.6/site-packages/psycopg2/__init__.py:144: 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: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
""")
Traceback (most recent call last):
File "manage.py", line 195, in <module>
main()
File "manage.py", line 41, in main
execute_from_command_line(sys.argv)
File "/home/cchq/www/monolith/releases/2020-01-13_09.37/python_env-3.6/lib/python3.6/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/home/cchq/www/monolith/releases/2020-01-13_09.37/python_env-3.6/lib/python3.6/site-packages/django/core/management/__init__.py", line 308, in execute
settings.INSTALLED_APPS
File "/home/cchq/www/monolith/releases/2020-01-13_09.37/python_env-3.6/lib/python3.6/site-packages/django/conf/__init__.py", line 56, in __getattr__
self._setup(name)
File "/home/cchq/www/monolith/releases/2020-01-13_09.37/python_env-3.6/lib/python3.6/site-packages/django/conf/__init__.py", line 41, in _setup
self._wrapped = Settings(settings_module)
File "/home/cchq/www/monolith/releases/2020-01-13_09.37/python_env-3.6/lib/python3.6/site-packages/django/conf/__init__.py", line 110, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/home/cchq/www/monolith/releases/2020-01-13_09.37/python_env-3.6/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/cchq/www/monolith/releases/2020-01-13_09.37/settings.py", line 1437, in <module>
SHARED_BLOB_DIR_NAME
File "/home/cchq/www/monolith/releases/2020-01-13_09.37/settingshelper.py", line 28, in __init__
self.blob_dir = self._init_dir(blob_dir)
File "/home/cchq/www/monolith/releases/2020-01-13_09.37/settingshelper.py", line 37, in _init_dir
os.mkdir(path)
FileExistsError: [Errno 17] File exists: '/opt/shared_monolith/blobdb'
Connection to 197.x.x.x closed.
And the second route:
(cchq) ccc@monolith:~/commcare-cloud$ sudo -iu cchq
(monolith) cchq@monolith:~$ cd www/monolith/current
(monolith) cchq@monolith:~/www/monolith/current$ source python_env-3.6/bin/activate
(python_env-3.6) (monolith) cchq@monolith:~/www/monolith/current$ python manage.py shell
/home/cchq/www/monolith/releases/2020-01-13_09.37/python_env-3.6/lib/python3.6/site-packages/psycopg2/__init__.py:144: 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: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
""")
Traceback (most recent call last):
File "manage.py", line 195, in <module>
main()
File "manage.py", line 41, in main
execute_from_command_line(sys.argv)
File "/home/cchq/www/monolith/releases/2020-01-13_09.37/python_env-3.6/lib/python3.6/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/home/cchq/www/monolith/releases/2020-01-13_09.37/python_env-3.6/lib/python3.6/site-packages/django/core/management/__init__.py", line 308, in execute
settings.INSTALLED_APPS
File "/home/cchq/www/monolith/releases/2020-01-13_09.37/python_env-3.6/lib/python3.6/site-packages/django/conf/__init__.py", line 56, in __getattr__
self._setup(name)
File "/home/cchq/www/monolith/releases/2020-01-13_09.37/python_env-3.6/lib/python3.6/site-packages/django/conf/__init__.py", line 41, in _setup
self._wrapped = Settings(settings_module)
File "/home/cchq/www/monolith/releases/2020-01-13_09.37/python_env-3.6/lib/python3.6/site-packages/django/conf/__init__.py", line 110, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/home/cchq/www/monolith/releases/2020-01-13_09.37/python_env-3.6/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/cchq/www/monolith/releases/2020-01-13_09.37/settings.py", line 1437, in <module>
SHARED_BLOB_DIR_NAME
File "/home/cchq/www/monolith/releases/2020-01-13_09.37/settingshelper.py", line 28, in __init__
self.blob_dir = self._init_dir(blob_dir)
File "/home/cchq/www/monolith/releases/2020-01-13_09.37/settingshelper.py", line 37, in _init_dir
os.mkdir(path)
FileExistsError: [Errno 17] File exists: '/opt/shared_monolith/blobdb'
With all the redis issues earlier, I tried redeploying Redis alone and get this Ansible error before applying:
TASK [DavidWittman.redis : add redis binaries to alternatives] ******************************************************************************************************************************
fatal: [197.211.237.144]: FAILED! => {"msg": "'dict object' has no attribute 'stdout_lines'"}