简体   繁体   English

docker 中的 Mongorestore 失败:失败:gzip:标头无效

[英]Mongorestore in docker failed: Failed: gzip: invalid header

I created a mongo dump with commands (as suggested in this answer )我用命令创建了一个 mongo 转储(如这个答案中所建议的)

docker exec -it mongodb bash
mongodump --host $cluster --ssl --username $username --authenticationDatabase admin --db $dbname --gzip --archive > dumpname.gz

Now when I'm trying to restore the dump with现在,当我尝试使用以下命令恢复转储时

docker exec mongodb bash -c 'mongorestore --gzip --archive=dumpname.gz'

I get我得到

Failed: gzip: invalid header失败:gzip:无效的标头

It seems like there is some bug with using redirection ( > ).使用重定向( > )似乎存在一些错误。 So when I changed the first command to not use it, mongorestore started to work:因此,当我将第一个命令更改为不使用它时, mongorestore开始工作:

mongodump --host $cluster --ssl --username $username --authenticationDatabase admin --db $dbname --gzip --archive=dumpname.gz

Some similar problems could be found here一些类似的问题可以在这里找到

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Mongorestore --gzip --archive 失败 w/ - 0 个文档成功恢复。 0 个文档失败 - Mongorestore --gzip --archive failed w/ - 0 document(s) restored successfully. 0 document(s) failed Mongorestore 问题 身份验证失败 - Mongorestore problem Authentication failed mongorestore 失败:没有可访问的服务器 - mongorestore Failed: no reachable servers 失败:mongorestore 目标“转储”无效:统计转储:没有这样的文件或目录 - Failed: mongorestore target 'dump' invalid: stat dump: no such file or directory mongorestore 无法恢复大型数据集的索引 - mongorestore failed to restore indexes for large data set mongorestore错误:“失败:连接到数据库服务器时出错:没有可访问的服务器” - mongorestore error: “Failed: error connecting to db server: no reachable servers” mongorestore 0 个文档已成功恢复。 0 个文档无法恢复 - mongorestore 0 document(s) restored successfully. 0 document(s) failed to restore 由于BSONSize无效,mongorestore失败 - mongorestore fails due to invalid BSONSize mongorestore 错误失败:从 dump.gz 恢复数据库时出现 EOF - mongorestore error Failed: EOF when restore DB from dump.gz mongorestore 返回“0 个文档恢复成功。0 个文档恢复失败。” - mongorestore returns "0 document(s) restored successfully. 0 document(s) failed to restore."
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM