Ghostwriter icon indicating copy to clipboard operation
Ghostwriter copied to clipboard

Installation fails under Debian Testing

Open mtausig opened this issue 3 years ago • 1 comments

Describe the bug

If I am trying to run the installation procedures as outlined in the Quickstart section of the documentation, an error occurs du to some incompatibility in a Python library

To Reproduce Steps to reproduce the behavior:

  1. Go to https://www.ghostwriter.wiki
  2. Follow the installation instruction at https://www.ghostwriter.wiki/getting-started/quickstart
  3. See error
$ ./ghostwriter-cli install
[+] Starting production environment installation
[*] Generating new `ghostwriter.crt` and `ghostwriter.key` files
[*] Skipping DH params because /home/acme/Ghostwriter/ssl/dhparam.pem already exists
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 214, in _retrieve_server_version
    return self.version(api_version=False)["ApiVersion"]
  File "/usr/lib/python3/dist-packages/docker/api/daemon.py", line 181, in version
    return self._result(self._get(url), json=True)
  File "/usr/lib/python3/dist-packages/docker/utils/decorators.py", line 46, in inner
    return f(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 237, in _get
    return self.get(url, **self._set_request_timeout(kwargs))
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 542, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 515, in request
    prep = self.prepare_request(req)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 443, in prepare_request
    p.prepare(
  File "/usr/lib/python3/dist-packages/requests/models.py", line 318, in prepare
    self.prepare_url(url, params)
  File "/usr/lib/python3/dist-packages/requests/models.py", line 384, in prepare_url
    scheme, auth, host, port, path, query, fragment = parse_url(url)
  File "/usr/lib/python3/dist-packages/urllib3/util/url.py", line 409, in parse_url
    ensure_func = six.ensure_text
AttributeError: module 'six' has no attribute 'ensure_text'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 33, in <module>
    sys.exit(load_entry_point('docker-compose==1.29.2', 'console_scripts', 'docker-compose')())
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 81, in main
    command_func()
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 200, in perform_command
    project = project_from_options('.', options)
  File "/usr/lib/python3/dist-packages/compose/cli/command.py", line 60, in project_from_options
    return get_project(
  File "/usr/lib/python3/dist-packages/compose/cli/command.py", line 152, in get_project
    client = get_client(
  File "/usr/lib/python3/dist-packages/compose/cli/docker_client.py", line 41, in get_client
    client = docker_client(
  File "/usr/lib/python3/dist-packages/compose/cli/docker_client.py", line 170, in docker_client
    client = APIClient(use_ssh_client=not use_paramiko_ssh, **kwargs)
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 197, in __init__
    self._version = self._retrieve_server_version()
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 221, in _retrieve_server_version
    raise DockerException(
docker.errors.DockerException: Error while fetching server API version: module 'six' has no attribute 'ensure_text'
[-] Error from `docker-compose`: exit status 1
2022/07/08 11:57:01 Error trying to build with production.yml: exit status 1

Expected Behavior

Ghostwriter should be installed or the documentation should specify more clearly what the dependencies are and which distributions are supported.

Server Specs:

  • OS: Kali Linux (equivalent to Debian Testing)
  • Docker 20.10.14+dfsg1, docker-compose 1.29.2, docker-py 5.0.3
  • Ghostwriter 3.0.0

mtausig avatar Jul 08 '22 10:07 mtausig

Hey @mtausig,

There have been issues installing the pinned libraries on Kali in the past. Kali uses its own repositories and is often based on a fork of Debian that is one or two versions behind the latest Debian. This error is caused by an older version of six. Switching to Debian or Ubuntu should resolve this for you.

You can also try upgrading six for docker-py on Kali (ref: https://github.com/docker/docker-py/issues/2294).

chrismaddalena avatar Jul 26 '22 15:07 chrismaddalena