'1st argument: not an already existing atom' error after upgrading from version 1.5.2 to 1.6.0
After upgrading our application from version 1.5.2 to version 1.6.0 the application started failing with this error:
GenServer #PID<0.591.0> terminating\n** (ArgumentError) errors were found at the given arguments:\n\n * 1st argument: not an already existing atom\n\n :erlang.binary_to_existing_atom("zstd")\n (elixir 1.18.4) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2\n (mongodb_driver 1.6.0) lib/mongo/server_description.ex:113: Mongo.ServerDescription.parse_hello_response/1\n (mongodb_driver 1.6.0) lib/mongo/monitor.ex:263: Mongo.Monitor.get_server_description/1\n (mongodb_driver 1.6.0) lib/mongo/monitor.ex:178: Mongo.Monitor.update_server_description/1\n (mongodb_driver 1.6.0) lib/mongo/monitor.ex:165: Mongo.Monitor.handle_info/2\n (stdlib 5.2.3.3) gen_server.erl:1121: :gen_server.try_handle_cast/3\n (stdlib 5.2.3.3) gen_server.erl:1183: :gen_server.handle_msg/6\nLast message: []`
I'm only seeing this in a dev environment which uses Atlas and has compression enabled. I don't see it in any of my local testing environments. I'm guessing it's related to this commit.
The options block on my connection string is "?compressors=snappy,zstd,zlib". This hasn't changed.
This isn't a critical issue for me and I'll probably just skip this update for now.
I am using ezstd for compression, by the way. This project is still running OTP 26.
Thanks for reporting. I guess, snappy causes this. We don't support snappy compression at all. As a simple workaround you can define the atom :snappy somehwere else. I will fix the code to accept the options to avoid throwing an exception for none existing atoms.