No username error using docker compose

When trying to use docker-compose up --build I get the following error:

Pulling thesis_db (postgres:)...
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/docker/credentials/store.py", line 83, in _execute
    output = subprocess.check_output(
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/bin/docker-credential-desktop', 'get']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/docker/auth.py", line 262, in _resolve_authconfig_credstore
    data = store.get(registry)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/docker/credentials/store.py", line 34, in get
    data = self._execute('get', server)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/docker/credentials/store.py", line 87, in _execute
    raise errors.process_store_error(e, self.program)
docker.credentials.errors.StoreError: Credentials store docker-credential-desktop exited with "error getting credentials - err: exit status 1, out: `no usernames for https://index.docker.io/v1/`".

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.12/site-packages/compose/cli/main.py", line 81, in main
    command_func()
  File "/usr/lib/python3.12/site-packages/compose/cli/main.py", line 203, in perform_command
    handler(command, command_options)
  File "/usr/lib/python3.12/site-packages/compose/metrics/decorator.py", line 18, in wrapper
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/compose/cli/main.py", line 1186, in up
    to_attach = up(False)
                ^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/compose/cli/main.py", line 1166, in up
    return self.project.up(
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/compose/project.py", line 664, in up
    svc.ensure_image_exists(do_build=do_build, silent=silent, cli=cli)
  File "/usr/lib/python3.12/site-packages/compose/service.py", line 358, in ensure_image_exists
    self.pull(silent=silent)
  File "/usr/lib/python3.12/site-packages/compose/service.py", line 1251, in pull
    return progress_stream.get_digest_from_pull(event_stream)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/compose/progress_stream.py", line 99, in get_digest_from_pull
    for event in events:
  File "/usr/lib/python3.12/site-packages/compose/service.py", line 1218, in _do_pull
    output = self.client.pull(repo, **pull_kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/docker/api/image.py", line 410, in pull
    header = auth.get_config_header(self, registry)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/docker/auth.py", line 45, in get_config_header
    authcfg = resolve_authconfig(
              ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/docker/auth.py", line 322, in resolve_authconfig
    return authconfig.resolve_authconfig(registry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/docker/auth.py", line 233, in resolve_authconfig
    cfg = self._resolve_authconfig_credstore(registry, store_name)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/docker/auth.py", line 278, in _resolve_authconfig_credstore
    raise errors.DockerException(
docker.errors.DockerException: Credentials store error: StoreError('Credentials store docker-credential-desktop exited with "error getting credentials - err: exit status 1, out: `no usernames for https://index.docker.io/v1/`".')

docker-compose.yaml

version: "3.9"

services:
  thesis-app:
    image: 'thesis-app'
    build:
      context: .
    depends_on:
      - thesis_db
    environment:
      - SPRING_DATASOURCE_URL=jdbc:postgresql://thesis_db:5432/service_based_assessment_db
      - SPRING_DATASOURCE_USERNAME=service_based_assessment_user
      - SPRING_DATASOURCE_PASSWORD=123456
      - SPRING_JPA_HIBERNATE_DDL_AUTO=update
      - SPRING_JPA_GENERATE_DDL=true
      - SPRING_JPA_SHOW_DDL=true
      - MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE=*
    ports:
      - '8080:8080'

  thesis_db:
    image: postgres
    container_name: thesis_db
    environment:
      POSTGRES_USER: service_based_assessment_user
      POSTGRES_PASSWORD: 123456
      POSTGRES_DB: service_based_assessment_db
    ports:
      - '5436:5432'

Client: Docker Engine - Community
 Cloud integration: v1.0.35+desktop.10
 Version:           25.0.1
 API version:       1.44
 Go version:        go1.21.6
 Git commit:        29cf629
 Built:             Tue Jan 23 23:11:29 2024
 OS/Arch:           linux/amd64
 Context:           desktop-linux

Server: Docker Desktop 4.27.0 (135262)
 Engine:
  Version:          25.0.1
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.21.6
  Git commit:       71fa3ab
  Built:            Tue Jan 23 23:09:46 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.27
  GitCommit:        a1496014c916f9e62104b33d1bb5bd03b0858e59
 runc:
  Version:          1.1.11
  GitCommit:        v1.1.11-0-g4bccb38
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

I should also note that docker desktop has a problem with sign in

If you have a problem with signing in, you should first solve that. but you shouldn’t use Docker Compose v1 anymore. You had a python stack trace, which indicates you use Compose v1. Try docker compose instead of docker-compose.

Don’t forget to check the general system requirements

https://docs.docker.com/desktop/install/linux-install/#general-system-requirements

especially the credential manager part