trac-hacks / tracstats

Project and source code statistics plugin for Trac.
http://trac-hacks.org/wiki/TracStatsPlugin
Other
20 stars 13 forks source link

OverflowError: normalized days too large to fit in a C int #36

Closed monofox closed 11 years ago

monofox commented 11 years ago

While doing a GET operation on /stats, Trac issued an internal error: "OverflowError: normalized days too large to fit in a C int"

I've installed your plugin and clicked on the new tab "stats".

Request parameters: {'path': '/'}

User agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1

System Information

|| '''Trac''' || 1.0 || || '''Babel''' || 0.9.5 || || '''Bitten''' || 0.7dev-r1008 || || '''CustomFieldAdmin''' || 0.2.5 || || '''Genshi''' || 0.6 (without speedups) || || '''GIT''' || 1.7.2.5 || || '''mod_wsgi''' || 3.3 (WSGIProcessGroup WSGIApplicationGroup %{GLOBAL}) || || '''Pygments''' || 1.3.1 || || '''pysqlite''' || 2.4.1 || || '''Python''' || 2.6.6 (r266:84292, Dec 26 2010, 22:48:11) [[br]] [GCC 4.4.5] || || '''pytz''' || 2012d || || '''RPC''' || 1.1.2-r11148 || || '''setuptools''' || 0.6c11 || || '''SQLite''' || 3.7.3 || || '''Subversion''' || 1.6.12 (r955767) || || '''jQuery''' || 1.7.2 ||

Enabled Plugins

Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 497, in _dispatch_request
    dispatcher.dispatch(req)
  File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 214, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.linux-x86_64/egg/tracstats/web_ui.py", line 161, in process_request
    result = self._process(req, cursor, where, data)
  File "build/bdist.linux-x86_64/egg/tracstats/web_ui.py", line 233, in _process
    td = datetime.timedelta(seconds=age)
OverflowError: normalized days too large to fit in a C int
mrjbq7 commented 11 years ago

I made a fix in ff2a8817860cc65aa57b87ec4146f2788a09c9c1 and b423c7b8a732da78ef70e3ad052e7454e4025a2b, can you see if it fixes it for you?

monofox commented 11 years ago

Hello! Yes it's working now.

But what should been shown instead of " Loading..." under the headline? It isn't changing...

Thank you very much!

mrjbq7 commented 11 years ago

A bar chart showing each users contributions over the last 52 weeks... like the bar chart on the first page under /stats... is it not working? The Loading... is replaced by a javascript, can you look at the console and see if there are any jquery errors?

monofox commented 11 years ago

OK. I've forgotten to deploy the htdocs things out of the plugin. And the jQuery-File got an empty file, because i'm using Trac 1.0 and jQuery is integrated. But it's working very well now! Thank you!

mrjbq7 commented 11 years ago

Awesome! If you have any suggestions for additional statistics or improvements, I'm all ears. Sorry it took a couple days to get this fixed for you (I've been traveling and haven't had consistent internet access).

petamem commented 11 years ago

Actually, we were bitten by this today. See http://trac.edgewall.org/ticket/10917 Unfortunately the

easy_install tracstats as mentioned in http://trac-hacks.org/wiki/TracStatsPlugin still installs the 0.4 version which exhibits that bug. You might want to bump up the version or do something, so easy:install sees a working version.

mrjbq7 commented 11 years ago

I'm surprised easy_install wouldn't update to the 0.5 release which is on PyPI -- are you doing easy_install --upgrade TracStats?

petamem commented 11 years ago

No, I did just a easy_install tracstats.

But now you mentioned it:

svn ~ # easy_install --upgrade TracStats Searching for TracStats Reading http://pypi.python.org/simple/TracStats/ Reading http://github.com/mrjbq7/tracstats error: Connection reset by peer

mrjbq7 commented 11 years ago

Hmm, I wonder if it has anything to do with the DDOS on Github. I tried it twice, the first time got the connection reset, the second time it succeeded...

petamem commented 11 years ago

Ok, same here. Success on 3rd try. And... 0.5 installed and works. :-)