-
Notifications
You must be signed in to change notification settings - Fork 38
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
ActiveJob initialization issue: ActiveJob::QueueAdapters::CloudtaskerAdapter not loaded properly #19
Comments
update: |
Ignore previous solution. Works but very crude. I can see, the source of the problem is: initializer 'cloudtasker.active_job', after: :load_config_initializers do
require 'active_job/queue_adapters/cloudtasker_adapter' if defined?(::ActiveJob::Railtie)
end seems that the code in the block does not really get run |
@jan-kaczorowski thanks for reporting this. Let me double check on my side the load sequence for Rails 5. |
Happens on Rails 6 as well |
@Fodoj Hmmm... I wonder why I didn't get the issue locally. I'll try more autoloading scenarios then. |
I've created a test repository with two vanilla Rails apps (Rails 5.2 and 6.0) using cloudtasker https://github.com/alachaum/cloudtasker-tests I've tried them with Ruby Are you able to run these examples? Is there anything specific in your apps that could be impacting the Rails initialization sequence? I'm looking to reproduce the issue first. |
@alachaum if it helps with debugging, we had this happening after adding skylight gem, which is also visible in the stacktrace. I understand its a rather specific combination, though:
|
Error rises during execution of this commands (cloudtasker is not part of specific group in Gemfile, skylight is included in production only):
|
@Fodoj thanks for the details, I'll try on my side. |
had the same issue (rails 6, ruby 2.6) Solved this by having a look at your test repo. you're using By default (simply using |
@benbonnet that's right, the ActiveJob adapter is not yet available in the mainstream version. Need to point to release candidates. @jan-kaczorowski @Fodoj I've made a few adjustments to the initialization process, tested it with the |
@alachaum I did a little checking and testing and it seems Question: Are there any plans to integrate Google Cloud Scheduler to be cron operator instead of redis? |
@jan-kaczorowski Great! I'm going to close this issue then and prepare an official release for Regarding Cloud Scheduler, I've raised an issue to track this feature: #20 |
sorry to dig out this issue; this active job part is not yet obvious. I'm completely unable to have cloudtasker working through active job in production : nothing fails, but nothing happens. In development (using ngrok with Is it the expected behaviour ? |
@benbonnet that's surprising. Are you able to make the Rails example work locally with ngrok? Redis is only required for the extensions (unique job, cron and batch), which anyway are not compatible with ActiveJob. So you shouldn't require them and therefore you do not need Redis. When you say:
It sounds odd to me. The jobs should go via Cloud Tasks if you set Here is a list of points to double check:
Out of curiosity, which platform/service do you deploy to? Is it Cloud Run? |
Rails v. 5.2.2
Cloudtasker gem v. 0.11.rc2
After configuring the project as instructed in README, error is being thrown on launch. Looks like ActiveJob::QueueAdapters::CloudtaskerAdapter is not loaded properly from gem.
config/environments/production.rb|development.rb files, where executing
config.active_job.queue_adapter = :cloudtasker
are hitting against class that's not initialized.The text was updated successfully, but these errors were encountered: