Lattyware/massivedecks

Docker Deployment, This node is not a swarm manager when creating config

Closed this issue · 8 comments

I'm attempting to deploy the simple memory only docker version.
After cloning the repo and using the docker compose script in the memory folder of deployment, I copied the config.json5 from the postgres into the memory folder.
However, when running docker config create md_server_config config.json5 to create the external config, I get this error: Error response from daemon: This node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again. Any idea how to fix this error? I'm not trying to use the swarm manager.

I intended to add an explanation of this to the file, but yes, the config feature in compose isn't usable for simple cases.

The alternative is to remove the configs sections and use a volume mount of your config file that you have on your local filesystem, something like:

    volumes:
      - /path/to/config.json5:/md/config.json5:ro

I'll leave this issue open as a reminder to add this info to the config file, as this is very much the common case.

Thank you for the response!
I have updated my memory docker compose config to look like this:

# This docker compose file is for building and running a production version of Massive Decks.
# This uses images built by the project.

networks:
  internal:

# You will want to make a config, e.g:
# docker config create md_server_config config.json5

services:
  server:
    # Pick your tag wisely for stability. In general, it's best to specify an exact version by commit hash and update ma>
    # Versioned tags are also provided, in order of stability: by version number (major "x", minor "x.y", and patch "x.y>
    image: "ghcr.io/lattyware/massivedecks/server:latest-release"
    depends_on:
      - storage
    environment:
      - NODE_ENV=production
    networks:
      - internal
    volumes:
      - /home/ubuntu/massivedecks/deployment/memory/config.json5:/md/config.json5:ro
    restart: unless-stopped

  client:
    # Make sure you always deploy the exact same tag as the server and pull both at the same time.
    image: "ghcr.io/lattyware/massivedecks/client:latest-release"
    depends_on:
      - server
    ports:
      - "80:8080/tcp"
    networks:
      - internal
    restart: unless-stopped

However, my server containers seems to be on a boot loop:
image
When interacting with the website, doing anything at all, this error comes up
The server gave a response we didn’t expect.

Context for developers:
Version: v2.8.0
Page: http://192.168.1.44/#new
English Error: The server gave a response we didn’t expect.
Details: 502

Any ideas how to solve it?

My guess would be there is some issue with the config file and it's erroring out at startup because it can't parse it. If you use docker logs memory-server-1 you should get the log output that should give you enough information to work out what is wrong.

After setting the secret manually(don't know how I missed that), I'm getting this error:

error: Application exception:
{
  "details": {
    "error": {
      "errno": -3001,
      "code": "EAI_AGAIN",
      "syscall": "getaddrinfo",
      "hostname": "storage"
    },
    "level": "error",
    "message": "uncaughtException: getaddrinfo EAI_AGAIN storage\nError: getaddrinfo EAI_AGAIN storage\n    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:83:26)",
    "stack": "Error: getaddrinfo EAI_AGAIN storage\n    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:83:26)",
    "exception": true,
    "date": "Thu Jun 30 2022 23:13:56 GMT+0000 (Coordinated Universal Time)",
    "process": {
      "pid": 1,
      "uid": 1000,
      "gid": 1000,
      "cwd": "/md",
      "execPath": "/usr/local/bin/node",
      "version": "v18.2.0",
      "argv": [
        "/usr/local/bin/node",
        "/md/index.js"
      ],
      "memoryUsage": {
        "rss": 110903296,
        "heapTotal": 64466944,
        "heapUsed": 41383520,
        "external": 3051392,
        "arrayBuffers": 1524910
      }
    },
    "os": {
      "loadavg": [
        0.6,
        0.51,
        0.42
      ],
      "uptime": 85163.31
    },
    "trace": [
      {
        "column": 26,
        "file": "node:dns",
        "function": "GetAddrInfoReqWrap.onlookup [as oncomplete]",
        "line": 83,
        "method": "onlookup [as oncomplete]",
        "native": false
      }
    ]
  },
  "timestamp": "2022-06-30T23:13:56.405Z"
}

Sounds like your config is set up to try and connect to a PostgreSQL server for the store or cache, rather than using the InMemory store and cache, so it's trying to connect to a PostgreSQL container that doesn't exist. You would either need to deploy a container for the database or switch to in memory, which I assume was the intent given your use of the memory deployment.

Does a sample config.json5 exist for the memory version? I can only find a sample config for the PostgreSQL version

The main example is in server and defaults to using in memory while explaining all the options.

With no further response I'll assume that got things working and close the issue, please reopen or open another issue if you run into further problems.