LooLzzz / docking-station

253 stars 4 forks source link

No containers shown #8

Closed nanhoes closed 1 month ago

nanhoes commented 3 months ago

I can access the webui but no containers are shown:

IMG_0151

I’m assuming it has something to do with my compose files structure. Here’s how my structure is set up:

├── docker
│   ├── container1
│   │   ├── docker-compose.yml
│   ├── container2
│   │   ├── docker-compose.yml
│   ├── .env

Any help would be appreciated!

LooLzzz commented 3 months ago

Please post your:

Eco-Gaming commented 3 months ago

Edit: My error seems to be different, so I opened up #22.

Old message Hello, I assume this is the same error that I'm having. My Web UI looks like that as well, and I have a similar compose file layout. However, my setup worked normally a few days ago. This shows in my logs whenever I try accessing the Web UI: ~~~ INFO: 2024-07-26 17:49:56 [uvicorn.access] 127.0.0.1:59426 - "GET /api/stacks/jellyfin-tvheadend/tvheadend/task HTTP/1.1" 200 INFO: 2024-07-26 17:49:57 [uvicorn.access] 127.0.0.1:59436 - "GET /api/stacks/jellyfin-tvheadend/tvheadend/task HTTP/1.1" 200 INFO: 2024-07-26 17:49:57 [api.services.regctl] regctl image digest response: lscr.io/linuxserver/tvheadend@sha256:6375ffea5e29fd33c6a331299bf04fd7617befd2f87197e1adc89ef54cdd16af INFO: 2024-07-26 17:49:57 [uvicorn.access] 127.0.0.1:59364 - "GET /api/stacks/jellyfin-tvheadend/tvheadend?no_cache=true HTTP/1.1" 200 INFO: 2024-07-26 17:55:25 [uvicorn.access] 127.0.0.1:47260 - "GET /api/settings HTTP/1.1" 200 INFO: 2024-07-29 15:17:27 [uvicorn.access] 127.0.0.1:38618 - "GET /api/settings HTTP/1.1" 200 INFO: 2024-07-29 15:17:30 [uvicorn.access] 127.0.0.1:38622 - "GET /api/stacks HTTP/1.1" 500 ERROR: 2024-07-29 15:17:30 [uvicorn.error] Exception in ASGI application Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 399, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__ return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__ await super().__call__(scope, receive, send) File "/usr/local/lib/python3.12/site-packages/starlette/applications.py", line 123, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__ raise exc File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__ await self.app(scope, receive, _send) File "/usr/local/lib/python3.12/site-packages/starlette/middleware/cors.py", line 85, in __call__ await self.app(scope, receive, send) File "/usr/local/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 65, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 756, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 776, in app await route.handle(scope, receive, send) File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 297, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 77, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app raise exc File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 72, in app response = await func(request) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 278, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 191, in run_endpoint_function return await dependant.call(**values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/docking-station-app/src/app/api/settings/cache.py", line 231, in inner ret = await ensure_async_func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/docking-station-app/src/app/api/settings/cache.py", line 136, in ensure_async_func return await func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/docking-station-app/src/app/api/routes/stacks.py", line 29, in list_compose_stacks return await docker_services.list_compose_stacks( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/docking-station-app/src/app/api/services/docker.py", line 167, in list_compose_stacks stacks = await asyncio.gather(*[ ^^^^^^^^^^^^^^^^^^^^^^^ File "/app/docking-station-app/src/app/api/services/docker.py", line 159, in _task stack.services = await list_containers( ^^^^^^^^^^^^^^^^^^^^^^ File "/app/docking-station-app/src/app/api/services/docker.py", line 68, in list_containers await asyncio.gather(*[ File "/app/docking-station-app/src/app/api/services/docker.py", line 56, in _task res.image = await get_image( ^^^^^^^^^^^^^^^^ File "/app/docking-station-app/src/app/api/services/docker.py", line 147, in get_image raise KeyError(repository_or_tag) KeyError: 'docker.io/library/redis:7' ~~~ I run docking-station through docker compose with the default compose file and my stacks mounted like this: `/home/eco/docker/dockge/stacks:/home/eco/docker/dockge/stacks`
cryptedx commented 2 months ago

I have the same issue.

nanhoes commented 2 months ago

Logs:

INFO:     2024-08-05 03:13:41 [uvicorn.error] Application startup complete.
INFO:     2024-08-05 03:13:41 [uvicorn.error] Uvicorn running on http://0.0.0.0:3001 (Press CTRL+C to quit)
INFO:     2024-08-05 04:05:16 [uvicorn.error] Application startup complete.
INFO:     2024-08-05 04:05:16 [uvicorn.error] Uvicorn running on http://0.0.0.0:3001 (Press CTRL+C to quit)
INFO:     2024-08-05 04:17:37 [uvicorn.error] Application startup complete.
INFO:     2024-08-05 04:17:37 [uvicorn.error] Uvicorn running on http://0.0.0.0:3001 (Press CTRL+C to quit)
INFO:     2024-08-05 04:20:56 [uvicorn.access] 127.0.0.1:44790 - "GET /api/settings HTTP/1.1" 200
DEBUG:    2024-08-05 04:21:00 [api.services.regctl] regctl image digest request: thewicklowwolf/sonashow:latest
INFO:     2024-08-05 04:21:00 [uvicorn.access] 127.0.0.1:44792 - "GET /api/stacks HTTP/1.1" 500
INFO:     2024-08-05 04:21:01 [api.services.regctl] regctl image digest response: thewicklowwolf/sonashow@sha256:d4e8934f8d175e8414599860d945035a57f71e5f2667ea5a2f826fbc607f1c5c
DEBUG:    2024-08-05 04:21:01 [api.services.regctl] regctl image inspect request: thewicklowwolf/sonashow@sha256:d4e8934f8d175e8414599860d945035a57f71e5f2667ea5a2f826fbc607f1c5c
ERROR:    2024-08-05 04:21:07 [uvicorn.error] Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 399, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/cors.py", line 85, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 756, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 776, in app
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 297, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 72, in app
    response = await func(request)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 278, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
    return await dependant.call(**values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/docking-station-app/src/app/api/settings/cache.py", line 231, in inner
    ret = await ensure_async_func(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/docking-station-app/src/app/api/settings/cache.py", line 136, in ensure_async_func
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/docking-station-app/src/app/api/routes/stacks.py", line 29, in list_compose_stacks
    return await docker_services.list_compose_stacks(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/docking-station-app/src/app/api/services/docker.py", line 167, in list_compose_stacks
    stacks = await asyncio.gather(*[
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/docking-station-app/src/app/api/services/docker.py", line 159, in _task
    stack.services = await list_containers(
                     ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/docking-station-app/src/app/api/services/docker.py", line 68, in list_containers
    await asyncio.gather(*[
  File "/app/docking-station-app/src/app/api/services/docker.py", line 41, in _task
    created_at=container.created,
               ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/python_on_whales/components/container/cli_wrapper.py", line 116, in created
    return self._get_inspect_result().created
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/python_on_whales/components/container/cli_wrapper.py", line 106, in _get_inspect_result
    return super()._get_inspect_result()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/python_on_whales/client_config.py", line 217, in _get_inspect_result
    self.reload()
  File "/usr/local/lib/python3.12/site-packages/python_on_whales/client_config.py", line 209, in reload
    self._fetch_and_parse_inspect_result(self._immutable_id)
  File "/usr/local/lib/python3.12/site-packages/python_on_whales/client_config.py", line 242, in _fetch_and_parse_inspect_result
    json_object = self._fetch_inspect_result_json(reference)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/python_on_whales/components/container/cli_wrapper.py", line 98, in _fetch_inspect_result_json
    json_str = run(self.docker_cmd + ["container", "inspect", reference])
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/python_on_whales/utils.py", line 181, in run
    raise NoSuchContainer(
python_on_whales.exceptions.NoSuchContainer: The docker command executed was `/usr/bin/docker container inspect 1a2c9881d31592b9b21c35822459531fdb9ef73d35c2e105181754a45f88a7ed`.
It returned with code 1
The content of stdout is '[]
'
The content of stderr is 'Error response from daemon: No such container: 1a2c9881d31592b9b21c35822459531fdb9ef73d35c2e105181754a45f88a7ed
'

DEBUG:    2024-08-05 04:21:07 [api.services.regctl] regctl image inspect request: thewicklowwolf/sonashow@sha256:d4e8934f8d175e8414599860d945035a57f71e5f2667ea5a2f826fbc607f1c5c
ERROR:    2024-08-05 04:21:09 [api.services.regctl] Error running regctl command: Error running regctl command: time="2024-08-05T04:21:02Z" level=warning msg="Sleeping for backoff" Host=docker.io Seconds=1.999991393
time="2024-08-05T04:21:05Z" level=warning msg="Sleeping for backoff" Host=docker.io Seconds=3.999991586
failed to get manifest: failed to get manifest docker.io/thewicklowwolf/sonashow@sha256:d4e8934f8d175e8414599860d945035a57f71e5f2667ea5a2f826fbc607f1c5c: request failed: rate limit exceeded [http 429]: {
  "errors": [
    {
      "code": "TOOMANYREQUESTS",
      "message": "You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit"
    }
  ]
}
ERROR:    2024-08-05 04:21:14 [api.services.regctl] Error running regctl command: Error running regctl command: time="2024-08-05T04:21:08Z" level=warning msg="Sleeping for backoff" Host=docker.io Seconds=1.999983856
time="2024-08-05T04:21:10Z" level=warning msg="Sleeping for backoff" Host=docker.io Seconds=3.999990638
failed to get manifest: failed to get manifest docker.io/thewicklowwolf/sonashow@sha256:d4e8934f8d175e8414599860d945035a57f71e5f2667ea5a2f826fbc607f1c5c: request failed: rate limit exceeded [http 429]: {
  "errors": [
    {
      "code": "TOOMANYREQUESTS",
      "message": "You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit"
    }
  ]
}

Compose file:

services:
  docking-station:
    container_name: docking-station
    image: loolzzz/docking-station
    restart: unless-stopped
    environment:
      - WEB_PORT=3006
    ports:
      - 3006:3000
    volumes:
      - "${CONFIG_DIR}/docking-station:/config"
      - docking-station:/data
      - docking-station:/logs
      - /var/run/docker.sock:/var/run/docker.sock
      - "${CONFIG_DIR}/glance/docker-compose.yml:/glance/docker-compose.yml" # Test a single compose file

volumes:
  docking-station:
    name: docking-station
vmoriaux commented 2 months ago

I'm also using Dockge and have all my stacks in their own folders. if the compose file can't be found in the mounted compose folder you could

DLmass commented 2 months ago

I have the same problem, tried to mount each individual compose file without success.

   volumes:
      - ${DOCKING_STATION_CONFIG_FOLDER}:/config
      - ${DOCKING_STATION_DATA_FOLDER}:/data
      - ${DOCKING_STATION_LOGS_FOLDER}:/logs
      - /var/run/docker.sock:/var/run/docker.sock
      - /docker-apps/.docker-config/jellyfin/compose.yaml:/mnt/compose-files/docker-compose.jellyfin.yaml
      - /docker-apps/.docker-config/radarr/compose.yaml:/mnt/compose-files/docker-compose.radarr.yaml
      # etc... etc...
Eco-Gaming commented 2 months ago

I have the same problem, tried to mount each individual compose file without success.

   volumes:
      - ${DOCKING_STATION_CONFIG_FOLDER}:/config
      - ${DOCKING_STATION_DATA_FOLDER}:/data
      - ${DOCKING_STATION_LOGS_FOLDER}:/logs
      - /var/run/docker.sock:/var/run/docker.sock
      - /docker-apps/.docker-config/jellyfin/compose.yaml:/mnt/compose-files/docker-compose.jellyfin.yaml
      - /docker-apps/.docker-config/radarr/compose.yaml:/mnt/compose-files/docker-compose.radarr.yaml
      # etc... etc...

I believe when mounting compose files, the container and host path must match. So for your setup, the mount for you stacks should look like this: - /docker-apps/.docker-config:/docker-apps/.docker-config

Or, if you would prefer to mount each container Individually: - /docker-apps/.docker-config/jellyfin/compose.yaml:/docker-apps/.docker-config/jellyfin/compose.yaml and so on.

DLmass commented 2 months ago

Tried the first approach, non functional sadly. I also noticed that the version doesn't seem to match with what is running. I even tried to downgrade the versions of the containers, it still shows the latest version. Wonder if it is misconfiguration or just a feature of DS.

Screenshot 2024-08-15 17 04 29 https://github.com/jellyfin/jellyfin/releases

DEBUG: 2024-08-15 15:09:56 [api.services.regctl] regctl image digest request: jellyfin/jellyfin:10.9.7 INFO: 2024-08-15 15:09:58 [api.services.regctl] regctl image digest response: jellyfin/jellyfin@sha256:76930362d2c266e8f0b2f51f1c6b039a5207525d0e138a1cdbec870c66c34b0f

vmoriaux commented 2 months ago

I believe when mounting compose files, the container and host path must match. So for your setup, the mount for you stacks should look like this: - /docker-apps/.docker-config:/docker-apps/.docker-config

This worked on my dev desktop. But interestingly enough, this has no effect on my home server. So maybe there is some permission issue or something different about the Docker deployment.

My dev machine just runs Docker CE on Linux Mint and my stacks are in my home folder. My server is a TrueNAS machine, with a Debian/Docker jail hosting my containers. The stacks are in the usual Dockge "/opt/stacks" folder.

Hopefully that helps to find out what's going on.

vmoriaux commented 1 month ago

I found the answer here : https://github.com/LooLzzz/docking-station/issues/7#issuecomment-2335276275 !

LooLzzz commented 1 month ago

@nanhoes

By looking at the logs at https://github.com/LooLzzz/docking-station/issues/8#issuecomment-2268148763 it looks like you just hit the API Limit.

It should clear every 8 hours.


@vmoriaux

Glad you managed to get it working!


@DLmass

That's unrelated to this thread, anyway I think it's just a simple caching problem.

I keep a cache of the last 24h requests and use it in order to lighten the amount of requests we're hitting the docker registry (it as a request limit of 100 requests per 8 hours if I remember correctly).
So you can just press the Refresh icon and it will clear the cache and fetch the latest data for you.

If the error persists then please open a new issue with clear reproduction steps.


Closing this thread as everything is answered for.

We're tracking the regctl / KeyError issue at https://github.com/LooLzzz/docking-station/issues/7

LooLzzz commented 1 month ago

Take a look at v0.3.0