RhodeCode: 500 Internal Server Error with Statistics enabled

334 views
Skip to first unread message

schander

unread,
Dec 13, 2011, 6:01:32 AM12/13/11
to rhodecode
Hi All,
As soon as statistics are enabled, or infact that are any statics for
the repo I get the above error. The console output is:
------------------------------------------------------------
Error - <type 'exceptions.TypeError'>: nil is not JSON serializable
URL: http://192.168.1.127:5000/hellcat/summary
File 'c:\\python27\\lib\\site-packages\\weberror-0.10.3-py2.7.egg\
\weberror\\errormiddleware.py', line 162 in __call__
app_iter = self.application(environ, sr_checker)
File 'c:\\python27\\lib\\site-packages\\rhodecode-1.2.3-py2.7.egg\
\rhodecode\\lib\\middleware\\simplegit.py', line 106 in __call__
return self.application(environ, start_response)
File 'c:\\python27\\lib\\site-packages\\rhodecode-1.2.3-py2.7.egg\
\rhodecode\\lib\\middleware\\simplehg.py', line 71 in __call__
return self.application(environ, start_response)
File 'c:\\python27\\lib\\site-packages\\beaker-1.5.4-py2.7.egg\\beaker\
\middleware.py', line 152 in __call__
return self.wrap_app(environ, session_start_response)
File 'c:\\python27\\lib\\site-packages\\routes-1.12.3-py2.7.egg\\routes
\\middleware.py', line 131 in __call__
response = self.app(environ, start_response)
File 'c:\\python27\\lib\\site-packages\\pylons-1.0-py2.7.egg\\pylons\
\wsgiapp.py', line 107 in __call__
response = self.dispatch(controller, environ, start_response)
File 'c:\\python27\\lib\\site-packages\\pylons-1.0-py2.7.egg\\pylons\
\wsgiapp.py', line 312 in dispatch
return controller(environ, start_response)
File 'c:\\python27\\lib\\site-packages\\rhodecode-1.2.3-py2.7.egg\
\rhodecode\\lib\\base.py', line 52 in __call__
return WSGIController.__call__(self, environ, start_response)
File 'c:\\python27\\lib\\site-packages\\pylons-1.0-py2.7.egg\\pylons\
\controllers\\core.py', line 211 in __call__
response = self._dispatch_call()
File 'c:\\python27\\lib\\site-packages\\pylons-1.0-py2.7.egg\\pylons\
\controllers\\core.py', line 162 in _dispatch_call
response = self._inspect_call(func)
File 'c:\\python27\\lib\\site-packages\\pylons-1.0-py2.7.egg\\pylons\
\controllers\\core.py', line 105 in _inspect_call
result = self._perform_call(func, args)
File 'c:\\python27\\lib\\site-packages\\pylons-1.0-py2.7.egg\\pylons\
\controllers\\core.py', line 57 in _perform_call
return func(**args)
File 'c:\\python27\\lib\\site-packages\\rhodecode-1.2.3-py2.7.egg\
\rhodecode\\controllers\\summary.py', line 143 in index
key=lambda k: k[1])[:10]
File 'c:\\python27\\lib\\json\\__init__.py', line 231 in dumps
return _default_encoder.encode(obj)
File 'c:\\python27\\lib\\json\\encoder.py', line 201 in encode
chunks = self.iterencode(o, _one_shot=True)
File 'c:\\python27\\lib\\json\\encoder.py', line 264 in iterencode
return _iterencode(o, 0)
File 'c:\\python27\\lib\\json\\encoder.py', line 178 in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: nil is not JSON serializable

As soon as the statistics are reset everything works fine. If they are
enable again then the same error occurs.
This is on a installation that has jsut been upgraded to RhodeCode
1.2.3.

Regards
Satpal

schander

unread,
Dec 15, 2011, 4:44:11 AM12/15/11
to rhodecode
I hate to top post.
Just did search on this group to see anyone else has had this error.
I came across this:
On May 31, 3:25 pm, Giuliano B <gbarb...@aotaonline.com> wrote:
> For those who are getting this problem, here's a WSGI which
> illustrates what you need to do to fix it. Notice the "os.chdir" and
> "PYTHON_EGG_CACHE" lines which aren't in the documentation WSGI.
>
> #!/usr/bin/python
> import os
> os.environ["HGENCODING"] = "UTF-8"
> os.environ['PYTHON_EGG_CACHE'] = '/usr/local/rhodecode/.egg-cache'
> os.chdir('/usr/local/rhodecode/')
> from paste.deploy import loadapp
> from paste.script.util.logging_config import fileConfig
>
> fileConfig('/usr/local/rhodecode/production.ini')
> application = loadapp('config:/usr/local/rhodecode/production.ini')

However I don't know how to implement this.

Can anyone help?

Regards
Satpal

Marcin Kuzminski

unread,
Dec 15, 2011, 8:50:20 AM12/15/11
to rhod...@googlegroups.com
I know few users told me that there are problem with JSON serialization, would be awsome if i would know why, and on what it crashes.

Could You send me somehow a repository that's causing problems ?

schander

unread,
Dec 21, 2011, 9:07:34 AM12/21/11
to rhodecode
Hey,I have a project that is causing the problem.How do you want me to
send it to you.
RegardsSatpal

Marcin Kuzminski

unread,
Dec 21, 2011, 10:27:26 AM12/21/11
to rhod...@googlegroups.com
You can send me by email, or upload to demo.rhodecode.org (preffered)

Thanks

schander

unread,
Dec 22, 2011, 4:11:46 AM12/22/11
to rhodecode

Marcin Kuzminski

unread,
Dec 22, 2011, 9:50:06 PM12/22/11
to rhod...@googlegroups.com
I'd enabled stats on demo, and on my beta branch, both work fine. any more details how can i reproduce this ?

schander

unread,
Dec 23, 2011, 4:21:06 AM12/23/11
to rhodecode
On Dec 23, 2:50 am, Marcin Kuzminski <marcin...@gmail.com> wrote:
> I'd enabled stats on demo, and on my beta branch, both work fine. any more
> details how can i reproduce this ?
I'm not sure.
We have it running on Windows Server 2008 R2 with x64 python
This is what comes up in the log:
[0;36m2011-12-23 09:12:27.111 WARNI [rhodecode.lib.auth] user None
NOT authenticated [0m
[0;32m2011-12-23 09:12:27.454 INFO [rhodecode.lib.auth] user satpal
authenticated correctly [0m
[0;32m2011-12-23 09:12:27.470 INFO [rhodecode.controllers.login]
user satpal is now authenticated and stored in session [0m
[0;32m2011-12-23 09:12:49.217 INFO [rhodecode.lib.utils] Adding user
<AuthUser('id:2:satpal|True')>, action admin_updated_repo on Utils/
ProjectOrphans [0m
[0;32m2011-12-23 09:12:49.217 INFO [paste.httpserver.ThreadPool]
kill_hung_threads status: 5 threads (0 working, 5 idle, 0 starting)
ave time N/A, max time 0.00sec, killed 0 workers [0m
[0;32m2011-12-23 09:12:57.188 INFO [rhodecode.lib.celerylib.tasks]
running task with lockkey
task_420c028f68feec08a64c60a69b8bc56f.lock [0m
Error - <type 'exceptions.TypeError'>: nil is not JSON serializable
URL: http://192.168.1.36:5000/Utils/ProjectOrphans/summary
File 'C:\\Python27\\lib\\site-packages\\weberror-0.10.3-py2.7.egg\
\weberror\\errormiddleware.py', line 162 in __call__
app_iter = self.application(environ, sr_checker)
File 'C:\\Python27\\lib\\site-packages\\rhodecode-1.2.3-py2.7.egg\
\rhodecode\\lib\\middleware\\simplegit.py', line 106 in __call__
return self.application(environ, start_response)
File 'C:\\Python27\\lib\\site-packages\\rhodecode-1.2.3-py2.7.egg\
\rhodecode\\lib\\middleware\\simplehg.py', line 71 in __call__
return self.application(environ, start_response)
File 'C:\\Python27\\lib\\site-packages\\beaker-1.5.4-py2.7.egg\\beaker\
\middleware.py', line 152 in __call__
return self.wrap_app(environ, session_start_response)
File 'C:\\Python27\\lib\\site-packages\\routes-1.12.3-py2.7.egg\\routes
\\middleware.py', line 131 in __call__
response = self.app(environ, start_response)
File 'C:\\Python27\\lib\\site-packages\\pylons-1.0-py2.7.egg\\pylons\
\wsgiapp.py', line 107 in __call__
response = self.dispatch(controller, environ, start_response)
File 'C:\\Python27\\lib\\site-packages\\pylons-1.0-py2.7.egg\\pylons\
\wsgiapp.py', line 312 in dispatch
return controller(environ, start_response)
File 'C:\\Python27\\lib\\site-packages\\rhodecode-1.2.3-py2.7.egg\
\rhodecode\\lib\\base.py', line 52 in __call__
return WSGIController.__call__(self, environ, start_response)
File 'C:\\Python27\\lib\\site-packages\\pylons-1.0-py2.7.egg\\pylons\
\controllers\\core.py', line 211 in __call__
response = self._dispatch_call()
File 'C:\\Python27\\lib\\site-packages\\pylons-1.0-py2.7.egg\\pylons\
\controllers\\core.py', line 162 in _dispatch_call
response = self._inspect_call(func)
File 'C:\\Python27\\lib\\site-packages\\pylons-1.0-py2.7.egg\\pylons\
\controllers\\core.py', line 105 in _inspect_call
result = self._perform_call(func, args)
File 'C:\\Python27\\lib\\site-packages\\pylons-1.0-py2.7.egg\\pylons\
\controllers\\core.py', line 57 in _perform_call
return func(**args)
File 'C:\\Python27\\lib\\site-packages\\rhodecode-1.2.3-py2.7.egg\
\rhodecode\\controllers\\summary.py', line 143 in index
key=lambda k: k[1])[:10]
File 'C:\\Python27\\lib\\json\\__init__.py', line 231 in dumps
return _default_encoder.encode(obj)
File 'C:\\Python27\\lib\\json\\encoder.py', line 201 in encode
chunks = self.iterencode(o, _one_shot=True)
File 'C:\\Python27\\lib\\json\\encoder.py', line 264 in iterencode
return _iterencode(o, 0)
File 'C:\\Python27\\lib\\json\\encoder.py', line 178 in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: nil is not JSON serializable

You can see that I enable the statics and then it falls over.

Satpal

Marcin Kuzminski

unread,
Jan 5, 2012, 11:59:40 PM1/5/12
to rhod...@googlegroups.com
Tried that one on windows and it works fine also. Without a example i can reproduce cannot fix this, sorry

Marcin Kuzminski

unread,
Jan 11, 2012, 11:44:15 PM1/11/12
to rhod...@googlegroups.com
 I think i might know what the problem is. Can you update to the latest stable branch and see if it's fixed there ?
You can do that with this command

pip install --upgrade https://secure.rhodecode.org/rhodecode/archive/default.zip

Vittorio Schiavinato

unread,
Feb 17, 2012, 4:46:37 AM2/17/12
to rhod...@googlegroups.com
I have the version 1.2.5 and the problem persists.

Vittorio Schiavinato

unread,
Feb 17, 2012, 4:48:49 AM2/17/12
to rhod...@googlegroups.com
Note: I'm using CentOS 6 - 64bit

Marcin Kuzminski

unread,
Feb 20, 2012, 10:07:09 PM2/20/12
to rhod...@googlegroups.com
Hmm there was an issue with this, and i think i solved it, can you provide a troublesome repository i could reproduce this issue ?

Vittorio Schiavinato

unread,
Mar 1, 2012, 9:39:12 AM3/1/12
to rhod...@googlegroups.com
This issue is resolved in the version 1.3.2.
Reply all
Reply to author
Forward
0 new messages