Failing job: undefined method `cancel_scheduled_job' for Jobs::Jobs:Module

during Jobs::ProcessPost

I can recreate on command line:

whereas I can successfully reach it by:

Believe it might be related to this:


In this context, could it require a leading ::?

1 Like

Hmm, adding a leading :: would certainly fix it… but it shouldn’t be required :thinking:

Given that the call comes from within ::Jobs::ProcessPost, Ruby should work up the tree. First it’ll look for ::Jobs::ProcessPost::Jobs, then ::Jobs::Jobs, then eventually ::Jobs module.

The error you’re seeing suggests that something is defining ::Jobs::Jobs… which is weird! Taking a look on my development instance:

[1] pry(main)> Jobs::Jobs
=> Jobs::Jobs
[2] pry(main)> Jobs::Jobs.constants
=> [:RemapOldBotImages, :GrantBadges]


Looks like these lines in discourse-narrative-bot are causing issues. If I comment them out, it solves the problem.

Good news is that it’s development-only - related to the file paths of the jobs mismatching the names of the modules. Here’s a PR to clean things up:

Thanks for the report @merefield


Ah, yes, weird and explains why Production didn’t blow up!

Thanks for speedy response!!


This topic was automatically closed after 17 hours. New replies are no longer allowed.