{"record":{"id":"250f3a9ad5b0aa78","repo":"juicedata/juicefs","slug":"can-t-connect-to-cluster-s-s","errorCode":null,"errorMessage":"Can't connect to cluster %s: %s","messagePattern":"Can't connect to cluster (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/object/ceph.go","lineNumber":363,"sourceCode":"\t\t\topt = \"$run_dir/jfs-$cluster-$name-$pid.asok\"\n\t\t}\n\t\tif err = conn.SetConfigOption(\"admin_socket\", opt); err != nil {\n\t\t\tlogger.Warnf(\"Failed to set admin_socket to %s: %s\", opt, err)\n\t\t}\n\t}\n\tif opt := os.Getenv(\"CEPH_LOG_FILE\"); opt != \"none\" {\n\t\tif opt == \"\" {\n\t\t\topt = \"/var/log/ceph/jfs-$cluster-$name.log\"\n\t\t}\n\t\tif err = conn.SetConfigOption(\"log_file\", opt); err != nil {\n\t\t\tlogger.Warnf(\"Failed to set log_file to %s: %s\", opt, err)\n\t\t}\n\t}\n\tif err := conn.ReadDefaultConfigFile(); err != nil {\n\t\treturn nil, fmt.Errorf(\"Can't read default config file: %s\", err)\n\t}\n\tif err := conn.Connect(); err != nil {\n\t\treturn nil, fmt.Errorf(\"Can't connect to cluster %s: %s\", cluster, err)\n\t}\n\treturn &ceph{\n\t\tname: name,\n\t\tconn: conn,\n\t\tfree: make(chan *rados.IOContext, 50),\n\t}, nil\n}\n\nfunc init() {\n\tRegister(\"ceph\", newCeph)\n}\n","sourceCodeStart":345,"sourceCodeEnd":375,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/object/ceph.go#L345-L375","documentation":"newCeph calls conn.Connect() to establish the actual network connection to the Ceph cluster after reading the config. If the connection attempt fails (monitors unreachable, authentication keyring missing/invalid), construction aborts with this message.","triggerScenarios":"conn.Connect() errors: monitor addresses unreachable from this host, client keyring missing for the configured user, or authentication rejected by the cluster.","commonSituations":"Network/firewall blocking monitor ports (6789/3300); missing or misplaced /etc/ceph/ceph.client.admin.keyring; monitor list in ceph.conf stale after cluster re-IP; clock skew or auth cap changes.","solutions":["Verify monitor addresses in ceph.conf are reachable (ping/telnet mon host ports)","Ensure the client keyring for the configured user exists and is readable (e.g. /etc/ceph/ceph.client.admin.keyring)","Update mon_host in ceph.conf to the current monitor list","Check `ceph -s --name <user> --keyring <path>` works before mounting"],"exampleFix":"// before\nmon_host = 10.0.0.1  # stale monitor\n// after\nmon_host = 10.0.0.10 10.0.0.11 10.0.0.12\nkeyring = /etc/ceph/ceph.client.admin.keyring","handlingStrategy":"validation","validationCode":"// Shell: preflight connectivity and auth\nceph -s --name client.admin --keyring /etc/ceph/ceph.client.admin.keyring || {\n  echo \"cluster unreachable or auth failed\"; exit 1;\n}","typeGuard":null,"tryCatchPattern":"// Go\nobj, err := object.NewCeph(endpoint, cluster, user, \"\")\nif err != nil && strings.Contains(err.Error(), \"Can't connect to cluster\") {\n    // check monitors reachable and keyring present; do not hot-retry blindly\n}","preventionTips":["Keep mon_host current in ceph.conf (use DNS mon host where possible)","Distribute and permission client keyrings via config management","Monitor ports 6789/3300 open between client and monitors"],"tags":["object-storage","ceph","rados","network"],"backgroundTag":"connection-refused","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}