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:

Contains:

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]

:exploding_head:

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

4 Likes

Ah, yes, weird and explains why Production didnā€™t blow up!

Thanks for speedy response!!

2 Likes

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