Skip to content

Instantly share code, notes, and snippets.

@glenn-sorrentino
Created April 3, 2024 01:13
Show Gist options
  • Save glenn-sorrentino/4f2cc83825d06c63afdf79d43d0dc5e8 to your computer and use it in GitHub Desktop.
Save glenn-sorrentino/4f2cc83825d06c63afdf79d43d0dc5e8 to your computer and use it in GitHub Desktop.
glennsorrentino@m1 hushline % ansible-playbook -i 64.23.207.82, setup.yml --ask-vault-pass -e ansible_ssh_private_key_file=~/.ssh/dev -e ansible_user=root
Vault password: 

PLAY [Setup Hush Line application server] **************************************************************************************************************

TASK [Gathering Facts] *********************************************************************************************************************************
ok: [64.23.207.82]

TASK [Install required packages] ***********************************************************************************************************************
changed: [64.23.207.82]

TASK [Clone Hush Line repository] **********************************************************************************************************************
changed: [64.23.207.82]

TASK [Install Poetry] **********************************************************************************************************************************
changed: [64.23.207.82]

TASK [Create virtual environment] **********************************************************************************************************************
changed: [64.23.207.82]

TASK [Configure Poetry to use existing virtual environment] ********************************************************************************************
changed: [64.23.207.82]

TASK [Install dependencies with Poetry] ****************************************************************************************************************
fatal: [64.23.207.82]: FAILED! => {"changed": true, "cmd": "cd /var/www/html/hushline && /root/.local/bin/poetry install", "delta": "0:00:02.532450", "end": "2024-04-03 01:11:49.801724", "msg": "non-zero return code", "rc": 1, "start": "2024-04-03 01:11:47.269274", "stderr": "Skipping virtualenv creation, as specified in config file.", "stderr_lines": ["Skipping virtualenv creation, as specified in config file."], "stdout": "Installing dependencies from lock file\n\nPackage operations: 47 installs, 9 updates, 0 removals\n\n  - Updating markupsafe (2.1.2 /usr/lib/python3/dist-packages -> 2.1.5)\n\n  CalledProcessError\n\n  Command '['/usr/bin/python3.11', '-m', 'pip', 'uninstall', 'markupsafe', '-y']' returned non-zero exit status 1.\n\n  at /usr/lib/python3.11/subprocess.py:571 in run\n       567│             # We don't call process.wait() as .__exit__ does that for us.\n       568│             raise\n       569│         retcode = process.poll()\n       570│         if check and retcode:\n    →  571│             raise CalledProcessError(retcode, process.args,\n       572│                                      output=stdout, stderr=stderr)\n       573│     return CompletedProcess(process.args, retcode, stdout, stderr)\n       574│ \n       575│ \n\nThe following error occurred when trying to handle this error:\n\n\n  EnvCommandError\n\n  Command ['/usr/bin/python3.11', '-m', 'pip', 'uninstall', 'markupsafe', '-y'] errored with the following return code 1\n  \n  Output:\n  error: externally-managed-environment\n  \n  × This environment is externally managed\n  ╰─> To install Python packages system-wide, try apt install\n      python3-xyz, where xyz is the package you are trying to\n      install.\n      \n      If you wish to install a non-Debian-packaged Python package,\n      create a virtual environment using python3 -m venv path/to/venv.\n      Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make\n      sure you have python3-full installed.\n      \n      If you wish to install a non-Debian packaged Python application,\n      it may be easiest to use pipx install xyz, which will manage a\n      virtual environment for you. Make sure you have pipx installed.\n      \n      See /usr/share/doc/python3.11/README.venv for more information.\n  \n  note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.\n  hint: See PEP 668 for the detailed specification.\n  \n\n  at ~/.local/share/pypoetry/venv/lib/python3.11/site-packages/poetry/utils/env/base_env.py:342 in _run\n      338│                 output = subprocess.check_output(\n      339│                     cmd, stderr=stderr, env=env, text=True, **kwargs\n      340│                 )\n      341│         except CalledProcessError as e:\n    → 342│             raise EnvCommandError(e)\n      343│ \n      344│         return output\n      345│ \n      346│     def execute(self, bin: str, *args: str, **kwargs: Any) -> int:\n\nCannot install markupsafe.", "stdout_lines": ["Installing dependencies from lock file", "", "Package operations: 47 installs, 9 updates, 0 removals", "", "  - Updating markupsafe (2.1.2 /usr/lib/python3/dist-packages -> 2.1.5)", "", "  CalledProcessError", "", "  Command '['/usr/bin/python3.11', '-m', 'pip', 'uninstall', 'markupsafe', '-y']' returned non-zero exit status 1.", "", "  at /usr/lib/python3.11/subprocess.py:571 in run", "       567│             # We don't call process.wait() as .__exit__ does that for us.", "       568│             raise", "       569│         retcode = process.poll()", "       570│         if check and retcode:", "    →  571│             raise CalledProcessError(retcode, process.args,", "       572│                                      output=stdout, stderr=stderr)", "       573│     return CompletedProcess(process.args, retcode, stdout, stderr)", "       574│ ", "       575│ ", "", "The following error occurred when trying to handle this error:", "", "", "  EnvCommandError", "", "  Command ['/usr/bin/python3.11', '-m', 'pip', 'uninstall', 'markupsafe', '-y'] errored with the following return code 1", "  ", "  Output:", "  error: externally-managed-environment", "  ", "  × This environment is externally managed", "  ╰─> To install Python packages system-wide, try apt install", "      python3-xyz, where xyz is the package you are trying to", "      install.", "      ", "      If you wish to install a non-Debian-packaged Python package,", "      create a virtual environment using python3 -m venv path/to/venv.", "      Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make", "      sure you have python3-full installed.", "      ", "      If you wish to install a non-Debian packaged Python application,", "      it may be easiest to use pipx install xyz, which will manage a", "      virtual environment for you. Make sure you have pipx installed.", "      ", "      See /usr/share/doc/python3.11/README.venv for more information.", "  ", "  note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.", "  hint: See PEP 668 for the detailed specification.", "  ", "", "  at ~/.local/share/pypoetry/venv/lib/python3.11/site-packages/poetry/utils/env/base_env.py:342 in _run", "      338│                 output = subprocess.check_output(", "      339│                     cmd, stderr=stderr, env=env, text=True, **kwargs", "      340│                 )", "      341│         except CalledProcessError as e:", "    → 342│             raise EnvCommandError(e)", "      343│ ", "      344│         return output", "      345│ ", "      346│     def execute(self, bin: str, *args: str, **kwargs: Any) -> int:", "", "Cannot install markupsafe."]}

PLAY RECAP *********************************************************************************************************************************************
64.23.207.82  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment