-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.1.2
-
Component/s: Auth, Connections
-
Environment:Ubuntu 14.04
JRuby 9.0.1.0
mongo 2.1.2
mongoid 5.0.0
sidekiq 3.4.2
Here's the mongoid.yml file that gets loaded into my sidekiq process:
development:
clients:
default:
hosts:
- my.host.1:11000
- my.host.2:11000
database: my_db
options:
read:
mode: :secondary_preferred
write:
w: 1
user: "my_user"
password: "my_password"
roles: - "readWrite"
- "dbOwner"
max_pool_size: 25
options:
use_utc: true
To reproduce the issue, I queue up 100 sidekiq jobs that read & write from my_db. Then I start a sidekiq server. After sidekiq boots up, there's a >50% chance that I start seeing "not authorized" errors. These errors will persist until I reboot the sidekiq server.
Switching to "auth_mech: :mongodb_cr" seems to fix the issue.