anyproto / any-sync-dockercompose

docker-compose for testing any-sync
MIT License
367 stars 48 forks source link

Latest build incompatible with v0.42.0 ? #87

Closed Talanor closed 2 months ago

Talanor commented 2 months ago

Have you read a contributing guide?

Current Behavior

On a brand new deployment (no preexisting volumes) + make start, on a brand new vault after uploading the new client.yml, no server communication succeeds :

image

And here's a relevant log excerpt :

any-sync-dockercompose-any-sync-node-2-1                 | 2024-08-06T06:38:47.450Z     INFO    net.transport.quic      accept error    {"localAddr": "172.20.16.10:1012", "error": "Application error 0x3 (remote): outbound handshake failed"}
any-sync-dockercompose-any-sync-node-1-1                 | 2024-08-06T06:38:47.451Z     WARN    net.transport.yamux     incoming connection handshake error     {"error": "IncompatibleVersion"}
any-sync-dockercompose-any-sync-node-3-1                 | 2024-08-06T06:38:47.452Z     WARN    net.transport.yamux     incoming connection handshake error     {"error": "IncompatibleVersion"}
any-sync-dockercompose-any-sync-node-2-1                 | 2024-08-06T06:38:47.453Z     WARN    net.transport.yamux     incoming connection handshake error     {"error": "IncompatibleVersion"}
any-sync-dockercompose-any-sync-node-1-1                 | 2024-08-06T06:38:47.456Z     INFO    net.transport.quic      accept error    {"localAddr": "172.20.16.8:1011", "error": "Application error 0x3 (remote): outbound handshake failed"}
any-sync-dockercompose-any-sync-node-3-1                 | 2024-08-06T06:38:49.958Z     INFO    net.transport.quic      accept error    {"localAddr": "172.20.16.7:1013", "error": "Application error 0x3 (remote): outbound handshake failed"}
any-sync-dockercompose-any-sync-node-1-1                 | 2024-08-06T06:38:49.960Z     WARN    net.transport.yamux     incoming connection handshake error     {"error": "IncompatibleVersion"}
any-sync-dockercompose-any-sync-node-3-1                 | 2024-08-06T06:38:49.960Z     WARN    net.transport.yamux     incoming connection handshake error     {"error": "IncompatibleVersion"}
any-sync-dockercompose-any-sync-node-2-1                 | 2024-08-06T06:38:49.963Z     INFO    net.transport.quic      accept error    {"localAddr": "172.20.16.10:1012", "error": "Application error 0x3 (remote): outbound handshake failed"}
any-sync-dockercompose-any-sync-node-3-1                 | 2024-08-06T06:38:49.964Z     INFO    net.transport.quic      accept error    {"localAddr": "172.20.16.7:1013", "error": "Application error 0x3 (remote): outbound handshake failed"}
any-sync-dockercompose-any-sync-filenode-1               | 2024-08-06T06:38:50.071Z     WARN    net.transport.yamux     incoming connection handshake error     {"error": "IncompatibleVersion"}

Expected Behavior

For my vaults to sync

Steps To Reproduce

  1. git clone
  2. apply the diff provided in "anything else" (which basically shouldn't modify anything critical ? and worked before 5.X branch
  3. make start
  4. update client.yml accordingly
  5. create a new vault
  6. ?
  7. Don't profit

Environment

# Hosting node :
- OS: Debian Bullseye (11)
- Version: Linux tooling 5.10.0-23-amd64 #1 SMP Debian 5.10.179-3 (2023-07-27) x86_64 GNU/Linux
- docker version :
Client: Docker Engine - Community
 Version:           24.0.5
 API version:       1.43
 Go version:        go1.20.6
 Git commit:        ced0996
 Built:             Fri Jul 21 20:35:45 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          24.0.5
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.6
  Git commit:       a61e2b4
  Built:            Fri Jul 21 20:35:45 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.22
  GitCommit:        8165feabfdfe38c65b599c4993d227328c231fca
 runc:
  Version:          1.1.8
  GitCommit:        v1.1.8-0-g82f18fe
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
- Docker compose version : v2.20.2

# Client machine
OS version: linux x64 6.10.2-arch1-1
App version: 0.42.0
Build number: build on 2024-07-31 08:28:58 +0000 UTC at #4a8c39e4e991d3e9d6819f5ff495c688415bc288
Library version: v0.35.0-rc12
Anytype Identity: A7CoWMYx1Z4NWf9uUE9M71kVPVMgJiZKVW761WBSi4cvwyud
Analytics ID: f2ad75ad-428c-402f-9f70-e97024008e9e
Device ID: 12D3KooWFFZNwuHGQ7pWzZFWAqhZcyXVzvo1vyg9hygJmDFfmEa2

Anything else?

On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   .env.override.latest
        modified:   docker-compose.yml

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        any-sync-node-1/
        any-sync-node-2/
        any-sync-node-3/
        docker-generateconfig/.networkId
        docker-generateconfig/.networkSigningKey
        docker-generateconfig/account.yml
        docker-generateconfig/account0.yml
        docker-generateconfig/account1.yml
        docker-generateconfig/account2.yml
        docker-generateconfig/account3.yml
        docker-generateconfig/account4.yml
        docker-generateconfig/account5.yml
        docker-generateconfig/network.yml
        docker-generateconfig/nodes.yml
        docker-generateconfig/nodesProcessed.yml
        minio/
        mongo-1/
        networkStore/
        redis/
$ git diff
diff --git a/.env.override.latest b/.env.override.latest
index e8b7f00..7fcb937 100644
--- a/.env.override.latest
+++ b/.env.override.latest
@@ -2,3 +2,6 @@ ANY_SYNC_NODE_VERSION=latest
 ANY_SYNC_FILENODE_VERSION=latest
 ANY_SYNC_COORDINATOR_VERSION=latest
 ANY_SYNC_CONSENSUSNODE_VERSION=latest
+ANY_SYNC_TOOLS_VERSION=latest
+EXTERNAL_LISTEN_HOSTS=192.168.100.31
+STORAGE_DIR=.
diff --git a/docker-compose.yml b/docker-compose.yml
index d578f52..fcc2bec 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,3 +1,10 @@
+version: "3.9"
+
+networks:
+  traefik:
+    external: true
+  internal:
+
 services:
   # generate configs using the anyconf utility
   generateconfig-anyconf:
@@ -8,6 +15,8 @@ services:
     volumes:
       - ./:/code
       - "${STORAGE_DIR}:/code/storage"
+    networks:
+      - internal

   # processing any-sync-* configs
   generateconfig-processing:
@@ -28,14 +37,16 @@ services:
         condition: service_healthy
     image: "mongo:${MONGO_VERSION}"
     command: ["--replSet", "${MONGO_REPLICA_SET}", "--port", "${MONGO_1_PORT}"]
-    ports:
-      - "${MONGO_1_PORT}:${MONGO_1_PORT}"
+#    ports:
+#      - "${MONGO_1_PORT}:${MONGO_1_PORT}"
     volumes:
       - "${STORAGE_DIR}/mongo-1/:/data/db"
     healthcheck:
       test: test $$(mongosh --port ${MONGO_1_PORT} --quiet --eval "try {rs.initiate({_id:'${MONGO_REPLICA_SET}',members:[{_id:0,host:\"mongo-1:${MONGO_1_PORT}\"}]})} catch(e) {rs.status().ok}") -eq 1
       interval: 10s
       start_period: 30s
+    networks:
+      - internal

   redis:
     depends_on:
@@ -44,8 +55,8 @@ services:
     image: "redis/redis-stack-server:${REDIS_VERSION}"
     restart: always
     command: ["redis-server", "--port", "${REDIS_PORT}", "--dir", "/data/", "--appendonly", "yes", "--maxmemory", "256mb", "--maxmemory-policy", "noeviction", "--protected-mode", "no", "--loadmodule", "/opt/redis-stack/lib/redisbloom.so"]
-    ports:
-      - "${REDIS_PORT}:${REDIS_PORT}"
+      #    ports:
+      #      - "${REDIS_PORT}:${REDIS_PORT}"
     volumes:
       - "${STORAGE_DIR}/redis/:/data/"
     healthcheck:
@@ -53,6 +64,8 @@ services:
       interval: 10s
       timeout: 30s
       retries: 3
+    networks:
+      - internal

   minio:
     image: "minio/minio:${MINIO_VERSION}"
@@ -61,9 +74,6 @@ services:
     environment:
       MINIO_ROOT_USER: "${AWS_ACCESS_KEY_ID}"
       MINIO_ROOT_PASSWORD: "${AWS_SECRET_ACCESS_KEY}"
-    ports:
-      - "${EXTERNAL_MINIO_PORT}:${MINIO_PORT}"
-      - "${EXTERNAL_MINIO_WEB_PORT}:${MINIO_WEB_PORT}"
     volumes:
       - "${STORAGE_DIR}/minio:/data"
     healthcheck:
@@ -72,6 +82,8 @@ services:
       timeout: 10s
       retries: 3
     networks:
+      internal:
+      traefik:
       default:
         aliases:
           - "${MINIO_BUCKET}.minio" # <bucket-name>.<endpoint-name>
@@ -86,6 +98,12 @@ services:
       /usr/bin/mc mb minio/${MINIO_BUCKET};
       exit 0;
       "
+      #    entrypoint:
+      #      - sh
+      #     - -c
+      #     - mc mb minio/${MINIO_BUCKET}
+    networks:
+      - internal

   any-sync-coordinator_bootstrap:
     image: "ghcr.io/anyproto/any-sync-coordinator:${ANY_SYNC_COORDINATOR_VERSION}"
@@ -98,6 +116,8 @@ services:
       - ./etc/any-sync-coordinator/:/etc/any-sync-coordinator/
     restart: "no"
     command: ["/bin/any-sync-confapply", "-c", "/etc/any-sync-coordinator/config.yml", "-n", "/etc/any-sync-coordinator/network.yml", "-e"]
+    networks:
+      - internal

   any-sync-coordinator:
     image: "ghcr.io/anyproto/any-sync-coordinator:${ANY_SYNC_COORDINATOR_VERSION}"
@@ -120,6 +140,9 @@ services:
         limits:
           memory: 500M
     restart: on-failure
+    networks:
+      - internal
+      - traefik

   any-sync-filenode:
     image: "ghcr.io/anyproto/any-sync-filenode:${ANY_SYNC_FILENODE_VERSION}"
@@ -143,6 +166,8 @@ services:
         limits:
           memory: 500M
     restart: on-failure
+    networks:
+      - internal

   any-sync-node-1:
     image: "ghcr.io/anyproto/any-sync-node:${ANY_SYNC_NODE_VERSION}"
@@ -163,6 +188,8 @@ services:
         limits:
           memory: 500M
     restart: on-failure
+    networks:
+      - internal

   any-sync-node-2:
     image: "ghcr.io/anyproto/any-sync-node:${ANY_SYNC_NODE_VERSION}"
@@ -183,6 +210,8 @@ services:
         limits:
           memory: 500M
     restart: on-failure
+    networks:
+      - internal

   any-sync-node-3:
     image: "ghcr.io/anyproto/any-sync-node:${ANY_SYNC_NODE_VERSION}"
@@ -203,6 +232,8 @@ services:
         limits:
           memory: 500M
     restart: on-failure
+    networks:
+      - internal

   any-sync-consensusnode:
     image: "ghcr.io/anyproto/any-sync-consensusnode:${ANY_SYNC_CONSENSUSNODE_VERSION}"
@@ -221,6 +252,8 @@ services:
         limits:
           memory: 500M
     restart: on-failure
+    networks:
+      - internal

   # any-sync-netcheck
   netcheck:
@@ -242,3 +275,5 @@ services:
       test: any-sync-netcheck -c /code/storage/docker-generateconfig/nodes.yml 2>&1| grep -P 'netcheck\s+success'
       interval: 60s
       start_period: 5s
+    networks:
+      - internal

Thanks for the great app (latest updates are rad !)

fb929 commented 2 months ago

I think the issue is the same as in https://github.com/anyproto/any-sync-dockercompose/issues/89 – a bug with EXTERNAL_HOST. Please try updating to version v5.0.3

Talanor commented 2 months ago

I think the issue is the same as in #89 – a bug with EXTERNAL_HOST. Please try updating to version v5.0.3

It was indeed. Thank you !