I am using Ruby on Rails.
I am trying to get Sidekiq to work with Redis and receive the following error whenever I am starting sidekiq.
#config/sidekiq.yml
#Config file for Sidekiq
:concurreny: 5
:queues:
-[mailer,5]
-[default,5]
When I run the following command:
bundle exec sidekiq -C config/sidekiq.yml
I get the error as follows:
undefined method `each' for "-[mailer,5] -[default,5]":String
Not sure what the error message says and how to fix it to get Sidekiq to load the configuration and start successfully. Thanks in advance for your answers and help.
YML requires exact formatting. You are missing a space after the dashes.
https://github.com/mperham/sidekiq/blob/master/examples/config.yml#L16
Related
I am having a problem with Heroku CI on a rails application. I just upgraded to Rails 7.0.1
Previous version was Rails 6.1.4.4
# Ferrum::TimeoutError:
# Timed out waiting for response. It's possible that this happened because something took a very long time (for example a page load was slow). If so, setting the :timeout option to a higher value might help.
This is how my Procfile looks like
web: bundle exec puma -C config/puma.rb
release: bundle exec rails db:migrate
Probably you're receiving this error because the :timeout parameter is missing in the Dynos. Try to create a Procfile and pas a :timeout var.
You can find some more useful help right here: https://devcenter.heroku.com/articles/request-timeout
I'm working a Rails application ran into some problems with a 502 error when I tried to go to our staging site. This thread had the answer I needed by adding to puma.rb:
application_path = '/home/deploy/hotel-automata/shared'
bind "unix://#{application_path}/sockets/puma.socket"
I was also able to start the server in development by running foreman start -p 3000. The question I have is how does this not throw an error? The application_path I have definitely doesn't exist in my local computer and running bundle exec puma or bundle exec rails server threw an error on file not found. Is this something that's specific to foreman or am I missing something? I looked around for a while but couldn't find anything related to this.
Also, is this the best way to do this? I feel that using an exact path might not be the best way here but I'm not sure what else I should do. Any suggestions on this point would be much appreciated too.
Also, here's my Procfile:
web: bundle exec rails server
redis: redis-server
sidekiq: bundle exec sidekiq
I am using rails 5 and sidekiq (4.1.2) on Heroku
and calling delay on a class method written in my User model
like:
delay.mass_invite_through_csv(mass_invitation.id, current_user, data)
here mass_invitation is a object of MassInvitation Class and current_user is current_user, and data is a hash params.
now this method is getting executed infinitely.
In my Procfile:
web: bundle exec rails server -p $PORT
worker: bundle exec sidekiq -C config/sidekiq.yml
in my config/sidekiq.yml
concurrency: 3
everything is working correctly locally, please help.
Sidekiq retries failed jobs automatically, therefore you have to understand why it is failing first. 2 possible solutions here: tail into sidekiq output either mount sidekiq dashboard to your app and look whats wrong there.
Guide to install the dashboard
I've just installed the 'sidekiq' gem and trying to run the following from the Terminal:
bundle exec sidekiq
When I run this though, I get the following error. This error does not occur when running the Rails server or loading the environment in the console.
undefined method `skip_authorization_check' for SessionsController:Class
It makes me think that the sidekiq script is trying to do something and it can't see that method. But I've not been able to make much progress with this.
Any clues?
Here's what my Procfile looks like:
web: bundle exec rails server thin -p $PORT -e $RACK_ENV
worker: bundle exec rake jobs:work
I intend to add a worker process because I wish to run some background jobs. I'm following these instructions
This is what I noticed:
No problems encountered if the worker is started separately.
When I keep the second line in the Procfile and don't not change anything else, the rails server serves a couple of requests and hangs after that
As mentioned here , I've added STDOUT.sync = true to config/environments/development.rb and verified the same in the rails console. Did not work.
Tailed log/development.log and compared it against the stuff that foreman outputted to the shell and noticed that both matched for a couple of requests and then foreman stopped printing out stuff to the shell - the next request would then hang
I updated foreman using foreman.pkg as mentioned here and verified the same with [6]
It was mentioned here that this might be caused due to a stray debug statement. I'm not using the debugger and I do not have the pry gem or the ruby-debug gem in my Gemfile.lock
I believe the symptoms are similar to this related unanswered question
Please help!
[6]:
which foreman
/usr/bin/foreman
ls -lah /usr/bin/foreman # checked the updated date
Tracked and resolved here:
https://github.com/ddollar/foreman/issues/244
TL;DR: Install the gem, don't use foreman.pkg
I'll add than if you're using Heroku, the foreman version included with the heroku toolbelt has the same issue.
Use the one you can get with gem install foreman instead.