anyproto / any-sync-dockercompose

docker-compose for testing any-sync
MIT License
234 stars 29 forks source link

`can't save configuration` error on subsequent starts #43

Closed greyivy closed 1 month ago

greyivy commented 2 months ago

Have you read a contributing guide?

Current Behavior

Running make start works fine the first time. I then run make stop to cleanly shutdown and later, make start again. The stack never comes back up due to any-sync-coordinator_bootstrap-1. The only message in the logs is:

DEBUG   app all components started  {"total": 0}
FATAL   main    can't save configuration    {"error": "server selection error: server selection timeout, current topology: { Type: Unknown, Servers: [{ Addr: mongo-1:27001, Type: RSGhost, Average RTT: 1076463 }, ] }"}

Expected Behavior

The stack can be restarted after it is stopped.

Steps To Reproduce

  1. Set MONGO_VERSION=4.4.29 in .env.override
  2. make start
  3. Add a user, populate a space
  4. make stop
  5. make start

Environment

- OS: Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux

Anything else?

No response

fb929 commented 2 months ago

for use mongo 4.x you also need to change "healthcheck" command, try to this: https://github.com/anyproto/any-sync-dockercompose/issues/29#issuecomment-2040546496

greyivy commented 2 months ago

Thanks @fb929. Unfortunately I'm seeing same issue after updating the command.

fb929 commented 2 months ago

Thanks @fb929. Unfortunately I'm seeing same issue after updating the command.

can you show me output for rs.status() command?

docker compose exec mongo-1 mongosh --port 27001 --eval 'rs.status()'
greyivy commented 2 months ago
MongoDB shell version v4.4.29
connecting to: mongodb://127.0.0.1:27001/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("77f21989-0dd7-4cda-a019-1f78605790a6") }
MongoDB server version: 4.4.29
{
    "ok" : 0,
    "errmsg" : "Our replica set config is invalid or we are not a member of it",
    "code" : 93,
    "codeName" : "InvalidReplicaSetConfig"
}
fb929 commented 2 months ago

Try running this command:

 docker compose exec mongo-1 mongo --port 27001 --eval 'rs.reconfig({_id: rs.conf()._id, members: [{ _id: 0, host: "mongo-1:27001" }]}, {force: true});'
greyivy commented 1 month ago
MongoDB shell version v4.4.29
connecting to: mongodb://127.0.0.1:27001/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("7510fc2e-c1ef-463d-a8fc-89ca509539ee") }
MongoDB server version: 4.4.29
{
        "ok" : 1,
        "$clusterTime" : {
                "clusterTime" : Timestamp(1715091024, 1),
                "signature" : {
                        "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                        "keyId" : NumberLong(0)
                }
        },
        "operationTime" : Timestamp(1715091024, 1)
}
fb929 commented 1 month ago

@greyivy Now everything should work.

greyivy commented 1 month ago

Thank you! It seems to be working correctly across restarts now.

879258354 commented 1 week ago

Container any-sync-dockercompose-any-sync-coordinator_bootstrap-1 service "any-sync-coordinator_bootstrap" didn't complete succes...
can't open network configuration file {"error": "open /etc/any-sync-coordinator/network.yml: no such file or directory"}

879258354 commented 1 week ago

@fb929 容器 any-sync-dockercompose-any-sync-coordinator_bootstrap-1 服务“any-sync-coordinator_bootstrap”未成功完成... 无法打开网络配置文件 {“error”: “open /etc/any-sync-coordinator/network.yml: no such file or directory”}

fb929 commented 1 week ago

Container any-sync-dockercompose-any-sync-coordinator_bootstrap-1 service "any-sync-coordinator_bootstrap" didn't complete succes... can't open network configuration file {"error": "open /etc/any-sync-coordinator/network.yml: no such file or directory"}

obviously, you encountered an error at the configuration generation step. please show the full output of the make start command.