-
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
403 Forbidden on retries #4872
Comments
Please see the change log. |
Yes, I have the following
What am I missing? |
If I run
|
Is your app a Rails API app? |
Yes, it is. |
Pro tip #1: Don't load any web stuff in config/initializers/sidekiq.rb. You don't need any web stuff for rails console, rake tasks, etc so all it does is slow down your boot. Put it all in routes.rb. Pro tip #2: A frequent way that people break their own stuff is overconfiguring things. Remove all your Sidekiq::Web session config. You've added the sessions to your Rails app so you don't need any session config for Sidekiq::Web. |
Okay, so I am getting an error
|
Did you clear your existing cookies?
|
As it is a rails api, I believe there are no cookies? I was looking at this They mention you need to add something like the following.
So I tried;
This doesn't work either... As soon as I add |
I don’t know what’s wrong. You might want to open a rails issue and ask for
help.
…On Mon, Apr 12, 2021 at 03:11 Max Rose-Collins ***@***.***> wrote:
As it is a rails api, I believe there are no cookies?
I was looking at this
<https://stackoverflow.com/questions/15342710/adding-cookie-session-store-back-to-rails-api-app>
They mention you need to add something like the following.
config.middleware.use ActionDispatch::Cookies
config.middleware.use ActionDispatch::Session::CookieStore, key: '_your_app'
config.middleware.insert_after(ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, key: '_your_app')
So I tried;
# This also configures session_options for use below
config.session_store :cookie_store, key: '_interslice_session'
# Required for all session management (regardless of session_store)
config.middleware.use ActionDispatch::Cookies
config.middleware.use ActionDispatch::Session::CookieStore, key: '_interslice_session'
config.middleware.insert_after(ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, key: '_interslice_session')
config.middleware.use config.session_store, config.session_options
This doesn't work either...
As soon as I add config.middleware.use ActionDispatch::Cookies into the
app it breaks.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4872 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAWX2S52ZP2TL47WSRH2TTILBMJANCNFSM42WYP3TA>
.
|
Yep, I will ask. Interestingly, if I set |
Others have discovered that Rails API apps don't have a session middleware configured, so Forbidden happens. See https://guides.rubyonrails.org/api_app.html#using-session-middlewares for the solution; you'll need to install a session middleware somehow. |
Ruby version: 2.7.2
Rails version: 6.1.3.1
Sidekiq version: 6.2.1
Sidekiq Pro version: 5.2.2
I am getting 403 forbidden error when retrying jobs.
I had the following set, but it doesn't seem to work any more?
The text was updated successfully, but these errors were encountered: