Skip to content

XBS-API container continually restarting and will not remain connected to docker stack network. #15

Description

@xthursdayx

I didn't want to highjack this issue: #13 but I too am trying to run the xbrowsersync api-docker stack without caddy, so that I can then use NGINX to reverse proxy the container, since I already use it for other containers, but am running into some issues.

I've tried creating and starting the stack with the docker-compose.yml (only modified to change the mounted port) you posted in issue #13 using docker-compose up -d and have also tried creating the stack via Portainer using the docker-compose as a template. I've also tried just creating the api-docker container manually with a docker run command including all of the necessary variables and a separately created MongoDB.

For some reason in each case the MongoDB container and xbs-api container are created and the db container seems to function normally, but the xbs-api container continually restarts and won't stay connected to the xbs docker network that is created. I've tried changing the healthcheck interval, timeout length, retries, and start period, and also tried removing the healthcheck entirely, just to see, but it found the same issue, though I couldn't tell if the container was restarting or just refusing to connect to the xbrowsersync docker network and mount the 8080 port.

I am unable to access the internal container logs because the container is continually restarting and there isn't anything in the external logs for the xbs-api container. The most information I could find was by inspecting the container in Portainer, which listed this information about the container:

{
    "AppArmorProfile": "",
    "Args": [
        "node",
        "dist/api.js"
    ],
    "Config": {
        "AttachStderr": false,
        "AttachStdin": false,
        "AttachStdout": false,
        "Cmd": [
            "node",
            "dist/api.js"
        ],
        "Domainname": "",
        "Entrypoint": [
            "docker-entrypoint.sh"
        ],
        "Env": [
            "XBROWSERSYNC_DB_PWD=$$$$$$$$$$$$$$$$",
            "XBROWSERSYNC_DB_USER=xbsdb",
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
            "NODE_VERSION=14.16.0",
            "YARN_VERSION=1.22.5",
            "XBROWSERSYNC_API_VERSION=1.1.13"
        ],
        "ExposedPorts": {
            "8080/tcp": {}
        },
        "Healthcheck": {
            "Interval": 60000000000,
            "Retries": 5,
            "StartPeriod": 60000000000,
            "Test": [
                "CMD",
                "node",
                "/usr/src/api/healthcheck.js"
            ],
            "Timeout": 15000000000
        },
        "Hostname": "2fd2ed50a788",
        "Image": "xbrowsersync/api:1.1.13",
        "Labels": {
            "com.docker.compose.config-hash": "1470d7e395c3ac183006d6d8f0fe41daa500391ff16895c70eba8608a139c269",
            "com.docker.compose.container-number": "1",
            "com.docker.compose.oneoff": "False",
            "com.docker.compose.project": "xbrowsersync",
            "com.docker.compose.project.config_files": "docker-compose.yml",
            "com.docker.compose.project.working_dir": "/mnt/cache/appdata/xbrowsersync",
            "com.docker.compose.service": "api",
            "com.docker.compose.version": "1.29.2"
        },
        "OnBuild": null,
        "OpenStdin": false,
        "StdinOnce": false,
        "Tty": false,
        "User": "",
        "Volumes": {
            "/usr/src/api/config/settings.json": {},
            "/usr/src/api/healthcheck.js": {}
        },
        "WorkingDir": "/usr/src/api"
    },
    "Created": "2021-07-21T19:09:43.778416987Z",
    "Driver": "btrfs",
    "ExecIDs": null,
    "GraphDriver": {
        "Data": null,
        "Name": "btrfs"
    },
    "HostConfig": {
        "AutoRemove": false,
        "Binds": [
            "/mnt/cache/appdata/xbrowsersync/settings.json:/usr/src/api/config/settings.json:rw",
            "/mnt/cache/appdata/xbrowsersync/healthcheck.js:/usr/src/api/healthcheck.js:rw"
        ],
        "BlkioDeviceReadBps": null,
        "BlkioDeviceReadIOps": null,
        "BlkioDeviceWriteBps": null,
        "BlkioDeviceWriteIOps": null,
        "BlkioWeight": 0,
        "BlkioWeightDevice": null,
        "CapAdd": null,
        "CapDrop": null,
        "Cgroup": "",
        "CgroupParent": "",
        "CgroupnsMode": "host",
        "ConsoleSize": [
            0,
            0
        ],
        "ContainerIDFile": "",
        "CpuCount": 0,
        "CpuPercent": 0,
        "CpuPeriod": 0,
        "CpuQuota": 0,
        "CpuRealtimePeriod": 0,
        "CpuRealtimeRuntime": 0,
        "CpuShares": 0,
        "CpusetCpus": "",
        "CpusetMems": "",
        "DeviceCgroupRules": null,
        "DeviceRequests": null,
        "Devices": null,
        "Dns": null,
        "DnsOptions": null,
        "DnsSearch": null,
        "ExtraHosts": null,
        "GroupAdd": null,
        "IOMaximumBandwidth": 0,
        "IOMaximumIOps": 0,
        "IpcMode": "private",
        "Isolation": "",
        "KernelMemory": 0,
        "KernelMemoryTCP": 0,
        "Links": null,
        "LogConfig": {
            "Config": {
                "max-file": "1",
                "max-size": "500m"
            },
            "Type": "json-file"
        },
        "MaskedPaths": [
            "/proc/asound",
            "/proc/acpi",
            "/proc/kcore",
            "/proc/keys",
            "/proc/latency_stats",
            "/proc/timer_list",
            "/proc/timer_stats",
            "/proc/sched_debug",
            "/proc/scsi",
            "/sys/firmware"
        ],
        "Memory": 0,
        "MemoryReservation": 0,
        "MemorySwap": 0,
        "MemorySwappiness": null,
        "NanoCpus": 0,
        "NetworkMode": "xbrowsersync_default",
        "OomKillDisable": false,
        "OomScoreAdj": 0,
        "PidMode": "",
        "PidsLimit": null,
        "PortBindings": {
            "8080/tcp": [
                {
                    "HostIp": "",
                    "HostPort": "9009"
                }
            ]
        },
        "Privileged": false,
        "PublishAllPorts": false,
        "ReadonlyPaths": [
            "/proc/bus",
            "/proc/fs",
            "/proc/irq",
            "/proc/sys",
            "/proc/sysrq-trigger"
        ],
        "ReadonlyRootfs": false,
        "RestartPolicy": {
            "MaximumRetryCount": 0,
            "Name": "unless-stopped"
        },
        "Runtime": "runc",
        "SecurityOpt": null,
        "ShmSize": 67108864,
        "UTSMode": "",
        "Ulimits": null,
        "UsernsMode": "",
        "VolumeDriver": "",
        "VolumesFrom": []
    },
    "HostnamePath": "/var/lib/docker/containers/2fd2ed50a788cb1cd7798d04fdec5597987933f65556d443ea65146e9292187c/hostname",
    "HostsPath": "/var/lib/docker/containers/2fd2ed50a788cb1cd7798d04fdec5597987933f65556d443ea65146e9292187c/hosts",
    "Id": "2fd2ed50a788cb1cd7798d04fdec5597987933f65556d443ea65146e9292187c",
    "Image": "sha256:91a6004ca7ffbf988c9c1bd96ad4c5c3f379a64930cd770c2be25b78897ce6d1",
    "LogPath": "/var/lib/docker/containers/2fd2ed50a788cb1cd7798d04fdec5597987933f65556d443ea65146e9292187c/2fd2ed50a788cb1cd7798d04fdec5597987933f65556d443ea65146e9292187c-json.log",
    "MountLabel": "",
    "Mounts": [
        {
            "Destination": "/usr/src/api/config/settings.json",
            "Mode": "rw",
            "Propagation": "rprivate",
            "RW": true,
            "Source": "/mnt/cache/appdata/xbrowsersync/settings.json",
            "Type": "bind"
        },
        {
            "Destination": "/usr/src/api/healthcheck.js",
            "Mode": "rw",
            "Propagation": "rprivate",
            "RW": true,
            "Source": "/mnt/cache/appdata/xbrowsersync/healthcheck.js",
            "Type": "bind"
        }
    ],
    "Name": "/xbs-api",
    "NetworkSettings": {
        "Bridge": "",
        "EndpointID": "",
        "Gateway": "",
        "GlobalIPv6Address": "",
        "GlobalIPv6PrefixLen": 0,
        "HairpinMode": false,
        "IPAddress": "",
        "IPPrefixLen": 0,
        "IPv6Gateway": "",
        "LinkLocalIPv6Address": "",
        "LinkLocalIPv6PrefixLen": 0,
        "MacAddress": "",
        "Networks": {
            "xbrowsersync_default": {
                "Aliases": [
                    "2fd2ed50a788",
                    "api"
                ],
                "DriverOpts": null,
                "EndpointID": "",
                "Gateway": "",
                "GlobalIPv6Address": "",
                "GlobalIPv6PrefixLen": 0,
                "IPAMConfig": null,
                "IPAddress": "",
                "IPPrefixLen": 0,
                "IPv6Gateway": "",
                "Links": null,
                "MacAddress": "",
                "NetworkID": "6da5cbc7defaa405f1ca810aa6e3c352e4125f5ceb98d4e7e3cb35e7f6e91e50"
            }
        },
        "Ports": {},
        "SandboxID": "71240f69c21e65f3064fdee118d2abe192373bf01a86297e6f0d98b71fc352b1",
        "SandboxKey": "/var/run/docker/netns/71240f69c21e",
        "SecondaryIPAddresses": null,
        "SecondaryIPv6Addresses": null
    },
    "Path": "docker-entrypoint.sh",
    "Platform": "linux",
    "ProcessLabel": "",
    "ResolvConfPath": "/var/lib/docker/containers/2fd2ed50a788cb1cd7798d04fdec5597987933f65556d443ea65146e9292187c/resolv.conf",
    "RestartCount": 9,
    "State": {
        "Dead": false,
        "Error": "",
        "ExitCode": 1,
        "FinishedAt": "2021-07-21T19:20:02.315781644Z",
        "Health": {
            "FailingStreak": 0,
            "Log": [],
            "Status": "unhealthy"
        },
        "OOMKilled": false,
        "Paused": false,
        "Pid": 0,
        "Restarting": true,
        "Running": true,
        "StartedAt": "2021-07-21T19:20:01.697109363Z",
        "Status": "restarting"
    }
}

I am trying to start the container on unRAID which is an OS based on Slackware. Any advice or suggestion would bee much appreciated. Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions