Closed Bug 1347175 Opened 7 years ago Closed 7 years ago

Request Nagger not sending emails due to DST change and impossible date math

Categories

(bugzilla.mozilla.org :: Extensions, defect, P1)

Production
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: dylan, Assigned: dylan)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Request nags seems to be having a problem.
I think this actually an error rather than a warning.
Severity: normal → critical
Priority: P2 → P1
I think this relates to setting the TZ variable to begin with a colon.
I'm sorry, this was not obviously a code issue to me, I assumed it was infra and moved on. After running strace() I realized "the signal is coming from inside the house".

Another meta-problem of this is that currently the script is configured to just give raw error messages without context,
so we'll want to fix that.

I'm able to get this to give a stack trace by using Carp::Always (which should be the default for cron scripts):

Invalid local time for date in time zone: America/Los_Angeles
 at local/lib/perl5/DateTime/TimeZone.pm line 239.
	DateTime::TimeZone::_span_for_datetime(DateTime::TimeZone::America::Los_Angeles=HASH(0x6641d78), "local", DateTime=HASH(0x6c23fb8)) called at local/lib/perl5/DateTime/TimeZone.pm line 196
	DateTime::TimeZone::offset_for_local_datetime(DateTime::TimeZone::America::Los_Angeles=HASH(0x6641d78), DateTime=HASH(0x6c23fb8)) called at local/lib/perl5/x86_64-linux-thread-multi/DateTime.pm line 934
	DateTime::_offset_for_local_datetime(DateTime=HASH(0x6c23fb8)) called at local/lib/perl5/x86_64-linux-thread-multi/DateTime.pm line 379
	DateTime::_calc_utc_rd(DateTime=HASH(0x6c23fb8)) called at local/lib/perl5/x86_64-linux-thread-multi/DateTime.pm line 1728
	DateTime::add_duration(undef, DateTime::Duration=HASH(0x6c0e9d0)) called at local/lib/perl5/x86_64-linux-thread-multi/DateTime.pm line 1635
	DateTime::add(DateTime=HASH(0x6c23fb8), "days", 1) called at ./extensions/RequestNagger/bin/send-request-nags.pl line 186
	main::_include_request(HASH(0x6794798), "requestee") called at ./extensions/RequestNagger/bin/send-request-nags.pl line 84
	main::send_nags("reports", ARRAY(0x6641f88), "requestee_sql", "\x{a}    SELECT\x{a}        flagtypes.name AS flag_type,\x{a}        flag"..., "setter_sql", "\x{a}    SELECT\x{a}        flagtypes.name AS flag_type,\x{a}        flag"..., "template", "user", "date", ...) called at ./extensions/RequestNagger/bin/send-request-nags.pl line 55
Assignee: nobody → dylan
Component: Infrastructure → Extensions: RequestNagger
QA Contact: mcote
Depends on: 1356296
See Also: → 1356299
Blocks: 1356296
No longer depends on: 1356296
Depends on: 984438, 232193
Attached patch 1347175_3.patchSplinter Review
This is less than ideal because we're shifting the definition of "weekend" to be UTC-weekend. I think this better than the other immediate alternative of reverting bug 984438.
Attachment #8858069 - Flags: review?(glob)
Comment on attachment 8858069 [details] [diff] [review]
1347175_3.patch

Review of attachment 8858069 [details] [diff] [review]:
-----------------------------------------------------------------

r=glob

::: extensions/RequestNagger/bin/send-request-nags.pl
@@ +156,4 @@
>  
>  sub _include_request {
>      my ($request, $report) = @_;
> +    state $now = datetime_from($db_date, 'UTC')->truncate( to => 'day' );

you probably want
state $now //= datetime_from(..)
Attachment #8858069 - Flags: review?(glob) → review+
(In reply to Byron Jones ‹:glob› from comment #5)
> Comment on attachment 8858069 [details] [diff] [review]
> 1347175_3.patch
> 
> Review of attachment 8858069 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> r=glob
> 
> ::: extensions/RequestNagger/bin/send-request-nags.pl
> @@ +156,4 @@
> >  
> >  sub _include_request {
> >      my ($request, $report) = @_;
> > +    state $now = datetime_from($db_date, 'UTC')->truncate( to => 'day' );
> 
> you probably want
> state $now //= datetime_from(..)

I don't think so:

perl -E 'while (1) { state $foo = say "once" }'
To git@github.com:mozilla-bteam/bmo.git
   cfded4d..f04f94b  master -> master
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Summary: cron: Invalid local time for date in time zone: America/Los_Angeles → Request Nagger not sending emails to DST change and impossible date math
Summary: Request Nagger not sending emails to DST change and impossible date math → Request Nagger not sending emails due to DST change and impossible date math
Component: Extensions: RequestNagger → Extensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: