mikeizbicki / cmc-csci143

big data course materials
41 stars 76 forks source link

Docker Daemon not running #454

Closed pangsark closed 9 months ago

pangsark commented 9 months ago

Hi,

When I ran docker-compose up -d --build to bring up the docker container for the pagila-hw, I got a long error message and failed.

Then I ran docker ps to verify that nothing was brought up, I got: Cannot connect to the Docker daemon at unix:///run/user/1351/docker.sock. Is the docker daemon running?

I also verified that my docker was installed and was the right version and I was wondering if there is anything I can do to connect to the daemon.

mikeizbicki commented 9 months ago

Since you didn't post the error message, there's nothing I can do to help. In general, whenever something's not working and you're asking for help, you should always copy/paste your full terminal session.

pangsark commented 9 months ago

Hi Mike,

I'm sorry about that, here is the full error message after running docker-compose up -d --build:


  from cryptography.hazmat.backends import default_backend
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 357, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.6/http/client.py", line 1285, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1331, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1280, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1046, in _send_output
    self.send(msg)
  File "/usr/lib/python3.6/http/client.py", line 984, in send
    self.connect()
  File "/home/sangpark/.local/lib/python3.6/site-packages/docker/transport/unixconn.py", line 30, in connect
    sock.connect(self.unix_socket)
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sangpark/.local/lib/python3.6/site-packages/requests/adapters.py", line 450, in send
    timeout=timeout
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 367, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/lib/python3/dist-packages/six.py", line 702, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 357, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.6/http/client.py", line 1285, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1331, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1280, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1046, in _send_output
    self.send(msg)
  File "/usr/lib/python3.6/http/client.py", line 984, in send
    self.connect()
  File "/home/sangpark/.local/lib/python3.6/site-packages/docker/transport/unixconn.py", line 30, in connect
    sock.connect(self.unix_socket)
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sangpark/.local/lib/python3.6/site-packages/docker/api/client.py", line 214, in _retrieve_server_version
    return self.version(api_version=False)["ApiVersion"]
  File "/home/sangpark/.local/lib/python3.6/site-packages/docker/api/daemon.py", line 181, in version
    return self._result(self._get(url), json=True)
  File "/home/sangpark/.local/lib/python3.6/site-packages/docker/utils/decorators.py", line 46, in inner
    return f(self, *args, **kwargs)
  File "/home/sangpark/.local/lib/python3.6/site-packages/docker/api/client.py", line 237, in _get
    return self.get(url, **self._set_request_timeout(kwargs))
  File "/home/sangpark/.local/lib/python3.6/site-packages/requests/sessions.py", line 542, in get
    return self.request('GET', url, **kwargs)
  File "/home/sangpark/.local/lib/python3.6/site-packages/requests/sessions.py", line 529, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/sangpark/.local/lib/python3.6/site-packages/requests/sessions.py", line 645, in send
    r = adapter.send(request, **kwargs)
  File "/home/sangpark/.local/lib/python3.6/site-packages/requests/adapters.py", line 501, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/sangpark/.local/bin/docker-compose", line 8, in <module>
    sys.exit(main())
  File "/home/sangpark/.local/lib/python3.6/site-packages/compose/cli/main.py", line 81, in main
    command_func()
  File "/home/sangpark/.local/lib/python3.6/site-packages/compose/cli/main.py", line 200, in perform_command
    project = project_from_options('.', options)
  File "/home/sangpark/.local/lib/python3.6/site-packages/compose/cli/command.py", line 70, in project_from_options
    enabled_profiles=get_profiles_from_options(options, environment)
  File "/home/sangpark/.local/lib/python3.6/site-packages/compose/cli/command.py", line 153, in get_project
    verbose=verbose, version=api_version, context=context, environment=environment
  File "/home/sangpark/.local/lib/python3.6/site-packages/compose/cli/docker_client.py", line 43, in get_client
    environment=environment, tls_version=get_tls_version(environment)
  File "/home/sangpark/.local/lib/python3.6/site-packages/compose/cli/docker_client.py", line 170, in docker_client
    client = APIClient(use_ssh_client=not use_paramiko_ssh, **kwargs)
  File "/home/sangpark/.local/lib/python3.6/site-packages/docker/api/client.py", line 197, in __init__
    self._version = self._retrieve_server_version()
  File "/home/sangpark/.local/lib/python3.6/site-packages/docker/api/client.py", line 222, in _retrieve_server_version
    f'Error while fetching server API version: {e}'
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))```
mikeizbicki commented 9 months ago

The last line of your error message contains

FileNotFoundError(2, 'No such file or directory')

This tells us that docker is trying to start but is missing some necessary file(s) to do so. Probably you are missing the files from the git submodule. You can verify this by running ls pagila and checking that the contents of this folder are empty. Step 1 in the instructions detail how to populate this folder, and my guess is that redoing this step will fix your problem.

pangsark commented 9 months ago

This worked well, thank you!