Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#21629 closed Cleanup/optimization (fixed)

Provide better pointers to mysql_tzinfo_to_sql for MySQL users

Reported by: Aymeric Augustin Owned by: nobody
Component: Documentation Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The exception "ValueError: Database returned an invalid value in QuerySet.dates(). Are time zone definitions and pytz installed?" is quite hard to diagnose when users omitted to run mysql_tzinfo_to_sql.

Technically it says the right thing (time zone definitions aren't installed) but it's hard to locate the information, as it isn't in the MySQL installation docs nor in the time zone docs. I just spent a few minutes searching it in the docs, and I wrote these docs!

I suggest adding it to the time zone FAQ and to the MySQL installation instructions (at least).

Attachments (1)

21629.diff (1.3 KB) - added by Tim Graham 3 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 3 years ago by anonymous

I've changed USE_TZ = TRUE by USE_TZ = False for solved this problem

comment:2 Changed 3 years ago by loic84

FWIW I've slightly improved this error message on master: [32e75803].

comment:3 Changed 3 years ago by Aymeric Augustin

The anonymous has done exactly what this errors message is designed to prevent.

Documentation improvements are absolutely needed.

comment:4 Changed 3 years ago by loic84

I agree that docs are needed, with a link to the relevant mysql docs. Do the other db require a similar treatment? I fixed the error message a while ago after hitting the problem with the test suite. Maybe the error message commit should be backported to stable as well?

Version 0, edited 3 years ago by loic84 (next)

comment:5 Changed 3 years ago by Tim Graham

Triage Stage: UnreviewedAccepted

comment:6 Changed 3 years ago by Tim Graham

Has patch: set

I backported the error message improvement and here's a draft patch.

Changed 3 years ago by Tim Graham

Attachment: 21629.diff added

comment:7 Changed 3 years ago by Simon Charette

Triage Stage: AcceptedReady for checkin

lgtm

comment:8 Changed 3 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In d8d83777ebbe15af7587a24698435555ba3bb842:

Fixed #21629 -- Added instructions for loading MySQL time zone definitions.

Thanks Aymeric for the suggestion.

comment:9 Changed 3 years ago by Tim Graham <timograham@…>

In 62f282a265ae7f8d051f7ce79788cfc1a84d1a24:

[1.6.x] Fixed #21629 -- Added instructions for loading MySQL time zone definitions.

Thanks Aymeric for the suggestion.

Backport of d8d83777eb from master

Note: See TracTickets for help on using tickets.
Back to Top