DockerGS icon indicating copy to clipboard operation
DockerGS copied to clipboard

MongoSocketOpenException

Open DeeChael opened this issue 3 years ago • 1 comments

Exception in thread "main" com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=192.168.1.106:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.SocketTimeoutException: Connect timed out}}]
        at com.mongodb.internal.connection.BaseCluster.getDescription(BaseCluster.java:177)
        at com.mongodb.internal.connection.SingleServerCluster.getDescription(SingleServerCluster.java:41)
        at com.mongodb.client.internal.MongoClientDelegate.getConnectedClusterDescription(MongoClientDelegate.java:127)
        at com.mongodb.client.internal.MongoClientDelegate.createClientSession(MongoClientDelegate.java:87)
        at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.getClientSession(MongoClientDelegate.java:258)
        at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:182)
        at com.mongodb.client.internal.MongoCollectionImpl.executeCreateIndexes(MongoCollectionImpl.java:847)
        at com.mongodb.client.internal.MongoCollectionImpl.createIndexes(MongoCollectionImpl.java:830)
        at com.mongodb.client.internal.MongoCollectionImpl.createIndexes(MongoCollectionImpl.java:825)
        at com.mongodb.client.internal.MongoCollectionImpl.createIndex(MongoCollectionImpl.java:810)
        at dev.morphia.annotations.builders.IndexHelper.createIndex(IndexHelper.java:220)
        at dev.morphia.annotations.builders.IndexHelper.createIndex(IndexHelper.java:210)
        at dev.morphia.DatastoreImpl.ensureIndexes(DatastoreImpl.java:186)
        at emu.grasscutter.database.DatabaseManager.ensureIndexes(DatabaseManager.java:80)
        at emu.grasscutter.database.DatabaseManager.initialize(DatabaseManager.java:63)
        at emu.grasscutter.Grasscutter.main(Grasscutter.java:134)

Command to start:

docker run --rm -it \
--name dockergs \
-v resources:/home/dockergs/resources \
-p 22102:22102/udp \
-p 80:80/tcp \
siakbary/dockergs:alpine-gc-3.1 \
--database 'mongodb://192.168.1.106:27017' \
--web_ip '172.20.48.1' \
--web_port '80' \
--game_ip '172.20.48.1' \
--game_port '22102' \
--download_resource 'yes' \
--ssl 'false' \
--web_url_ssl "false"

I'm trying to run dockerGS on wsl, and I've set up MongoDB on my windows before so I want to use the installed mongo db. “192.168.1.106” is the host to my windows machine, but when I try to start server there will be an exception thrown

Sorry for my poor English

DeeChael avatar Oct 08 '22 05:10 DeeChael

run mongodb first then run dockergs and keep in the same network segment 必须先运行mongodb 然后再运行dockergs 然后两个要在同一个网段才能联通 你上面的都不在一个网段能用才怪

louis000008 avatar Oct 09 '22 04:10 louis000008

I closed this because it looks like it's just a database problem that is not connected because the ip is not recognized in docker

akbaryahya avatar Nov 09 '22 08:11 akbaryahya