Closed victorhooi closed 11 years ago
If you can possibly write a test case for me I'll gladly fix this, but I haven't quite figured out how this happens yet.
(e.g. if I pass a tz aware datetime into from_kwargs it works just as well as a non-tz aware dt)
Also is this in Sentry 2 or still 1.x?
Nevermind TB shows its 2.0 :)
Hi,
Yup, this is Sentry 2.0 on Django 1.4 (Alpha).
These are the steps I take to replicate the issue:
I then try to access a garbage URL on my app to trigger an error.
With "DEBUG = False" in settings.py, I get the normal Django debugging stack trace for the 404. however, if I then try to change it to "DEBUG = True", I get the following output on stdout:
https://gist.github.com/1581217
I also noticed that during the migration, I got the following error about receiving native datetime, whilst time-zone support is active:
http://gist.github.com/1581249
Any idea on what might be happening?
Cheers, Victor
The problem comes from date = kwargs.pop('timestamp', None) or datetime.datetime.now()
in sentry.manager.GroupManager.from_kwargs()
, it shouldn't use datetime.datetime.now()
but timezone.now()
instead... timestamp
in kwargs
should also be a timezone aware datetime, but it's being created by process_data_timestamp()
in sentry.coreapi
. Basically, sentry needs to use timezone.now()
everywhere where it currently uses datetime.datetime.now()
, and also, where it creates datetime
objects (like in process_data_timestamp()
) it needs to create timezone aware datetimes, otherwise django complains
I'm wondering if there's a way we can solve this in the bigger picture.
I'm actually seeing issues in 1.3 currently with timezones and them being off. Here's what I'm thinking we'll do:
Thoughts?
Rethinking this based on feedback. Currently implementation is all clients send in UTC (no TZ), server uses UTC everywhere (no TZ), and at some point, we'll fix USE_TZ scenarios.
I have the same / similar issue. Details say:
TypeError at /sentry/
can't compare offset-naive and offset-aware datetimes
Exception Location: /usr/local/lib/python2.7/dist-packages/sentry/templatetags/sentry_helpers.py
in timesince, line 143
I am using Sentry 1.3.5.
@dcramer: Any updates regarding fixing USE_TZ
scenarios? I would like to use django-sentry for the project, but since the project is based on Django 1.4 and uses time zones, I am unable to do that.
You don't need to use Django 1.4 to use Sentry (in fact, we don't even officially support it). If you're running it as a client/server, things will just work.
Guessing this can be safely closed.
Hi,
I'm attempting to run Django Sentry on Django 1.4 (alpha), and I seem to be hitting an issue with timezone awareness.
Originally, when I ran it, I got the rather nondescript message:
As per the advice here (https://groups.google.com/d/topic/disqus-opensource/kULFXm42eQg/discussion), I added the following to my settings.py:
I then get the following on stderr:
Cheers, Victor