Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
535 views
in Technique[技术] by (71.8m points)

mongodb - An error occurred while loading navigation: Attempted to use Snappy compression, but Snappy is not installed

I was tryign to install the latest mongo database on my MacOS via the official tutorial. So the following commands effectively seem to work for me:

brew services start [email protected]
brew services list  

lists the following

mongodb-community started naman .../LaunchAgents/homebrew.mxcl.mongodb-community.plist

Further, when I am trying to execute mongo, I am able to successfully create a session for shell

MongoDB shell version v4.4.3 
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb 
Implicit session: session { "id" : UUID("57e62dd9-77f2-48c2-8fe8-8fe9fe79a1d2") }

and access the databases, collections, execute the queries, and all.

But further trying to connect to this URI using MongoDB Compass to make use of its visual tree for explain, I am getting to see that the compression has to be enabled as a must:

enter image description here

and upon specifying the compression as snappy, it would read the following:

An error occurred while loading navigation: Attempted to use Snappy compression, but Snappy is not installed. Install or disable Snappy compression and try again.

The MongoDB Version in use is v4.4.3 and compass version Version 1.25.0, is there a workaround for this or do I need to tweak my configs from defaults?

question from:https://stackoverflow.com/questions/65838928/an-error-occurred-while-loading-navigation-attempted-to-use-snappy-compression

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Since here described in urioption.compressors:

Comma-delimited string of compressors to enable network compression for communication between this client and a mongod/mongos instance.

You can specify the following compressors:

  • snappy
  • zlib (Available in MongoDB 3.6 or greater)
  • zstd (Available in MongoDB 4.2 or greater)

Why compressors=disabled is working in mongo-shell(mongo) and not in mongo-compass?

Value for compressors must be at least one of: snappy, zlib

So here,

  1. net.compression.compressors, cmdoption-mongod, cmdoption-mongos,

    • they have specified

To disable network compression, set the value to disabled.

  1. compression-options in Connection String URI Format and cmdoption-mongo,
    • They have not specified any validation like first point

As per above points might be it is required in mongo-compass and not in mongo-shell! For detailed and specific answer you can ask to MongoDB community Forum or post a bug in MongoDB Jira,


and upon specifying the compression as snappy, it would read the following:

An error occurred while loading navigation: Attempted to use Snappy compression, but Snappy is not installed. Install or disable Snappy compression and try again.

See here term-snappy,

A compression/decompression library designed to balance efficient computation requirements with reasonable compression rates. Snappy is the default compression library for MongoDB’s use of WiredTiger. See Snappy and the WiredTiger compression documentation for more information.

You need to install it separately if you want to use Snappy.

Conclusion:

You can use zlib instead of Snappy, or more better if you don't specify compressors=disabled or compressors=zlib because by default it will specify compressors=snappy,zstd,zlib all 3 options when you don't specify in uri.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...