Opened 16 months ago

Closed 15 months ago

Last modified 15 months ago

#21629 closed Cleanup/optimization (fixed)

Provide better pointers to mysql_tzinfo_to_sql for MySQL users

Reported by: aaugustin 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 timo 15 months ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 16 months ago by anonymous

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

comment:2 Changed 16 months ago by loic84

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

comment:3 Changed 16 months ago by aaugustin

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

Documentation improvements are absolutely needed.

comment:4 Changed 16 months 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 16 months ago by loic84 (next)

comment:5 Changed 15 months ago by timo

  • Triage Stage changed from Unreviewed to Accepted

comment:6 Changed 15 months ago by timo

  • Has patch set

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

Changed 15 months ago by timo

comment:7 Changed 15 months ago by charettes

  • Triage Stage changed from Accepted to Ready for checkin

lgtm

comment:8 Changed 15 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from new to closed

In d8d83777ebbe15af7587a24698435555ba3bb842:

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

Thanks Aymeric for the suggestion.

comment:9 Changed 15 months 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