我正在使用Windows 10使用适用于Windows的Docker开发Linux应用程序。我也在使用docker-compose。当我尝试从Windows Robo 3T客户端连接到普通的MongoDB 4.1映像时,出现此异常错误。
docker-compose.yml
version: "3"
services:
myapp-db:
image: mongo:4.1
ports:
- 27017:27017
networks:
- myapp-net
volumes:
- vol-myapp-db:/data/db
restart: always
networks:
myapp-net:
volumes:
vol-myapp-db:
运行此配置时,只有在尝试连接Robo3T时,才会出现以下错误。
标准输出:
$ docker-compose up --build
myapp-db_1 | 2019-02-16T02:59:05.825+0000 I NETWORK [listener] connection accepted from 172.18.0.1:42622 #1 (1 connection now open)
myapp-db_1 | 2019-02-16T02:59:05.826+0000 I NETWORK [conn1] received client metadata from 172.18.0.1:42622 conn1: { application: { name: "robo3t" }, driver: { name: "MongoDB Internal Client", version: "3.4.3-10-g865d2fb" }, os: { type: "Windows", name: "Microsoft Windows 8", architecture: "x86_64", version: "6.2 (build 9200)" } }
myapp-db_1 | 2019-02-16T02:59:05.828+0000 E - [conn1] Assertion: Location34348: cannot translate opcode 2010 src/mongo/rpc/message.h 121
myapp-db_1 | 2019-02-16T02:59:05.828+0000 I NETWORK [conn1] DBException handling request, closing client connection: Location34348: cannot translate opcode 2010
myapp-db_1 | 2019-02-16T02:59:05.828+0000 I NETWORK [conn1] end connection 172.18.0.1:42622 (0 connections now open)
任何人都知道这里发生了什么吗?
答案 0 :(得分:14)
我以前在robo 3T 1.2.1上遇到过相同的错误
我将robo 3T版本更新为1.3,并且再次起作用,
使用MongoDB内部客户端4.0:
{
application: { name: "MongoDB Shell" },
driver: { name: "MongoDB Internal Client", version: "4.0.5-17-gd808df2233" }
}
但是,正如他们网站上所述,他们只推荐使用Mongo 4.0以下版本。
Robo 3T 1.3为您提供了对MongoDB 4.0和SCRAM-SHA-256(一种 升级的mongo shell,支持从MongoDB SRV导入 连接字符串,以及许多其他修复和改进。
所以我建议使用 Studio 3T。