mikeizbicki / cmc-csci143

big data course materials
40 stars 76 forks source link

Unable to run docker-compose up #430

Closed oliver-ricken closed 9 months ago

oliver-ricken commented 9 months ago

Hi there,

I'm having trouble running docker-compose. Previously, I had everything working correctly up until the DATABASE_URL part of the Postgres section of the tutorial. Then, when I made it to the part in the Postgres section where we build the new image and spin up the two containers, I am unable to run the following command:

docker-compose up -d --build

I'm seeing the following error message:

/home/oricken/.local/lib/python3.6/site-packages/paramiko/transport.py:32: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.6.
  from cryptography.hazmat.backends import default_backend
Pulling db (postgres:13)...
Traceback (most recent call last):
  File "/home/oricken/.local/lib/python3.6/site-packages/docker/credentials/store.py", line 77, in _execute
    [self.exe, subcmd], input=data_input, env=env,
  File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/bin/docker-credential-secretservice', 'get']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/oricken/.local/lib/python3.6/site-packages/docker/auth.py", line 262, in _resolve_authconfig_credstore
    data = store.get(registry)
  File "/home/oricken/.local/lib/python3.6/site-packages/docker/credentials/store.py", line 33, in get
    data = self._execute('get', server)
  File "/home/oricken/.local/lib/python3.6/site-packages/docker/credentials/store.py", line 80, in _execute
    raise errors.process_store_error(e, self.program)
docker.credentials.errors.StoreError: Credentials store docker-credential-secretservice exited with "Cannot autolaunch D-Bus without X11 $DISPLAY".

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/oricken/.local/bin/docker-compose", line 8, in <module>
    sys.exit(main())
  File "/home/oricken/.local/lib/python3.6/site-packages/compose/cli/main.py", line 81, in main
    command_func()
  File "/home/oricken/.local/lib/python3.6/site-packages/compose/cli/main.py", line 203, in perform_command
    handler(command, command_options)
  File "/home/oricken/.local/lib/python3.6/site-packages/compose/metrics/decorator.py", line 18, in wrapper
    result = fn(*args, **kwargs)
  File "/home/oricken/.local/lib/python3.6/site-packages/compose/cli/main.py", line 1186, in up
    to_attach = up(False)
  File "/home/oricken/.local/lib/python3.6/site-packages/compose/cli/main.py", line 1182, in up
    attach_dependencies=attach_dependencies,
  File "/home/oricken/.local/lib/python3.6/site-packages/compose/project.py", line 664, in up
    svc.ensure_image_exists(do_build=do_build, silent=silent, cli=cli)
  File "/home/oricken/.local/lib/python3.6/site-packages/compose/service.py", line 358, in ensure_image_exists
    self.pull(silent=silent)
  File "/home/oricken/.local/lib/python3.6/site-packages/compose/service.py", line 1251, in pull
    return progress_stream.get_digest_from_pull(event_stream)
  File "/home/oricken/.local/lib/python3.6/site-packages/compose/progress_stream.py", line 99, in get_digest_from_pull
    for event in events:
  File "/home/oricken/.local/lib/python3.6/site-packages/compose/service.py", line 1218, in _do_pull
    output = self.client.pull(repo, **pull_kwargs)
  File "/home/oricken/.local/lib/python3.6/site-packages/docker/api/image.py", line 409, in pull
    header = auth.get_config_header(self, registry)
  File "/home/oricken/.local/lib/python3.6/site-packages/docker/auth.py", line 46, in get_config_header
    client._auth_configs, registry, credstore_env=client.credstore_env
  File "/home/oricken/.local/lib/python3.6/site-packages/docker/auth.py", line 322, in resolve_authconfig
    return authconfig.resolve_authconfig(registry)
  File "/home/oricken/.local/lib/python3.6/site-packages/docker/auth.py", line 233, in resolve_authconfig
    cfg = self._resolve_authconfig_credstore(registry, store_name)
  File "/home/oricken/.local/lib/python3.6/site-packages/docker/auth.py", line 279, in _resolve_authconfig_credstore
    f'Credentials store error: {repr(e)}'
docker.errors.DockerException: Credentials store error: StoreError('Credentials store docker-credential-secretservice exited with "Cannot autolaunch D-Bus without X11 $DISPLAY".',)

Apologies for the long error.

I then restored the contents of my earlier working branch, and then saw the same error reproduced when I tried to build the first original container in the Docker section of the tutorial. Unfortunately it looks like the error followed me!

Also, I don't think the issue is related to my docker-compose installation, because when I run the following test:

which docker-compose

I see that docker-compose is located here: /home/oricken/.local/bin/docker-compose

Does anyone have any idea how I could go about solving this? Any help is much appreciated! :)

irajmoradi commented 9 months ago

Hello,

I think this github issue faced a similar issue and fixed it through a change in a file. I would recommend clicking the link and using the fix there.

Sincerely, Iraj Moradi

mikeizbicki commented 9 months ago

Adding to @irajmoradi 's answer, the zoom recording has been uploaded. You can find a discussion of this problem at around 41 minutes: https://www.youtube.com/watch?v=gsgoULBFfkA?t=41m

oliver-ricken commented 9 months ago

That worked perfectly. Thank you, @irajmoradi and @mikeizbicki for pointing me in the right direction!