Skip to content

Connection to proxy on a different host fails at Hearbeat #32

@kridgo

Description

@kridgo

I cannot connect to the docker-socket-proxy when it is running on another host. I am using this docker-compose setup to run the proxy on the remote host:

version: "3"
services:
  nextcloud-appapi-dsp:
    environment:
      - NC_HAPROXY_PASSWORD=some_secure_password
      - BIND_ADDRESS=192.168.178.5
      - EX_APPS_NET=ipv4@192.168.178.5
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    container_name: nextcloud-appapi-dsp
    hostname: nextcloud-appapi-dsp
    restart: unless-stopped
    privileged: true
    image: ghcr.io/cloud-py-api/nextcloud-appapi-dsp:release
    network_mode: host

It does start as expected when running sudo docker-compose up and I can register it as a deploy daemon in my Nextcloud server. However, when I run the Test deploy for the daemon it fails at stage Heartbeat. It does install the test deploy container on the remote host and is able to start it:

CONTAINER ID   IMAGE                                               COMMAND                CREATED          STATUS                    PORTS     NAMES
299ce125b19f   ghcr.io/cloud-py-api/test-deploy-cpu:release        "python3 main.py"      10 minutes ago   Up 10 minutes (healthy)             nc_app_test-deploy
1464ca39de38   ghcr.io/cloud-py-api/nextcloud-appapi-dsp:release   "/bin/bash start.sh"   6 days ago       Up 11 minutes (healthy)             nextcloud-appapi-dsp

Still, Nextcloud server cannot connect to it. If I check the open ports on the remote host running the proxy with sudo netstat -tulpn | grep LISTEN, I get this:

tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      1779/cupsd
tcp        0      0 127.0.0.1:46689         0.0.0.0:*               LISTEN      697/containerd
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      716/sshd: /usr/sbin
tcp        0      0 127.0.0.1:23000         0.0.0.0:*               LISTEN      3165/python3
tcp        0      0 192.168.178.5:2375      0.0.0.0:*               LISTEN      2452/haproxy
tcp6       0      0 :::22                   :::*                    LISTEN      716/sshd: /usr/sbin
tcp6       0      0 ::1:631                 :::*                    LISTEN      1779/cupsd

I guess the open port in the fourth line should be 192.168.178.23000 for the Heartbeat to work properly?

The Nextcloud server and the remote host are on the same network 192.168.178.0/24 and there is no firewall that could prevent any traffic. The remote host is a Raspberry Pi3 running Raspbian (it is setup for testing purpose only, I realize it is not a suitable platform to run the ExApps in a productive manner). It also does not help if I change the env variable for the sub containers according to the readme: - EX_APPS_NET="ipv4@127.0.0.1"

If the failing Heartbeat is not an issue of the docker-socket-proxy but my setup is messed up, any hint will be highly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions