-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sidekiq's UI logs out the user session (multiple suggestions tried) #4821
Comments
I've heard one other report that ActiveRecord::SessionStore didn't work well with Sidekiq for some reason. If you remove the two authentication lines, does it work fine? #devise_scope :user do
#authenticated :user do
mount Sidekiq::Web => '/sidekiq'
#end
#end Another thing you can do is run Sidekiq master. I've re-written the Web UI session configuration to be simpler and hopefully less error-prone. |
To run master, use this in your Gemfile:
Let me know if that helps, I have a suspicion it will. |
Hey @mperham,
This is how I used to do it before, but never worked. However, the following solution worked for me:
Any way I can get that working with the Sidekiq Pro gem? |
Using Sidekiq master should work with Sidekiq Pro just fine.
…On Fri, Feb 19, 2021 at 14:52 Alton Johnson, OSCP, OSCE < ***@***.***> wrote:
Hey @mperham <https://github.com/mperham>,
Yep that worked perfectly -- wow! Any way I can replicate this using the
Sidekiq Pro gem?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4821 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAWX5R7EX26Q65W6KKXC3S73TSXANCNFSM4X4ULXPA>
.
|
And thanks for testing this, Alton. This session rewrite is a brand new approach that no one but myself had tested before so I was hoping I could find a victim^wtester to try it in the wild for me. Now you've given me more confidence this will fix similar issues others are seeing. 😎 |
Haha @mperham sounds good. If you need anyone to test anything man, add me to the list. I can't thank you enough for the hard work you've put behind this gem. The least I could do was go with Pro and I've been super happy with it. Just let me know! 😁😁 |
Quick question, I tried doing this:
but got the following error when running
|
Sidekiq and Sidekiq Pro are separate gems, you just explicitly list it instead of pulling it in implicitly as a transitive dependency: gem "sidekiq", github: "mperham/sidekiq"
source "https://gems.contribsys.com/" do
gem "sidekiq-pro"
end |
Gotcha. Confirmed this works. Much appreciated! |
Hey @mperham, With that suggestion, I actually just experienced something pretty rough. Check this out:
It's referring to this:
The only thing that fixed this was removing the Sidekiq master by changing:
back to
Any thoughts on this by chance? EDIT I re-read the FAQ and was able to implement a better solution for authentication:
and this works. Sweet!! |
Thanks, I will fix that on Monday.
…On Sat, Feb 20, 2021 at 07:01 Alton Johnson, OSCP, OSCE < ***@***.***> wrote:
Hey @mperham <https://github.com/mperham>,
With that suggestion, I actually just experienced something pretty rough.
Check this out:
2021-02-20T14:56:45.099Z pid=136 tid=gq2jwkuuo INFO: Booting Sidekiq 6.2.0 with redis options {:url=>"redis://vpe-re-1cyc0i7ww4zym.atlaug.0001.use1.cache.amazonaws.com:6379/0"}
2021-02-20T14:56:45.271Z pid=136 tid=gq2jwkuuo WARN: NoMethodError: undefined method `use' for Sidekiq::Web:Class
2021-02-20T14:56:45.271Z pid=136 tid=gq2jwkuuo WARN: /myapp/config/routes.rb:496:in `block in <top (required)>'
/usr/local/bundle/gems/actionpack-5.2.4/lib/action_dispatch/routing/route_set.rb:432:in `instance_exec'
/usr/local/bundle/gems/actionpack-5.2.4/lib/action_dispatch/routing/route_set.rb:432:in `eval_block'
/usr/local/bundle/gems/actionpack-5.2.4/lib/action_dispatch/routing/route_set.rb:414:in `draw'
It's referring to this:
Sidekiq::Web.use(Rack::Auth::Basic) do |user, password|
[user, password] == ["sidekiqadmin", "mypassword"]
end
The only thing that fixed this was removing the Sidekiq master by changing:
gem "sidekiq", github: "mperham/sidekiq"
# Sidekiq used for backgrounding tasks.
source "https://gems.contribsys.com/" do
gem "sidekiq-pro"
end
back to
# Sidekiq used for backgrounding tasks.
source "https://gems.contribsys.com/" do
gem "sidekiq-pro"
end
Any thoughts on this by chance?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4821 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAWX5ASMIGA6RMHDATDSDS77FFZANCNFSM4X4ULXPA>
.
|
Versions
Sidekiq Pro: 5.2.1
Ruby on Rails: 5.2.3
Ruby: 2.5.8
Issue
I've been trying to figure out what's causing my app to do this for quite some time, and I finally just realized yesterday that the Sidekiq UI is logging out my session.
Issue reproduction
/sidekiq
appended, to visit the Sidekiq Pro Web UISuggestion 1 (unsuccessful)
RE: https://stackoverflow.com/questions/38742116/rails-devise-and-sidekiq-routes
RE: #3085
RE: #3792
I've tried adding this to my Rails routes file:
at the very top of my
config/routes.rb
file, but no luck. Still logs out the user when browsing to the Sidekiq Pro web interface.Suggestion 2 (unsuccessful)
The comment in #3792 suggests https://github.com/mperham/sidekiq/wiki/Monitoring#forbidden, which suggests adding
to the
config/initializers/sidekiq.rb
file.I have tried doing that and nothing has changed -- still logs me out when navigating to the Sidekiq UI. I have also confirmed that the
secret_key_base
variable in the Rails credentials exist, so it's definitely getting a valid string there returned.One observation that I made was that, when I login to my application, ActiveRecord::SessionStore::Session is setting my session to a pretty long value, as shown here (from the rails console):
But when I navigate to the Sidekiq Pro UI, I notice that the session data is a lot shorter:
Any other tips that I can use to further investigate?
The text was updated successfully, but these errors were encountered: