Closed nexitpl closed 20 minutes ago
It's self-explanatory
Unable to connect to database: MongoServerSelectionError: connect EHOSTUNREACH 172.20.0.2:27017
Meshcentral can't connect to your mongodb server
So check what port mongodb is running on as meahcentral thinks u entered the port 27017 as the port number
Also u didn't follow the bug template correctly
And u don't say what docker image u are using
Sorry...
docker image: [typhonragewind/meshcentral:mongodb-latest]
Everything worked fine until I injected link while in desktop session, now I don't even know why restoring a backup did not work too:
Unable to connect to database: MongoServerSelectionError: connect EHOSTUNREACH 172.20.0.2:27017
IP of my container is correct
Have u checked ur mongodb service is running and port in the container?
docker ps
should show what port it's using
meshcentral
8b08aa944f4e mongo:latest "docker-entrypoint.s…" 20 minutes ago Up 20 minutes 27017/tcp
Meshcentral can't talk to ur mongodb server
Have u checked the ip to check it hasn't changed?
Generally, if ur mongodb and meshcentral are in the same network, u can also just use the service name instead of the ip address (docker-compose)
Edit. Also u could provide the docker-compose file if u use it
docker network inspect meshcentral_default
[
{
"Name": "meshcentral_default",
"Id": "86190b60358624ed47e730d80f544fbd3ecda9a2ef374c61ce3451e9952fde7f",
"Created": "2024-02-04T22:22:45.695153525+01:00",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.20.0.0/16",
"Gateway": "172.20.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"6bb5ff40420799e955d7b7670deb51cecf8de5f8e46ee91dc2bed4ed966e8681": {
"Name": "meshcentral",
"EndpointID": "52afc884caef4d45c615a09f3061b9b5476e16e009c3318904da335382b263af",
"MacAddress": "02:42:ac:14:00:02",
"IPv4Address": "172.20.0.3/16",
"IPv6Address": ""
},
"8b08aa944f4ece950a31bcdee779e6c6aa1f2603320b6527eaf9d8516602ce52": {
"Name": "meshcentral_db",
"EndpointID": "5383f159771fb4eaba20f262e080f16aced14fdbfa5e196f8dd0253fad51b1b3",
"MacAddress": "02:42:ac:14:00:02",
"IPv4Address": "172.20.0.2/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {
"com.docker.compose.network": "default",
"com.docker.compose.project": "meshcentral",
"com.docker.compose.version": "2.20.2"
}
}
it seems IP is ok
Sounds daft, physical restart ur docker machine/vm I've had it in the past docker got confused over stuff and a simple restart of the computer fixed the issue
restarted the whole server and still:
(Use node --trace-deprecation ...
to show where the warning was created)
Unable to connect to database: MongoServerSelectionError: connect EHOSTUNREACH 172.20.0.2:27017
ERR: (node:21) [DEP0040] DeprecationWarning: The punycode
module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ...
to show where the warning was created)
Unable to connect to database: MongoServerSelectionError: connect EHOSTUNREACH 172.20.0.2:27017
ERR: (node:21) [DEP0040] DeprecationWarning: The punycode
module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ...
to show where the warning was created)
Unable to connect to database: MongoServerSelectionError: connect EHOSTUNREACH 172.20.0.2:27017
ERR: (node:22) [DEP0040] DeprecationWarning: The punycode
module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ...
to show where the warning was created)
ERR: (node:21) [DEP0040] DeprecationWarning: The punycode
module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ...
to show where the warning was created)
config.json for meshcentral:
{
"$schema": "http://info.meshcentral.com/downloads/meshcentral-config-schema.json",
"settings": {
"cert": "*************",
"_sessionKey": "**********",
"port": 9443,
"_aliasPort": 9443,
"redirPort": 80,
"_redirAliasPort": 80,
"AgentPong": 60,
"tlsOffload": "192.168.2.10",
"trustedproxy": "********",
"SelfUpdate": false,
"AllowFraming": false,
"mongodb": "mongodb://mongodb:27017/mesh",
"mongodbcol": "mesh",
"allowHighQualityDesktop": true,
"IgnoreAgentHashCheck": true,
"WebRTC": true,
"plugins": {
"enabled": true
}
},
"domains": {
"******": {
"_title": "Meshcentral",
"_title2": " Meshcentral",
"_minify": true,
"NewAccounts": false,
"_userNameIsEmail": true,
"_certUrl": "https://***********/"
}
}
}
You have ur mongodb set to mongodb
as the server name
Try changing it to meshcentral_db
and restarting meshcentral container
Yes but it was working like that all the time, I have done as you wrote and still got the same issue, even recreated containers with re pull images and still the same, I also checked if there is enough space on VM but it seems ok: devtmpfs 4.0M 0 4.0M 0% /dev tmpfs 3.9G 0 3.9G 0% /dev/shm tmpfs 1.6G 1.5M 1.6G 1% /run /dev/sda3 40G 30G 8.1G 79% / tmpfs 3.9G 11M 3.9G 1% /tmp /dev/sda2 10M 2.2M 7.8M 23% /boot/efi tmpfs 797M 0 797M 0% /run/user/1000 overlay 40G 30G 8.1G 79% /var/lib/docker/overlay2/48f978324df1d843e001ccc61a1b07c18a3b7519f32dc1a84144665f8d5953a3/merged overlay 40G 30G 8.1G 79% /var/lib/docker/overlay2/81feec4ab27457a1794407bec4f7b46f93f146d19a8ee79dcdf45a25c91e0fc8/merged overlay 40G 30G 8.1G 79% /var/lib/docker/overlay2/a3893bf03c4df7369164bd9a07822a1a4f5a59b14d08ac0365dc028f8a5c0d59/merged overlay 40G 30G 8.1G 79% /var/lib/docker/overlay2/076cc474142ad8ee1c0c234dd1e61a848b524f94c7622eff2cb94710bade11de/merged overlay 40G 30G 8.1G 79% /var/lib/docker/overlay2/1ca3ea533ad7cd6f47f1383e27caa23c4851445b96a59fb55dae5ccf502505de/merged overlay 40G 30G 8.1G 79% /var/lib/docker/overlay2/d60ef2cca59a49ecf3f42aa7d0ceca6bb93e0aaa86ee19d5bb117fc5c1b0b210/merged overlay 40G 30G 8.1G 79% /var/lib/docker/overlay2/367dc112f07a12ddebdc9eea70c9e43025960991ecaa05763844ea2f7d62a75b/merged overlay 40G 30G 8.1G 79% /var/lib/docker/overlay2/c5e58923dd6189112e538d9bd954e5e89454d208725f38b038acbb08a11b9c22/merged
I also found something like this in logs of meshcentral_db: t={"$date":"2024-11-08T15:40:53.481+00:00"} s=I c=CONTROL id=23285 ctx=main msg=Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none' t={"$date":"2024-11-08T15:40:53.482+00:00"} s=I c=CONTROL id=5945603 ctx=main msg=Multi threading initialized t={"$date":"2024-11-08T15:40:53.482+00:00"} s=I c=NETWORK id=4648601 ctx=main msg=Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set at least one of the related parameters attr={"relatedParameters":["tcpFastOpenServer","tcpFastOpenClient","tcpFastOpenQueueSize"]} t={"$date":"2024-11-08T15:40:53.483+00:00"} s=I c=NETWORK id=4915701 ctx=main msg=Initialized wire specification attr={"spec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":25},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":25},"outgoing":{"minWireVersion":6,"maxWireVersion":25},"isInternalClient":true}} t={"$date":"2024-11-08T15:40:53.483+00:00"} s=I c=TENANT_M id=7091600 ctx=main msg=Starting TenantMigrationAccessBlockerRegistry t={"$date":"2024-11-08T15:40:53.483+00:00"} s=I c=CONTROL id=4615611 ctx=initandlisten msg=MongoDB starting attr={"pid":1,"port":27017,"dbPath":"/data/db","architecture":"64-bit","host":"82bfb3b41bd1"} t={"$date":"2024-11-08T15:40:53.483+00:00"} s=I c=CONTROL id=23403 ctx=initandlisten msg=Build Info attr={"buildInfo":{"version":"8.0.3","gitVersion":"89d97f2744a2b9851ddfb51bdf22f687562d9b06","openSSLVersion":"OpenSSL 3.0.13 30 Jan 2024","modules":[],"allocator":"tcmalloc-google","environment":{"distmod":"ubuntu2404","distarch":"x86_64","target_arch":"x86_64"}}}
maybe something with SSL TLS?
I also exposed Mongodb port 27017 and telnet to it from Mac and it connects
telnet 192.168.2.49 27017 Trying 192.168.2.49... Connected to photon. Escape character is '^]'.
another strange thing is that I event sucessfully connected to mongo with compass:
well what a stupid thing this is, I have changed the MAC address of the meshcentral_db because it was the same as meshcentral in the meshcentral_default network and suddenly is working..... thank you and sorry for taking your time.
Glad u got it sorted but to me that's a docker bug haha And I didn't think u could change mac addresses with docker! Learn something new every day
Hello I have issue, I clicked to input link in one of my client PC and suddenly meshcentral website goes offline and I even pull backup from today morning and still having this error:
it's Docker with 2 images meshcentral_db and meshcentral on mongodb
Logs from meshcentral container:
Logs from meshcentral_db:
Please HELP