whine.pl broken due to a missing generate_email() routine

RESOLVED FIXED in Bugzilla 5.0



3 years ago
3 years ago


(Reporter: mva, Assigned: dylan)



Bugzilla 5.0
Bug Flags:
approval5.0 +
blocking5.0.3 +



(1 attachment, 2 obsolete attachments)



3 years ago
User Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:43.0) Gecko/20100101 Firefox/43.0
Build ID: 20151225125557

Steps to reproduce:

Execute the whine.pl cronjob according to http://bugzilla.readthedocs.org/en/5.0/installing/optional-post-install-config.html?highlight=whine

Actual results:

the script broke due to "Undefined subroutine &main::generate_email called at ./whine.pl line 355"

Expected results:

Working whine mails should have been sent

It looks like there is no generate_email() routine defined in Bugzilla/Mailer.pm in 5.0.2., while there is one in the current head/master


3 years ago
Assignee: whining → dylan
Severity: normal → major
Ever confirmed: true
Priority: -- → P1


3 years ago
Target Milestone: --- → Bugzilla 5.0

Comment 1

3 years ago
Regression in 5.0.2 when committing bug 714724. 5.0.1 is fine.
Depends on: 714724
Keywords: regression


3 years ago
Flags: blocking5.0.3+

Comment 2

3 years ago
Posted patch 1235395_2.patch (obsolete) — Splinter Review
Attachment #8702420 - Flags: review?(LpSolit)

Comment 3

3 years ago
Posted patch 1235395_4.patch (obsolete) — Splinter Review
Attachment #8702420 - Attachment is obsolete: true
Attachment #8702420 - Flags: review?(LpSolit)
Attachment #8702430 - Flags: review?(LpSolit)

Comment 4

3 years ago
Fixed recursive import error
Attachment #8702430 - Attachment is obsolete: true
Attachment #8702430 - Flags: review?(LpSolit)
Attachment #8702436 - Flags: review?(LpSolit)

Comment 5

3 years ago
Comment on attachment 8702436 [details] [diff] [review]

Looks good and works fine. The comments below are all nits, but would be good to be fixed on commit to avoid future conflicts when backporting fixes, and to keep consistency within our codebase.

>+++ b/Bugzilla/Mailer.pm

>-@Bugzilla::Mailer::EXPORT = qw(MessageToMTA build_thread_marker);
>+@Bugzilla::Mailer::EXPORT = qw(MessageToMTA build_thread_marker generate_email);

No reason to remove the empty line. Everywhere else, we leave an empty line after ::EXPORT, for readability. Would be good to do it here too, also for consistency.

> use Bugzilla::Util;
>+use Bugzilla::User;

In master, Bugzilla::User is put just above Bugzilla::Util. Doing it here too would avoid useless conflicts in the future when trying to apply a patch from master to the 5.0 branch. It's always painful to have to backport a patch for such minor reasons.

>+sub generate_email {

Here too, generate_email() is put as the first method in master, before MessageToMTA(). Here you put it last. :(

>+++ b/whine.pl
> use warnings;
> use lib qw(. lib);

No reason to remove the empty line. Here too, we always leave an empty line between both, for readability and consistency.

>-use Bugzilla::Mailer;
>+use Bugzilla::Mailer qw(MessageToMTA generate_email);

Here too, this change is useless, and isn't done upstream.

r=LpSolit, but please keep consistency with master (to ease backports) and the remaining code (for consistency).
Attachment #8702436 - Flags: review?(LpSolit) → review+


3 years ago
Flags: approval5.0?


3 years ago
Flags: approval5.0? → approval5.0+

Comment 6

3 years ago
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   15cc087..26a693a  5.0 -> 5.0
Last Resolved: 3 years ago
Resolution: --- → FIXED

Comment 7

3 years ago

Follow all steps but still emails are not going through whining.

Can any one help me out

Bugzilla version :- 5.0.2

Comment 8

3 years ago
@abhishek: As your issue is likely not related to this specific bug report, please see http://www.bugzilla.org/support/ - Thanks!

Comment 9

3 years ago
Dear Ander,

Issue :- 
After upgrading bugzilla from 4.4.4 to 5.0.2 version whining script not running.

Error :- undefined subroutine &main: generate_email called at ./whine.pl line 355

kindly suggest how to resolve the error.

Thanks in advance

Comment 10

3 years ago
Dear Ander,

Can you suggest how to resolve the issue ?

I am waiting for your valuable feedback.


Comment 11

3 years ago
Please see comment 8 again for venues. Your problem is off-topic for this bug report. Thanks.
His question is related to this issue, but questions about how to apply a patch should indeed not be asked here but rather in the support mailing-list (or simply read the documentation).

Either you apply the patch manually (patch -p1 -i name_of_the_patch.diff) or you wait for Bugzilla 5.0.3 which will have this fix.

Comment 13

3 years ago
Issue Resolved,

Thanks a ton Guys.
You need to log in before you can comment on or make changes to this bug.