Skip to content

Failed to setup daemon for nextcloud within docker and direkt access to docker socket.  #153

@StefanRichterHuber

Description

@StefanRichterHuber

Describe the bug

I am running nextcloud successfully using docker and traefik as reverse-proxy for ssl and routing.
The docker host machine is a QNAP ARM64 NAS.
To install App_Api I added the docker socket as proxy as volume to the nextcloud container. I also added an additional docker network for the apps.

networks:
  web:
    external: true
  nextcloud-apps:
    external: true
 app:
    image: nextcloud:27
    depends_on:
      - database
      - redis-nextcloud
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - nextcloud:/var/www/html
    env_file:
      ... Reference to local env file
    ports:
      - 8085:80
    restart: always
    labels:
    ... Removed traefik config
    networks:
      - web
      - default
      - nextcloud-apps

Then I added a deamon r:
occ app_api:daemon:register --net nextcloud-apps --set-default docker_local_sock "Local docker" docker-install unix-socket /var/run/docker.sock https://nextcloud.[mydomain].de

Results in:
Daemon successfully registered.

Within the admin ui I try to verify the connection, but get an error: Failed to connect to Daemon. Check the logs.

Does not work with host network either.

Steps/Code to Reproduce

See above

Expected Results

Successful connection to AppAPI daemon

Actual Results

[app_api] Fehler: GuzzleHttp\Exception\ConnectException: cURL error 7: Failed to connect to localhost port 80 after 0 ms: Couldn't connect to server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://localhost/v1.41/_ping at <>

  1. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 158
    GuzzleHttp\Handler\CurlFactory::createRejection("*** sensitive parameters replaced ***")
  2. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 110
    GuzzleHttp\Handler\CurlFactory::finishError(["GuzzleHttp\Handler\CurlHandler"], "*** sensitive parameters replaced ***", ["GuzzleHttp\Handler\CurlFactory"])
  3. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php line 47
    GuzzleHttp\Handler\CurlFactory::finish(["GuzzleHttp\Handler\CurlHandler"], "*** sensitive parameters replaced ***", ["GuzzleHttp\Handler\CurlFactory"])
  4. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/Proxy.php line 28
    GuzzleHttp\Handler\CurlHandler->__invoke("*** sensitive parameters replaced ", " sensitive parameters replaced ***")
  5. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/Proxy.php line 48
    GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler{closure}("*** sensitive parameters replaced ***")
  6. /var/www/html/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php line 35
    GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler{closure}("*** sensitive parameters replaced ***")
  7. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 31
    GuzzleHttp\PrepareBodyMiddleware->__invoke("*** sensitive parameters replaced ", " sensitive parameters replaced ***")
  8. /var/www/html/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php line 71
    GuzzleHttp\Middleware::GuzzleHttp{closure}("*** sensitive parameters replaced ***")
  9. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 63
    GuzzleHttp\RedirectMiddleware->__invoke("*** sensitive parameters replaced ", " sensitive parameters replaced ***")
  10. /var/www/html/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php line 75
    GuzzleHttp\Middleware::GuzzleHttp{closure}("*** sensitive parameters replaced ***")
  11. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php line 331
    GuzzleHttp\HandlerStack->__invoke("*** sensitive parameters replaced ", " sensitive parameters replaced ***")
  12. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php line 168
    GuzzleHttp\Client->transfer("*** sensitive parameters replaced ", " sensitive parameters replaced ***")
  13. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php line 187
    GuzzleHttp\Client->requestAsync("*** sensitive parameters replaced ***")
  14. /var/www/html/3rdparty/guzzlehttp/guzzle/src/ClientTrait.php line 44
    GuzzleHttp\Client->request("*** sensitive parameters replaced ***", "http://localhost/v1.41/_ping", [true])
  15. /var/www/html/custom_apps/app_api/lib/DeployActions/DockerActions.php line 283
    GuzzleHttp\Client->get("http://localhost/v1.41/_ping")
  16. /var/www/html/custom_apps/app_api/lib/Controller/DaemonConfigController.php line 104
    OCA\AppAPI\DeployActions\DockerActions->ping("http://localhost")
  17. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 230
    OCA\AppAPI\Controller\DaemonConfigController->verifyDaemonConnection("docker_local")
  18. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 137
    OC\AppFramework\Http\Dispatcher->executeController(["OCA\AppAPI\C ... "], "verifyDaemonConnection")
  19. /var/www/html/lib/private/AppFramework/App.php line 183
    OC\AppFramework\Http\Dispatcher->dispatch(["OCA\AppAPI\C ... "], "verifyDaemonConnection")
  20. /var/www/html/lib/private/Route/Router.php line 315
    OC\AppFramework\App::main("OCA\AppAPI\Co ... r", "verifyDaemonConnection", ["OC\AppFramewo ... "], ["docker_local", ... "])
  21. /var/www/html/lib/base.php line 1068
    OC\Route\Router->match("/apps/app_api/d ... k")
  22. /var/www/html/index.php line 36
    OC::handleRequest()

POST /apps/app_api/daemons/docker_local/check
from 93.104.100.117 by admin at 2023-12-15T06:25:27+00:00

Setup configuration

nextcloud = 27.1.4 appApi=1.4.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    daemondocumentationImprovements or additions to documentationfixedin upcoming release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions