0

I got this error when I try to access the PayPal IPNs from the admin site.

ValueError at /admin/ipn/paypalipn/
    Database returned an invalid value in QuerySet.datetimes(). Are time zone definitions for your database and pytz installed?
    Request Method: GET
    Request URL:    http://myapp.appspot.com/admin/ipn/paypalipn/
    Django Version: 1.9
    Exception Type: ValueError
    Exception Value:    
    Database returned an invalid value in QuerySet.datetimes(). Are time zone definitions for your database and pytz installed?
    Exception Location: /base/data/home/apps/e~myapp/1.397535426774028716/lib/django/db/models/expressions.py in convert_value, line 945
    Python Executable:  /base/data/home/runtimes/python27/python27_dist/python
    Python Version: 2.7.5
    Python Path:    
    ['/base/data/home/apps/e~myapp/1.397535426774028716',
     '/base/data/home/apps/e~myapp/1.397535426774028716/lib',
     '/base/data/home/runtimes/python27/python27_dist/lib/python27.zip',
     '/base/data/home/runtimes/python27/python27_dist/lib/python2.7',
     '/base/data/home/runtimes/python27/python27_dist/lib/python2.7/plat-linux2',
     '/base/data/home/runtimes/python27/python27_dist/lib/python2.7/lib-tk',
     '/base/data/home/runtimes/python27/python27_dist/lib/python2.7/lib-old',
     '/base/data/home/runtimes/python27/python27_dist/lib/python2.7/lib-dynload',
     '/base/data/home/runtimes/python27/python27_dist/lib/python2.7/site-packages',
     '/base/data/home/runtimes/python27/python27_lib/versions/1',
     '/base/data/home/runtimes/python27/python27_lib/versions/third_party/MySQLdb-1.2.5',
     '/base/data/home/runtimes/python27/python27_lib/versions/third_party/protorpc-1.0',
     '/base/data/home/runtimes/python27/python27_lib/versions/third_party/ssl-2.7',
     '/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3',
     '/base/data/home/runtimes/python27/python27_lib/versions/third_party/webob-1.1.1',
     '/base/data/home/runtimes/python27/python27_lib/versions/third_party/yaml-3.10']
    Server time:    Fri, 30 Dec 2016 22:09:03 +0000

I use Google Mysql and I've tried this answer solution1 on Google Cloud Shell.

mysql> mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -D mysql -u root -p 
    -> "flush tables;" 
    -> flush tables;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'm
ysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -D mysql -u root -p 
"flush tabl' at line 1
mysql> 
Community
  • 1
  • 1
Nazih AIT BENSAID
  • 133
  • 1
  • 2
  • 13

1 Answers1

0

Actually the solution you Googled should be working, but you wrongly did it.

I'll show them again here, but to clarify, the steps below are all copied from the question description.

Steps:

  1. In your system command line instead of MySQL's command-line interface, type mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -D mysql -uroot -p, so you will see something like this:

    ubuntu@ubuntu$ mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -D mysql -uroot -p
    
  2. (optional) Check if the problem is already solved. If not, enter MySQL command-line by mysql -uroot -p in your system, and then type flush tables;. Your screen will look like this:

    ubuntu@ubuntu$ mysql -uroot -p
    Enter password:
    ...
    mysql> flush tables;
    
Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
Myles
  • 454
  • 1
  • 6
  • 12